From: <hs...@us...> - 2011-09-20 15:17:04
|
Revision: 962 http://treebase.svn.sourceforge.net/treebase/?rev=962&view=rev Author: hshyket Date: 2011-09-20 15:16:58 +0000 (Tue, 20 Sep 2011) Log Message: ----------- Correcting issue where row segment file can still be uploaded even if the proper amount of tabs are not present (adds tabs to make sure there are 19) Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/service/matrix/RowSegmentServiceImpl.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/service/matrix/RowSegmentServiceImpl.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/service/matrix/RowSegmentServiceImpl.java 2011-09-15 19:37:28 UTC (rev 961) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/service/matrix/RowSegmentServiceImpl.java 2011-09-20 15:16:58 UTC (rev 962) @@ -276,7 +276,20 @@ TSVFileParser parser = new TSVFileParser(); List<List<String>> values = parser.parseFile(pFile, pSkipFirstRow, returnVal); - + + //checks to make sure there are 19 tabs present in each list + for (int x = 0; x < values.size(); x++) { + + if (values.get(x).size() < 19) { + + for (int y = values.get(x).size(); y < 19; y++ ) { + + values.get(x).add(""); + + } + } + } + // check whether parsing is successful: if (returnVal.isSuccessful()) { List<RowSegment> newRS = new ArrayList<RowSegment>(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |