]> source.dussan.org Git - sonarqube.git/commitdiff
Fix compatibility of SourceLineResultSetIterator with past/future formats of FILE_SOU...
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 21 Jan 2015 13:57:03 +0000 (14:57 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 21 Jan 2015 14:20:33 +0000 (15:20 +0100)
server/sonar-server/src/main/java/org/sonar/server/source/index/SourceLineResultSetIterator.java
sonar-core/src/main/java/org/sonar/core/source/db/FileSourceDto.java

index 28c318f95c6fb3b62c96a5717eb494be83536097..5f44a4013fc2f9f8fa6e410731f7db0b8ecb000b 100644 (file)
@@ -155,9 +155,10 @@ public class SourceLineResultSetIterator extends ResultSetIterator<SourceLineRes
 
         doc.setHighlighting(csvRecord.get(FileSourceDto.CSV_INDEX_HIGHLIGHTING));
         doc.setSymbols(csvRecord.get(FileSourceDto.CSV_INDEX_SYMBOLS));
-
         doc.setDuplications(parseDuplications(csvRecord.get(FileSourceDto.CSV_INDEX_DUPLICATIONS)));
-        doc.setSource(csvRecord.get(FileSourceDto.CSV_INDEX_SOURCE));
+
+        // source is always the latest field. All future fields will be added between duplications (14) and source.
+        doc.setSource(csvRecord.get(csvRecord.size()-1));
 
         result.addLine(doc);
 
index bc5d3eacab790630e8bb42825b2a963e2ea8aadf..999ee5f2dd53fe039e602e601016f21daee7e0d5 100644 (file)
@@ -39,7 +39,6 @@ public class FileSourceDto {
   public static final int CSV_INDEX_HIGHLIGHTING = 12;
   public static final int CSV_INDEX_SYMBOLS = 13;
   public static final int CSV_INDEX_DUPLICATIONS = 14;
-  public static final int CSV_INDEX_SOURCE = 15;
 
   private Long id;
   private String projectUuid;