diff options
Diffstat (limited to 'sonar-batch-protocol')
3 files changed, 5 insertions, 14 deletions
diff --git a/sonar-batch-protocol/src/main/protobuf/batch_report.proto b/sonar-batch-protocol/src/main/protobuf/batch_report.proto index bd5b8727821..7937353fe9f 100644 --- a/sonar-batch-protocol/src/main/protobuf/batch_report.proto +++ b/sonar-batch-protocol/src/main/protobuf/batch_report.proto @@ -134,9 +134,6 @@ message Duplicate { // Will be null when duplicate is in the same file optional int32 other_file_ref = 1; optional TextRange range = 2; - - // temporary field during development of computation stack for cross project duplications - optional string other_file_key = 3; } message Duplication { @@ -147,12 +144,11 @@ message Duplication { // Used for cross project duplication message DuplicationBlock { - repeated int32 hash = 1; - optional int32 index_in_file = 2; - optional int32 start_line = 3; - optional int32 end_line = 4; - optional int32 start_token_index = 5; - optional int32 end_token_index = 6; + repeated int32 hash = 1 [packed = true]; + optional int32 start_line = 2; + optional int32 end_line = 3; + optional int32 start_token_index = 4; + optional int32 end_token_index = 5; } // Lines start at 1 and line offsets start at 0 diff --git a/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportReaderTest.java b/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportReaderTest.java index 50dfd49d6c3..3c2c5ac5da9 100644 --- a/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportReaderTest.java +++ b/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportReaderTest.java @@ -154,7 +154,6 @@ public class BatchReportReaderTest { .setEndLine(5) .build()) .addDuplicate(BatchReport.Duplicate.newBuilder() - .setOtherFileKey("COMPONENT_A") .setOtherFileRef(2) .setRange(BatchReport.TextRange.newBuilder() .setStartLine(6) @@ -182,7 +181,6 @@ public class BatchReportReaderTest { .setRef(1).build()); BatchReport.DuplicationBlock duplicationBlock = BatchReport.DuplicationBlock.newBuilder() - .setIndexInFile(1) .addAllHash(asList(1, 2, 3, 5, 7)) .setStartLine(1) .setEndLine(2) diff --git a/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportWriterTest.java b/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportWriterTest.java index eda7000899b..fdd1ba2b67b 100644 --- a/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportWriterTest.java +++ b/sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportWriterTest.java @@ -170,7 +170,6 @@ public class BatchReportWriterTest { .setEndLine(5) .build()) .addDuplicate(BatchReport.Duplicate.newBuilder() - .setOtherFileKey("COMPONENT_A") .setOtherFileRef(2) .setRange(BatchReport.TextRange.newBuilder() .setStartLine(6) @@ -195,7 +194,6 @@ public class BatchReportWriterTest { assertThat(underTest.hasComponentData(FileStructure.Domain.DUPLICATION_BLOCKS, 1)).isFalse(); BatchReport.DuplicationBlock duplicationBlock = BatchReport.DuplicationBlock.newBuilder() - .setIndexInFile(1) .addAllHash(asList(1, 2, 3, 5, 7)) .setStartLine(1) .setEndLine(2) @@ -209,7 +207,6 @@ public class BatchReportWriterTest { assertThat(file).exists().isFile(); try (CloseableIterator<BatchReport.DuplicationBlock> duplicationBlocks = Protobuf.readStream(file, BatchReport.DuplicationBlock.parser())) { BatchReport.DuplicationBlock duplicationBlockResult = duplicationBlocks.next(); - assertThat(duplicationBlockResult.getIndexInFile()).isEqualTo(1); assertThat(duplicationBlockResult.getHashList()).containsOnly(1, 2, 3, 5, 7); assertThat(duplicationBlockResult.getStartLine()).isEqualTo(1); assertThat(duplicationBlockResult.getEndLine()).isEqualTo(2); |