From: Teryk Bellahsene Date: Fri, 17 Apr 2015 15:43:59 +0000 (+0200) Subject: sanitize batch protocol domains relating to use of singular/plural X-Git-Tag: 5.2-RC1~2195 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5184eb75a04d52848226067b30eda5e652029cdf;p=sonarqube.git sanitize batch protocol domains relating to use of singular/plural --- diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/AbstractNewCoverageFileAnalyzer.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/AbstractNewCoverageFileAnalyzer.java index c6ecc1ba900..e215fc18fe5 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/AbstractNewCoverageFileAnalyzer.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/AbstractNewCoverageFileAnalyzer.java @@ -22,7 +22,12 @@ package org.sonar.plugins.core.timemachine; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.commons.lang.ObjectUtils; -import org.sonar.api.batch.*; +import org.sonar.api.batch.Decorator; +import org.sonar.api.batch.DecoratorBarriers; +import org.sonar.api.batch.DecoratorContext; +import org.sonar.api.batch.DependedUpon; +import org.sonar.api.batch.DependsUpon; +import org.sonar.api.batch.RequiresDB; import org.sonar.api.measures.Measure; import org.sonar.api.measures.Metric; import org.sonar.api.resources.Project; @@ -33,8 +38,8 @@ import org.sonar.api.utils.KeyValueFormat; import org.sonar.batch.components.Period; import org.sonar.batch.components.TimeMachineConfiguration; import org.sonar.batch.index.ResourceCache; -import org.sonar.batch.protocol.output.BatchReport.Scm; -import org.sonar.batch.protocol.output.BatchReport.Scm.Changeset; +import org.sonar.batch.protocol.output.BatchReport; +import org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset; import org.sonar.batch.protocol.output.BatchReportReader; import org.sonar.batch.report.ReportPublisher; @@ -118,7 +123,7 @@ public abstract class AbstractNewCoverageFileAnalyzer implements Decorator { private boolean parse(DecoratorContext context) { BatchReportReader reader = new BatchReportReader(publishReportJob.getReportDir()); - Scm componentScm = reader.readComponentScm(resourceCache.get(context.getResource()).batchId()); + BatchReport.Changesets componentScm = reader.readChangesets(resourceCache.get(context.getResource()).batchId()); Measure hitsByLineMeasure = context.getMeasure(getCoverageLineHitsDataMetric()); if (componentScm != null && hitsByLineMeasure != null && hitsByLineMeasure.hasData()) { diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/NewCoverageFileAnalyzerTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/NewCoverageFileAnalyzerTest.java index 6f02ac2f626..b0efe896194 100644 --- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/NewCoverageFileAnalyzerTest.java +++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/NewCoverageFileAnalyzerTest.java @@ -32,8 +32,8 @@ import org.sonar.api.resources.File; import org.sonar.api.resources.Resource; import org.sonar.api.utils.DateUtils; import org.sonar.batch.index.ResourceCache; -import org.sonar.batch.protocol.output.BatchReport.Scm; -import org.sonar.batch.protocol.output.BatchReport.Scm.Changeset; +import org.sonar.batch.protocol.output.BatchReport; +import org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset; import org.sonar.batch.protocol.output.BatchReportWriter; import org.sonar.batch.report.ReportPublisher; @@ -88,7 +88,7 @@ public class NewCoverageFileAnalyzerTest { @Test public void shouldDoNothingIfNoCoverageData() throws ParseException { - writer.writeComponentScm(Scm.newBuilder() + writer.writeComponentChangesets(BatchReport.Changesets.newBuilder() .setComponentRef(1) .addChangeset(Changeset.newBuilder() .setDate(DateUtils.parseDateTime("2008-05-18T00:00:00+0000").getTime()) @@ -105,7 +105,7 @@ public class NewCoverageFileAnalyzerTest { public void shouldGetNewLines() throws ParseException { when(context.getMeasure(CoreMetrics.COVERAGE_LINE_HITS_DATA)).thenReturn( new Measure(CoreMetrics.COVERAGE_LINE_HITS_DATA, "10=2;11=3")); - writer.writeComponentScm(Scm.newBuilder() + writer.writeComponentChangesets(BatchReport.Changesets.newBuilder() .setComponentRef(1) .addChangeset(Changeset.newBuilder() .build()) @@ -155,7 +155,7 @@ public class NewCoverageFileAnalyzerTest { new Measure(CoreMetrics.CONDITIONS_BY_LINE, "11=4")); when(context.getMeasure(CoreMetrics.COVERED_CONDITIONS_BY_LINE)).thenReturn( new Measure(CoreMetrics.COVERED_CONDITIONS_BY_LINE, "11=1")); - writer.writeComponentScm(Scm.newBuilder() + writer.writeComponentChangesets(BatchReport.Changesets.newBuilder() .setComponentRef(1) .addChangeset(Changeset.newBuilder() .build()) @@ -205,7 +205,7 @@ public class NewCoverageFileAnalyzerTest { new Measure(CoreMetrics.CONDITIONS_BY_LINE, "10=1")); when(context.getMeasure(CoreMetrics.COVERED_CONDITIONS_BY_LINE)).thenReturn( new Measure(CoreMetrics.COVERED_CONDITIONS_BY_LINE, "10=1")); - writer.writeComponentScm(Scm.newBuilder() + writer.writeComponentChangesets(BatchReport.Changesets.newBuilder() .setComponentRef(1) .addChangeset(Changeset.newBuilder() .build()) @@ -244,7 +244,7 @@ public class NewCoverageFileAnalyzerTest { new Measure(CoreMetrics.CONDITIONS_BY_LINE, "2=1")); when(context.getMeasure(CoreMetrics.COVERED_CONDITIONS_BY_LINE)).thenReturn( new Measure(CoreMetrics.COVERED_CONDITIONS_BY_LINE, "2=1")); - writer.writeComponentScm(Scm.newBuilder() + writer.writeComponentChangesets(BatchReport.Changesets.newBuilder() .setComponentRef(1) .addChangeset(Changeset.newBuilder() .setDate(DateUtils.parseDateTime("2008-08-02T13:56:37+0200").getTime()) diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/issue/SourceLinesCache.java b/server/sonar-server/src/main/java/org/sonar/server/computation/issue/SourceLinesCache.java index b49e8abf5f4..9af0128ce8e 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/issue/SourceLinesCache.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/issue/SourceLinesCache.java @@ -21,8 +21,8 @@ package org.sonar.server.computation.issue; import org.apache.commons.lang.StringUtils; import org.sonar.batch.protocol.output.BatchReport; -import org.sonar.batch.protocol.output.BatchReport.Scm.Changeset; -import org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.Builder; +import org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset; +import org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.Builder; import org.sonar.batch.protocol.output.BatchReportReader; import org.sonar.server.source.index.SourceLineDoc; import org.sonar.server.source.index.SourceLineIndex; @@ -52,7 +52,7 @@ public class SourceLinesCache { private BatchReportReader reportReader; private boolean loaded = false; - private BatchReport.Scm scm; + private BatchReport.Changesets scm; private String currentFileUuid; private Integer currentFileReportRef; @@ -90,7 +90,7 @@ public class SourceLinesCache { } String author = null; if (lineIndex < scm.getChangesetIndexByLineCount()) { - BatchReport.Scm.Changeset changeset = scm.getChangeset(scm.getChangesetIndexByLine(lineIndex)); + BatchReport.Changesets.Changeset changeset = scm.getChangeset(scm.getChangesetIndexByLine(lineIndex)); author = changeset.hasAuthor() ? changeset.getAuthor() : null; } @@ -113,19 +113,19 @@ public class SourceLinesCache { computeLastCommitDateAndAuthor(); } - private BatchReport.Scm loadScmFromReport() { - return reportReader.readComponentScm(currentFileReportRef); + private BatchReport.Changesets loadScmFromReport() { + return reportReader.readChangesets(currentFileReportRef); } - private BatchReport.Scm loadLinesFromIndexAndBuildScm() { + private BatchReport.Changesets loadLinesFromIndexAndBuildScm() { List lines = index.getLines(currentFileUuid); - Map changesetByRevision = new HashMap<>(); - BatchReport.Scm.Builder scmBuilder = BatchReport.Scm.newBuilder() + Map changesetByRevision = new HashMap<>(); + BatchReport.Changesets.Builder scmBuilder = BatchReport.Changesets.newBuilder() .setComponentRef(currentFileReportRef); for (SourceLineDoc sourceLine : lines) { String scmRevision = sourceLine.scmRevision(); if (scmRevision == null || changesetByRevision.get(scmRevision) == null) { - Builder changeSetBuilder = BatchReport.Scm.Changeset.newBuilder(); + Builder changeSetBuilder = BatchReport.Changesets.Changeset.newBuilder(); String scmAuthor = sourceLine.scmAuthor(); if (scmAuthor != null) { changeSetBuilder.setAuthor(scmAuthor); @@ -152,7 +152,7 @@ public class SourceLinesCache { } private void computeLastCommitDateAndAuthor() { - for (BatchReport.Scm.Changeset changeset : scm.getChangesetList()) { + for (BatchReport.Changesets.Changeset changeset : scm.getChangesetList()) { if (changeset.hasAuthor() && changeset.hasDate() && changeset.getDate() > lastCommitDate) { lastCommitDate = changeset.getDate(); lastCommitAuthor = changeset.getAuthor(); diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/source/ScmLineReader.java b/server/sonar-server/src/main/java/org/sonar/server/computation/source/ScmLineReader.java index 4b162ff94b4..e4fadee5e1d 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/source/ScmLineReader.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/source/ScmLineReader.java @@ -25,15 +25,15 @@ import org.sonar.server.source.db.FileSourceDb; public class ScmLineReader implements LineReader { - private final BatchReport.Scm scmReport; + private final BatchReport.Changesets scmReport; - public ScmLineReader(BatchReport.Scm scmReport) { + public ScmLineReader(BatchReport.Changesets scmReport) { this.scmReport = scmReport; } @Override public void read(FileSourceDb.Line.Builder lineBuilder) { int changeSetIndex = scmReport.getChangesetIndexByLine(lineBuilder.getLine() - 1); - BatchReport.Scm.Changeset changeset = scmReport.getChangeset(changeSetIndex); + BatchReport.Changesets.Changeset changeset = scmReport.getChangeset(changeSetIndex); boolean hasAuthor = changeset.hasAuthor(); if (hasAuthor) { lineBuilder.setScmAuthor(changeset.getAuthor()); diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistFileSourcesStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistFileSourcesStep.java index 7bae33f27d4..77855cdc0c1 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistFileSourcesStep.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistFileSourcesStep.java @@ -178,7 +178,7 @@ public class PersistFileSourcesStep implements ComputationStep { LineReaders(BatchReportReader reportReader, int componentRef) { File coverageFile = reportReader.readComponentCoverage(componentRef); - BatchReport.Scm scmReport = reportReader.readComponentScm(componentRef); + BatchReport.Changesets scmReport = reportReader.readChangesets(componentRef); File highlightingFile = reportReader.readComponentSyntaxHighlighting(componentRef); List symbols = reportReader.readComponentSymbols(componentRef); List duplications = reportReader.readComponentDuplications(componentRef); diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStep.java index 5929138da9d..f9560150120 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStep.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStep.java @@ -87,7 +87,7 @@ public class PersistNumberOfDaysSinceLastCommitStep implements ComputationStep { private void recursivelyProcessComponent(ComputationContext context, int componentRef) { BatchReportReader reportReader = context.getReportReader(); BatchReport.Component component = reportReader.readComponent(componentRef); - BatchReport.Scm scm = reportReader.readComponentScm(componentRef); + BatchReport.Changesets scm = reportReader.readChangesets(componentRef); processScm(scm); for (Integer childRef : component.getChildRefList()) { @@ -95,12 +95,12 @@ public class PersistNumberOfDaysSinceLastCommitStep implements ComputationStep { } } - private void processScm(@Nullable BatchReport.Scm scm) { + private void processScm(@Nullable BatchReport.Changesets scm) { if (scm == null) { return; } - for (BatchReport.Scm.Changeset changeset : scm.getChangesetList()) { + for (BatchReport.Changesets.Changeset changeset : scm.getChangesetList()) { if (changeset.hasDate() && changeset.getDate() > lastCommitTimestamp) { lastCommitTimestamp = changeset.getDate(); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistTestResultsStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistTestResultsStep.java deleted file mode 100644 index 8dd727245fa..00000000000 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistTestResultsStep.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.sonar.server.computation.step; - -import org.sonar.api.i18n.I18n; -import org.sonar.api.resources.Qualifiers; -import org.sonar.batch.protocol.output.BatchReport; -import org.sonar.batch.protocol.output.BatchReportReader; -import org.sonar.core.persistence.DbSession; -import org.sonar.core.persistence.MyBatis; -import org.sonar.core.source.db.FileSourceDto; -import org.sonar.server.computation.ComputationContext; -import org.sonar.server.db.DbClient; - -public class PersistTestResultsStep implements ComputationStep { - - private final DbClient dbClient; - - public PersistTestResultsStep(DbClient dbClient, I18n i18n) { - this.dbClient = dbClient; - } - - @Override - public String[] supportedProjectQualifiers() { - return new String[] {Qualifiers.PROJECT}; - } - - @Override - public void execute(ComputationContext context) { - DbSession session = dbClient.openSession(false); - try { - int rootComponentRef = context.getReportMetadata().getRootComponentRef(); - recursivelyProcessComponent(session, context, rootComponentRef); - session.commit(); - } finally { - MyBatis.closeQuietly(session); - } - } - - private void recursivelyProcessComponent(DbSession session, ComputationContext context, int componentRef) { - BatchReportReader reportReader = context.getReportReader(); - BatchReport.Component component = reportReader.readComponent(componentRef); - if (component.getIsTest() && reportReader.readTestResults(componentRef) != null) { - persistTestResults(session, component); - } - - for (Integer childRef : component.getChildRefList()) { - recursivelyProcessComponent(session, context, childRef); - } - } - - private void persistTestResults(DbSession session, BatchReport.Component component) { - dbClient.fileSourceDao().select(component.getUuid()); - dbClient.fileSourceDao().update(session, new FileSourceDto()); - } - - @Override - public String getDescription() { - return "Persist test results"; - } -} diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/SourceLinesCacheTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/SourceLinesCacheTest.java index 290253b4e3b..5a9403fd765 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/SourceLinesCacheTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/SourceLinesCacheTest.java @@ -61,7 +61,7 @@ public class SourceLinesCacheTest { @Test public void line_author_from_report() throws Exception { BatchReportWriter reportWriter = new BatchReportWriter(dir); - reportWriter.writeComponentScm(BatchReport.Scm.newBuilder() + reportWriter.writeComponentChangesets(BatchReport.Changesets.newBuilder() .setComponentRef(123_456_789) .addChangeset(newChangeset("charb", "123-456-789", 123_456_789L)) .addChangeset(newChangeset("wolinski", "987-654-321", 987_654_321L)) @@ -106,8 +106,8 @@ public class SourceLinesCacheTest { sut.lineAuthor(0); } - private BatchReport.Scm.Changeset.Builder newChangeset(String author, String revision, long date) { - return BatchReport.Scm.Changeset.newBuilder() + private BatchReport.Changesets.Changeset.Builder newChangeset(String author, String revision, long date) { + return BatchReport.Changesets.Changeset.newBuilder() .setAuthor(author) .setRevision(revision) .setDate(date); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/source/ReportIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/source/ReportIteratorTest.java index 86c5e6f405b..9a0a56983f3 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/source/ReportIteratorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/source/ReportIteratorTest.java @@ -55,7 +55,7 @@ public class ReportIteratorTest { .build() )); - file = new FileStructure(dir).fileFor(FileStructure.Domain.COVERAGE, 1); + file = new FileStructure(dir).fileFor(FileStructure.Domain.COVERAGES, 1); } @After diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/source/ScmLineReaderTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/source/ScmLineReaderTest.java index 59c27fe81e1..a8db073973e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/source/ScmLineReaderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/source/ScmLineReaderTest.java @@ -31,8 +31,8 @@ public class ScmLineReaderTest { @Test public void set_scm() throws Exception { - BatchReport.Scm scmReport = BatchReport.Scm.newBuilder() - .addChangeset(BatchReport.Scm.Changeset.newBuilder() + BatchReport.Changesets scmReport = BatchReport.Changesets.newBuilder() + .addChangeset(BatchReport.Changesets.Changeset.newBuilder() .setAuthor("john") .setDate(123456789L) .setRevision("rev-1") @@ -52,8 +52,8 @@ public class ScmLineReaderTest { @Test public void set_only_author() throws Exception { - BatchReport.Scm scmReport = BatchReport.Scm.newBuilder() - .addChangeset(BatchReport.Scm.Changeset.newBuilder() + BatchReport.Changesets scmReport = BatchReport.Changesets.newBuilder() + .addChangeset(BatchReport.Changesets.Changeset.newBuilder() .setAuthor("john") .build()) .addChangesetIndexByLine(0) @@ -71,8 +71,8 @@ public class ScmLineReaderTest { @Test public void set_only_date() throws Exception { - BatchReport.Scm scmReport = BatchReport.Scm.newBuilder() - .addChangeset(BatchReport.Scm.Changeset.newBuilder() + BatchReport.Changesets scmReport = BatchReport.Changesets.newBuilder() + .addChangeset(BatchReport.Changesets.Changeset.newBuilder() .setDate(123456789L) .build()) .addChangesetIndexByLine(0) @@ -90,8 +90,8 @@ public class ScmLineReaderTest { @Test public void set_only_revision() throws Exception { - BatchReport.Scm scmReport = BatchReport.Scm.newBuilder() - .addChangeset(BatchReport.Scm.Changeset.newBuilder() + BatchReport.Changesets scmReport = BatchReport.Changesets.newBuilder() + .addChangeset(BatchReport.Changesets.Changeset.newBuilder() .setRevision("rev-1") .build()) .addChangesetIndexByLine(0) @@ -109,8 +109,8 @@ public class ScmLineReaderTest { @Test public void fail_when_changeset_is_empty() throws Exception { - BatchReport.Scm scmReport = BatchReport.Scm.newBuilder() - .addChangeset(BatchReport.Scm.Changeset.newBuilder() + BatchReport.Changesets scmReport = BatchReport.Changesets.newBuilder() + .addChangeset(BatchReport.Changesets.Changeset.newBuilder() .build()) .addChangesetIndexByLine(0) .build(); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileSourcesStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileSourcesStepTest.java index e9620343928..5b25f6fb651 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileSourcesStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileSourcesStepTest.java @@ -20,8 +20,6 @@ package org.sonar.server.computation.step; -import org.sonar.server.source.db.FileSourceDao; - import com.google.common.collect.Lists; import org.apache.commons.io.FileUtils; import org.junit.After; @@ -43,6 +41,7 @@ import org.sonar.core.source.db.FileSourceDto; import org.sonar.server.component.ComponentTesting; import org.sonar.server.computation.ComputationContext; import org.sonar.server.db.DbClient; +import org.sonar.server.source.db.FileSourceDao; import org.sonar.server.source.db.FileSourceDb; import org.sonar.test.DbTests; @@ -146,7 +145,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest { .setRef(FILE_REF) .setType(Constants.ComponentType.FILE) .setUuid(FILE_UUID) - // Lines is set to 3 but only 2 lines are read from the file -> the last lines should be added + // Lines is set to 3 but only 2 lines are read from the file -> the last lines should be added .setLines(3) .build()); @@ -209,9 +208,9 @@ public class PersistFileSourcesStepTest extends BaseStepTest { public void persist_scm() throws Exception { BatchReportWriter writer = initBasicReport(1); - writer.writeComponentScm(BatchReport.Scm.newBuilder() + writer.writeComponentChangesets(BatchReport.Changesets.newBuilder() .setComponentRef(FILE_REF) - .addChangeset(BatchReport.Scm.Changeset.newBuilder() + .addChangeset(BatchReport.Changesets.Changeset.newBuilder() .setAuthor("john") .setDate(123456789L) .setRevision("rev-1") @@ -237,13 +236,13 @@ public class PersistFileSourcesStepTest extends BaseStepTest { BatchReportWriter writer = initBasicReport(1); writer.writeComponentSyntaxHighlighting(FILE_REF, newArrayList(BatchReport.SyntaxHighlighting.newBuilder() - .setRange(BatchReport.Range.newBuilder() - .setStartLine(1).setEndLine(1) - .setStartOffset(2).setEndOffset(4) - .build()) - .setType(Constants.HighlightingType.ANNOTATION) - .build() - )); + .setRange(BatchReport.Range.newBuilder() + .setStartLine(1).setEndLine(1) + .setStartOffset(2).setEndOffset(4) + .build()) + .setType(Constants.HighlightingType.ANNOTATION) + .build() + )); sut.execute(new ComputationContext(new BatchReportReader(reportDir), ComponentTesting.newProjectDto(PROJECT_UUID))); @@ -266,10 +265,10 @@ public class PersistFileSourcesStepTest extends BaseStepTest { .setStartLine(1).setEndLine(1).setStartOffset(2).setEndOffset(4) .build()) .addReference(BatchReport.Range.newBuilder() - .setStartLine(3).setEndLine(3).setStartOffset(1).setEndOffset(3) - .build() + .setStartLine(3).setEndLine(3).setStartOffset(1).setEndOffset(3) + .build() ).build() - )); + )); sut.execute(new ComputationContext(new BatchReportReader(reportDir), ComponentTesting.newProjectDto(PROJECT_UUID))); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest.java index 846e9432a4d..b65582c80a9 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest.java @@ -83,11 +83,11 @@ public class PersistNumberOfDaysSinceLastCommitStepTest extends BaseStepTest { public void persist_number_of_days_since_last_commit_from_report() throws Exception { long threeDaysAgo = DateUtils.addDays(new Date(), -3).getTime(); BatchReportWriter reportWriter = initReportWithProjectAndFile(); - reportWriter.writeComponentScm( - BatchReport.Scm.newBuilder() + reportWriter.writeComponentChangesets( + BatchReport.Changesets.newBuilder() .setComponentRef(2) .addChangeset( - BatchReport.Scm.Changeset.newBuilder() + BatchReport.Changesets.Changeset.newBuilder() .setDate(threeDaysAgo) ) .build() diff --git a/sonar-batch-protocol/src/main/gen-java/org/sonar/batch/protocol/output/BatchReport.java b/sonar-batch-protocol/src/main/gen-java/org/sonar/batch/protocol/output/BatchReport.java index ae6a1498029..17896edc837 100644 --- a/sonar-batch-protocol/src/main/gen-java/org/sonar/batch/protocol/output/BatchReport.java +++ b/sonar-batch-protocol/src/main/gen-java/org/sonar/batch/protocol/output/BatchReport.java @@ -12984,8 +12984,8 @@ public final class BatchReport { // @@protoc_insertion_point(class_scope:Issues) } - public interface ScmOrBuilder extends - // @@protoc_insertion_point(interface_extends:Scm) + public interface ChangesetsOrBuilder extends + // @@protoc_insertion_point(interface_extends:Changesets) com.google.protobuf.MessageOrBuilder { /** @@ -12998,34 +12998,34 @@ public final class BatchReport { int getComponentRef(); /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - java.util.List + java.util.List getChangesetList(); /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - org.sonar.batch.protocol.output.BatchReport.Scm.Changeset getChangeset(int index); + org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset getChangeset(int index); /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ int getChangesetCount(); /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - java.util.List + java.util.List getChangesetOrBuilderList(); /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - org.sonar.batch.protocol.output.BatchReport.Scm.ChangesetOrBuilder getChangesetOrBuilder( + org.sonar.batch.protocol.output.BatchReport.Changesets.ChangesetOrBuilder getChangesetOrBuilder( int index); /** * repeated int32 changesetIndexByLine = 3 [packed = true]; * *
-     * if changesetIndexByLine[3] = 2 then it means that changeset[2] is the last one on line 4
+     * if changesetIndexByLine[5] = 2 then it means that changeset[2] is the last one on line 6
      * 
*/ java.util.List getChangesetIndexByLineList(); @@ -13033,7 +13033,7 @@ public final class BatchReport { * repeated int32 changesetIndexByLine = 3 [packed = true]; * *
-     * if changesetIndexByLine[3] = 2 then it means that changeset[2] is the last one on line 4
+     * if changesetIndexByLine[5] = 2 then it means that changeset[2] is the last one on line 6
      * 
*/ int getChangesetIndexByLineCount(); @@ -13041,31 +13041,31 @@ public final class BatchReport { * repeated int32 changesetIndexByLine = 3 [packed = true]; * *
-     * if changesetIndexByLine[3] = 2 then it means that changeset[2] is the last one on line 4
+     * if changesetIndexByLine[5] = 2 then it means that changeset[2] is the last one on line 6
      * 
*/ int getChangesetIndexByLine(int index); } /** - * Protobuf type {@code Scm} + * Protobuf type {@code Changesets} */ - public static final class Scm extends + public static final class Changesets extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:Scm) - ScmOrBuilder { - // Use Scm.newBuilder() to construct. - private Scm(com.google.protobuf.GeneratedMessage.Builder builder) { + // @@protoc_insertion_point(message_implements:Changesets) + ChangesetsOrBuilder { + // Use Changesets.newBuilder() to construct. + private Changesets(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } - private Scm(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private Changesets(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - private static final Scm defaultInstance; - public static Scm getDefaultInstance() { + private static final Changesets defaultInstance; + public static Changesets getDefaultInstance() { return defaultInstance; } - public Scm getDefaultInstanceForType() { + public Changesets getDefaultInstanceForType() { return defaultInstance; } @@ -13075,7 +13075,7 @@ public final class BatchReport { getUnknownFields() { return this.unknownFields; } - private Scm( + private Changesets( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -13105,10 +13105,10 @@ public final class BatchReport { } case 18: { if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - changeset_ = new java.util.ArrayList(); + changeset_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000002; } - changeset_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.PARSER, extensionRegistry)); + changeset_.add(input.readMessage(org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.PARSER, extensionRegistry)); break; } case 24: { @@ -13152,33 +13152,33 @@ public final class BatchReport { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_Scm_descriptor; + return org.sonar.batch.protocol.output.BatchReport.internal_static_Changesets_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_Scm_fieldAccessorTable + return org.sonar.batch.protocol.output.BatchReport.internal_static_Changesets_fieldAccessorTable .ensureFieldAccessorsInitialized( - org.sonar.batch.protocol.output.BatchReport.Scm.class, org.sonar.batch.protocol.output.BatchReport.Scm.Builder.class); + org.sonar.batch.protocol.output.BatchReport.Changesets.class, org.sonar.batch.protocol.output.BatchReport.Changesets.Builder.class); } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Scm parsePartialFrom( + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Changesets parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Scm(input, extensionRegistry); + return new Changesets(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } public interface ChangesetOrBuilder extends - // @@protoc_insertion_point(interface_extends:Scm.Changeset) + // @@protoc_insertion_point(interface_extends:Changesets.Changeset) com.google.protobuf.MessageOrBuilder { /** @@ -13219,11 +13219,11 @@ public final class BatchReport { long getDate(); } /** - * Protobuf type {@code Scm.Changeset} + * Protobuf type {@code Changesets.Changeset} */ public static final class Changeset extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:Scm.Changeset) + // @@protoc_insertion_point(message_implements:Changesets.Changeset) ChangesetOrBuilder { // Use Changeset.newBuilder() to construct. private Changeset(com.google.protobuf.GeneratedMessage.Builder builder) { @@ -13301,14 +13301,14 @@ public final class BatchReport { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_Scm_Changeset_descriptor; + return org.sonar.batch.protocol.output.BatchReport.internal_static_Changesets_Changeset_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_Scm_Changeset_fieldAccessorTable + return org.sonar.batch.protocol.output.BatchReport.internal_static_Changesets_Changeset_fieldAccessorTable .ensureFieldAccessorsInitialized( - org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.class, org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.Builder.class); + org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.class, org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.Builder.class); } public static com.google.protobuf.Parser PARSER = @@ -13486,53 +13486,53 @@ public final class BatchReport { return super.writeReplace(); } - public static org.sonar.batch.protocol.output.BatchReport.Scm.Changeset parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.sonar.batch.protocol.output.BatchReport.Scm.Changeset parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.Scm.Changeset parseFrom(byte[] data) + public static org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.sonar.batch.protocol.output.BatchReport.Scm.Changeset parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.Scm.Changeset parseFrom(java.io.InputStream input) + public static org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.sonar.batch.protocol.output.BatchReport.Scm.Changeset parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.Scm.Changeset parseDelimitedFrom(java.io.InputStream input) + public static org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.sonar.batch.protocol.output.BatchReport.Scm.Changeset parseDelimitedFrom( + public static org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.Scm.Changeset parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.sonar.batch.protocol.output.BatchReport.Scm.Changeset parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -13541,7 +13541,7 @@ public final class BatchReport { public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.sonar.batch.protocol.output.BatchReport.Scm.Changeset prototype) { + public static Builder newBuilder(org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -13553,25 +13553,25 @@ public final class BatchReport { return builder; } /** - * Protobuf type {@code Scm.Changeset} + * Protobuf type {@code Changesets.Changeset} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:Scm.Changeset) - org.sonar.batch.protocol.output.BatchReport.Scm.ChangesetOrBuilder { + // @@protoc_insertion_point(builder_implements:Changesets.Changeset) + org.sonar.batch.protocol.output.BatchReport.Changesets.ChangesetOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_Scm_Changeset_descriptor; + return org.sonar.batch.protocol.output.BatchReport.internal_static_Changesets_Changeset_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_Scm_Changeset_fieldAccessorTable + return org.sonar.batch.protocol.output.BatchReport.internal_static_Changesets_Changeset_fieldAccessorTable .ensureFieldAccessorsInitialized( - org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.class, org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.Builder.class); + org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.class, org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.Builder.class); } - // Construct using org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.newBuilder() + // Construct using org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -13606,23 +13606,23 @@ public final class BatchReport { public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_Scm_Changeset_descriptor; + return org.sonar.batch.protocol.output.BatchReport.internal_static_Changesets_Changeset_descriptor; } - public org.sonar.batch.protocol.output.BatchReport.Scm.Changeset getDefaultInstanceForType() { - return org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.getDefaultInstance(); + public org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset getDefaultInstanceForType() { + return org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.getDefaultInstance(); } - public org.sonar.batch.protocol.output.BatchReport.Scm.Changeset build() { - org.sonar.batch.protocol.output.BatchReport.Scm.Changeset result = buildPartial(); + public org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset build() { + org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.sonar.batch.protocol.output.BatchReport.Scm.Changeset buildPartial() { - org.sonar.batch.protocol.output.BatchReport.Scm.Changeset result = new org.sonar.batch.protocol.output.BatchReport.Scm.Changeset(this); + public org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset buildPartial() { + org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset result = new org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -13643,16 +13643,16 @@ public final class BatchReport { } public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.sonar.batch.protocol.output.BatchReport.Scm.Changeset) { - return mergeFrom((org.sonar.batch.protocol.output.BatchReport.Scm.Changeset)other); + if (other instanceof org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset) { + return mergeFrom((org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(org.sonar.batch.protocol.output.BatchReport.Scm.Changeset other) { - if (other == org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.getDefaultInstance()) return this; + public Builder mergeFrom(org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset other) { + if (other == org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.getDefaultInstance()) return this; if (other.hasRevision()) { bitField0_ |= 0x00000001; revision_ = other.revision_; @@ -13678,11 +13678,11 @@ public final class BatchReport { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.sonar.batch.protocol.output.BatchReport.Scm.Changeset parsedMessage = null; + org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.sonar.batch.protocol.output.BatchReport.Scm.Changeset) e.getUnfinishedMessage(); + parsedMessage = (org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -13877,7 +13877,7 @@ public final class BatchReport { return this; } - // @@protoc_insertion_point(builder_scope:Scm.Changeset) + // @@protoc_insertion_point(builder_scope:Changesets.Changeset) } static { @@ -13885,7 +13885,7 @@ public final class BatchReport { defaultInstance.initFields(); } - // @@protoc_insertion_point(class_scope:Scm.Changeset) + // @@protoc_insertion_point(class_scope:Changesets.Changeset) } private int bitField0_; @@ -13905,36 +13905,36 @@ public final class BatchReport { } public static final int CHANGESET_FIELD_NUMBER = 2; - private java.util.List changeset_; + private java.util.List changeset_; /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - public java.util.List getChangesetList() { + public java.util.List getChangesetList() { return changeset_; } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - public java.util.List + public java.util.List getChangesetOrBuilderList() { return changeset_; } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ public int getChangesetCount() { return changeset_.size(); } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - public org.sonar.batch.protocol.output.BatchReport.Scm.Changeset getChangeset(int index) { + public org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset getChangeset(int index) { return changeset_.get(index); } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - public org.sonar.batch.protocol.output.BatchReport.Scm.ChangesetOrBuilder getChangesetOrBuilder( + public org.sonar.batch.protocol.output.BatchReport.Changesets.ChangesetOrBuilder getChangesetOrBuilder( int index) { return changeset_.get(index); } @@ -13945,7 +13945,7 @@ public final class BatchReport { * repeated int32 changesetIndexByLine = 3 [packed = true]; * *
-     * if changesetIndexByLine[3] = 2 then it means that changeset[2] is the last one on line 4
+     * if changesetIndexByLine[5] = 2 then it means that changeset[2] is the last one on line 6
      * 
*/ public java.util.List @@ -13956,7 +13956,7 @@ public final class BatchReport { * repeated int32 changesetIndexByLine = 3 [packed = true]; * *
-     * if changesetIndexByLine[3] = 2 then it means that changeset[2] is the last one on line 4
+     * if changesetIndexByLine[5] = 2 then it means that changeset[2] is the last one on line 6
      * 
*/ public int getChangesetIndexByLineCount() { @@ -13966,7 +13966,7 @@ public final class BatchReport { * repeated int32 changesetIndexByLine = 3 [packed = true]; * *
-     * if changesetIndexByLine[3] = 2 then it means that changeset[2] is the last one on line 4
+     * if changesetIndexByLine[5] = 2 then it means that changeset[2] is the last one on line 6
      * 
*/ public int getChangesetIndexByLine(int index) { @@ -14048,53 +14048,53 @@ public final class BatchReport { return super.writeReplace(); } - public static org.sonar.batch.protocol.output.BatchReport.Scm parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.Changesets parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.sonar.batch.protocol.output.BatchReport.Scm parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.Changesets parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.Scm parseFrom(byte[] data) + public static org.sonar.batch.protocol.output.BatchReport.Changesets parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.sonar.batch.protocol.output.BatchReport.Scm parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.Changesets parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.Scm parseFrom(java.io.InputStream input) + public static org.sonar.batch.protocol.output.BatchReport.Changesets parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.sonar.batch.protocol.output.BatchReport.Scm parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.Changesets parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.Scm parseDelimitedFrom(java.io.InputStream input) + public static org.sonar.batch.protocol.output.BatchReport.Changesets parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.sonar.batch.protocol.output.BatchReport.Scm parseDelimitedFrom( + public static org.sonar.batch.protocol.output.BatchReport.Changesets parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.sonar.batch.protocol.output.BatchReport.Scm parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.Changesets parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.sonar.batch.protocol.output.BatchReport.Scm parseFrom( + public static org.sonar.batch.protocol.output.BatchReport.Changesets parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -14103,7 +14103,7 @@ public final class BatchReport { public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.sonar.batch.protocol.output.BatchReport.Scm prototype) { + public static Builder newBuilder(org.sonar.batch.protocol.output.BatchReport.Changesets prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -14115,25 +14115,25 @@ public final class BatchReport { return builder; } /** - * Protobuf type {@code Scm} + * Protobuf type {@code Changesets} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:Scm) - org.sonar.batch.protocol.output.BatchReport.ScmOrBuilder { + // @@protoc_insertion_point(builder_implements:Changesets) + org.sonar.batch.protocol.output.BatchReport.ChangesetsOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_Scm_descriptor; + return org.sonar.batch.protocol.output.BatchReport.internal_static_Changesets_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_Scm_fieldAccessorTable + return org.sonar.batch.protocol.output.BatchReport.internal_static_Changesets_fieldAccessorTable .ensureFieldAccessorsInitialized( - org.sonar.batch.protocol.output.BatchReport.Scm.class, org.sonar.batch.protocol.output.BatchReport.Scm.Builder.class); + org.sonar.batch.protocol.output.BatchReport.Changesets.class, org.sonar.batch.protocol.output.BatchReport.Changesets.Builder.class); } - // Construct using org.sonar.batch.protocol.output.BatchReport.Scm.newBuilder() + // Construct using org.sonar.batch.protocol.output.BatchReport.Changesets.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -14173,23 +14173,23 @@ public final class BatchReport { public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.sonar.batch.protocol.output.BatchReport.internal_static_Scm_descriptor; + return org.sonar.batch.protocol.output.BatchReport.internal_static_Changesets_descriptor; } - public org.sonar.batch.protocol.output.BatchReport.Scm getDefaultInstanceForType() { - return org.sonar.batch.protocol.output.BatchReport.Scm.getDefaultInstance(); + public org.sonar.batch.protocol.output.BatchReport.Changesets getDefaultInstanceForType() { + return org.sonar.batch.protocol.output.BatchReport.Changesets.getDefaultInstance(); } - public org.sonar.batch.protocol.output.BatchReport.Scm build() { - org.sonar.batch.protocol.output.BatchReport.Scm result = buildPartial(); + public org.sonar.batch.protocol.output.BatchReport.Changesets build() { + org.sonar.batch.protocol.output.BatchReport.Changesets result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.sonar.batch.protocol.output.BatchReport.Scm buildPartial() { - org.sonar.batch.protocol.output.BatchReport.Scm result = new org.sonar.batch.protocol.output.BatchReport.Scm(this); + public org.sonar.batch.protocol.output.BatchReport.Changesets buildPartial() { + org.sonar.batch.protocol.output.BatchReport.Changesets result = new org.sonar.batch.protocol.output.BatchReport.Changesets(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -14216,16 +14216,16 @@ public final class BatchReport { } public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.sonar.batch.protocol.output.BatchReport.Scm) { - return mergeFrom((org.sonar.batch.protocol.output.BatchReport.Scm)other); + if (other instanceof org.sonar.batch.protocol.output.BatchReport.Changesets) { + return mergeFrom((org.sonar.batch.protocol.output.BatchReport.Changesets)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(org.sonar.batch.protocol.output.BatchReport.Scm other) { - if (other == org.sonar.batch.protocol.output.BatchReport.Scm.getDefaultInstance()) return this; + public Builder mergeFrom(org.sonar.batch.protocol.output.BatchReport.Changesets other) { + if (other == org.sonar.batch.protocol.output.BatchReport.Changesets.getDefaultInstance()) return this; if (other.hasComponentRef()) { setComponentRef(other.getComponentRef()); } @@ -14277,11 +14277,11 @@ public final class BatchReport { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.sonar.batch.protocol.output.BatchReport.Scm parsedMessage = null; + org.sonar.batch.protocol.output.BatchReport.Changesets parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.sonar.batch.protocol.output.BatchReport.Scm) e.getUnfinishedMessage(); + parsedMessage = (org.sonar.batch.protocol.output.BatchReport.Changesets) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -14324,22 +14324,22 @@ public final class BatchReport { return this; } - private java.util.List changeset_ = + private java.util.List changeset_ = java.util.Collections.emptyList(); private void ensureChangesetIsMutable() { if (!((bitField0_ & 0x00000002) == 0x00000002)) { - changeset_ = new java.util.ArrayList(changeset_); + changeset_ = new java.util.ArrayList(changeset_); bitField0_ |= 0x00000002; } } private com.google.protobuf.RepeatedFieldBuilder< - org.sonar.batch.protocol.output.BatchReport.Scm.Changeset, org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.Builder, org.sonar.batch.protocol.output.BatchReport.Scm.ChangesetOrBuilder> changesetBuilder_; + org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset, org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.Builder, org.sonar.batch.protocol.output.BatchReport.Changesets.ChangesetOrBuilder> changesetBuilder_; /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - public java.util.List getChangesetList() { + public java.util.List getChangesetList() { if (changesetBuilder_ == null) { return java.util.Collections.unmodifiableList(changeset_); } else { @@ -14347,7 +14347,7 @@ public final class BatchReport { } } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ public int getChangesetCount() { if (changesetBuilder_ == null) { @@ -14357,9 +14357,9 @@ public final class BatchReport { } } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - public org.sonar.batch.protocol.output.BatchReport.Scm.Changeset getChangeset(int index) { + public org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset getChangeset(int index) { if (changesetBuilder_ == null) { return changeset_.get(index); } else { @@ -14367,10 +14367,10 @@ public final class BatchReport { } } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ public Builder setChangeset( - int index, org.sonar.batch.protocol.output.BatchReport.Scm.Changeset value) { + int index, org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset value) { if (changesetBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -14384,10 +14384,10 @@ public final class BatchReport { return this; } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ public Builder setChangeset( - int index, org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.Builder builderForValue) { + int index, org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.Builder builderForValue) { if (changesetBuilder_ == null) { ensureChangesetIsMutable(); changeset_.set(index, builderForValue.build()); @@ -14398,9 +14398,9 @@ public final class BatchReport { return this; } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - public Builder addChangeset(org.sonar.batch.protocol.output.BatchReport.Scm.Changeset value) { + public Builder addChangeset(org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset value) { if (changesetBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -14414,10 +14414,10 @@ public final class BatchReport { return this; } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ public Builder addChangeset( - int index, org.sonar.batch.protocol.output.BatchReport.Scm.Changeset value) { + int index, org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset value) { if (changesetBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -14431,10 +14431,10 @@ public final class BatchReport { return this; } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ public Builder addChangeset( - org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.Builder builderForValue) { + org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.Builder builderForValue) { if (changesetBuilder_ == null) { ensureChangesetIsMutable(); changeset_.add(builderForValue.build()); @@ -14445,10 +14445,10 @@ public final class BatchReport { return this; } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ public Builder addChangeset( - int index, org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.Builder builderForValue) { + int index, org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.Builder builderForValue) { if (changesetBuilder_ == null) { ensureChangesetIsMutable(); changeset_.add(index, builderForValue.build()); @@ -14459,10 +14459,10 @@ public final class BatchReport { return this; } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ public Builder addAllChangeset( - java.lang.Iterable values) { + java.lang.Iterable values) { if (changesetBuilder_ == null) { ensureChangesetIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -14474,7 +14474,7 @@ public final class BatchReport { return this; } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ public Builder clearChangeset() { if (changesetBuilder_ == null) { @@ -14487,7 +14487,7 @@ public final class BatchReport { return this; } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ public Builder removeChangeset(int index) { if (changesetBuilder_ == null) { @@ -14500,16 +14500,16 @@ public final class BatchReport { return this; } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - public org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.Builder getChangesetBuilder( + public org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.Builder getChangesetBuilder( int index) { return getChangesetFieldBuilder().getBuilder(index); } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - public org.sonar.batch.protocol.output.BatchReport.Scm.ChangesetOrBuilder getChangesetOrBuilder( + public org.sonar.batch.protocol.output.BatchReport.Changesets.ChangesetOrBuilder getChangesetOrBuilder( int index) { if (changesetBuilder_ == null) { return changeset_.get(index); } else { @@ -14517,9 +14517,9 @@ public final class BatchReport { } } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - public java.util.List + public java.util.List getChangesetOrBuilderList() { if (changesetBuilder_ != null) { return changesetBuilder_.getMessageOrBuilderList(); @@ -14528,33 +14528,33 @@ public final class BatchReport { } } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - public org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.Builder addChangesetBuilder() { + public org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.Builder addChangesetBuilder() { return getChangesetFieldBuilder().addBuilder( - org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.getDefaultInstance()); + org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.getDefaultInstance()); } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - public org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.Builder addChangesetBuilder( + public org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.Builder addChangesetBuilder( int index) { return getChangesetFieldBuilder().addBuilder( - index, org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.getDefaultInstance()); + index, org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.getDefaultInstance()); } /** - * repeated .Scm.Changeset changeset = 2; + * repeated .Changesets.Changeset changeset = 2; */ - public java.util.List + public java.util.List getChangesetBuilderList() { return getChangesetFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< - org.sonar.batch.protocol.output.BatchReport.Scm.Changeset, org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.Builder, org.sonar.batch.protocol.output.BatchReport.Scm.ChangesetOrBuilder> + org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset, org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.Builder, org.sonar.batch.protocol.output.BatchReport.Changesets.ChangesetOrBuilder> getChangesetFieldBuilder() { if (changesetBuilder_ == null) { changesetBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - org.sonar.batch.protocol.output.BatchReport.Scm.Changeset, org.sonar.batch.protocol.output.BatchReport.Scm.Changeset.Builder, org.sonar.batch.protocol.output.BatchReport.Scm.ChangesetOrBuilder>( + org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset, org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset.Builder, org.sonar.batch.protocol.output.BatchReport.Changesets.ChangesetOrBuilder>( changeset_, ((bitField0_ & 0x00000002) == 0x00000002), getParentForChildren(), @@ -14575,7 +14575,7 @@ public final class BatchReport { * repeated int32 changesetIndexByLine = 3 [packed = true]; * *
-       * if changesetIndexByLine[3] = 2 then it means that changeset[2] is the last one on line 4
+       * if changesetIndexByLine[5] = 2 then it means that changeset[2] is the last one on line 6
        * 
*/ public java.util.List @@ -14586,7 +14586,7 @@ public final class BatchReport { * repeated int32 changesetIndexByLine = 3 [packed = true]; * *
-       * if changesetIndexByLine[3] = 2 then it means that changeset[2] is the last one on line 4
+       * if changesetIndexByLine[5] = 2 then it means that changeset[2] is the last one on line 6
        * 
*/ public int getChangesetIndexByLineCount() { @@ -14596,7 +14596,7 @@ public final class BatchReport { * repeated int32 changesetIndexByLine = 3 [packed = true]; * *
-       * if changesetIndexByLine[3] = 2 then it means that changeset[2] is the last one on line 4
+       * if changesetIndexByLine[5] = 2 then it means that changeset[2] is the last one on line 6
        * 
*/ public int getChangesetIndexByLine(int index) { @@ -14606,7 +14606,7 @@ public final class BatchReport { * repeated int32 changesetIndexByLine = 3 [packed = true]; * *
-       * if changesetIndexByLine[3] = 2 then it means that changeset[2] is the last one on line 4
+       * if changesetIndexByLine[5] = 2 then it means that changeset[2] is the last one on line 6
        * 
*/ public Builder setChangesetIndexByLine( @@ -14620,7 +14620,7 @@ public final class BatchReport { * repeated int32 changesetIndexByLine = 3 [packed = true]; * *
-       * if changesetIndexByLine[3] = 2 then it means that changeset[2] is the last one on line 4
+       * if changesetIndexByLine[5] = 2 then it means that changeset[2] is the last one on line 6
        * 
*/ public Builder addChangesetIndexByLine(int value) { @@ -14633,7 +14633,7 @@ public final class BatchReport { * repeated int32 changesetIndexByLine = 3 [packed = true]; * *
-       * if changesetIndexByLine[3] = 2 then it means that changeset[2] is the last one on line 4
+       * if changesetIndexByLine[5] = 2 then it means that changeset[2] is the last one on line 6
        * 
*/ public Builder addAllChangesetIndexByLine( @@ -14648,7 +14648,7 @@ public final class BatchReport { * repeated int32 changesetIndexByLine = 3 [packed = true]; * *
-       * if changesetIndexByLine[3] = 2 then it means that changeset[2] is the last one on line 4
+       * if changesetIndexByLine[5] = 2 then it means that changeset[2] is the last one on line 6
        * 
*/ public Builder clearChangesetIndexByLine() { @@ -14658,15 +14658,15 @@ public final class BatchReport { return this; } - // @@protoc_insertion_point(builder_scope:Scm) + // @@protoc_insertion_point(builder_scope:Changesets) } static { - defaultInstance = new Scm(true); + defaultInstance = new Changesets(true); defaultInstance.initFields(); } - // @@protoc_insertion_point(class_scope:Scm) + // @@protoc_insertion_point(class_scope:Changesets) } public interface DuplicateOrBuilder extends @@ -23562,15 +23562,15 @@ public final class BatchReport { com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_Issues_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_Scm_descriptor; + internal_static_Changesets_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_Scm_fieldAccessorTable; + internal_static_Changesets_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_Scm_Changeset_descriptor; + internal_static_Changesets_Changeset_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_Scm_Changeset_fieldAccessorTable; + internal_static_Changesets_Changeset_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_Duplicate_descriptor; private static @@ -23680,37 +23680,37 @@ public final class BatchReport { "\023\n\013diff_fields\030\030 \001(\t\022\022\n\nis_changed\030\031 \001(\010" + "\022\036\n\026must_send_notification\030\032 \001(\010\"N\n\006Issu" + "es\022\025\n\rcomponent_ref\030\001 \001(\005\022\025\n\005issue\030\002 \003(\013" + - "2\006.Issue\022\026\n\016component_uuid\030\003 \001(\t\"\236\001\n\003Scm" + - "\022\025\n\rcomponent_ref\030\001 \001(\005\022!\n\tchangeset\030\002 \003" + - "(\0132\016.Scm.Changeset\022 \n\024changesetIndexByLi" + - "ne\030\003 \003(\005B\002\020\001\032;\n\tChangeset\022\020\n\010revision\030\001 " + - "\001(\t\022\016\n\006author\030\002 \001(\t\022\014\n\004date\030\003 \001(\003\"R\n\tDup", - "licate\022\026\n\016other_file_ref\030\001 \001(\005\022\025\n\005range\030" + - "\002 \001(\0132\006.Range\022\026\n\016other_file_key\030\003 \001(\t\"M\n" + - "\013Duplication\022\037\n\017origin_position\030\001 \001(\0132\006." + - "Range\022\035\n\tduplicate\030\002 \003(\0132\n.Duplicate\"H\n\014" + - "Duplications\022\025\n\rcomponent_ref\030\001 \001(\005\022!\n\013d" + - "uplication\030\002 \003(\0132\014.Duplication\"W\n\005Range\022" + - "\022\n\nstart_line\030\001 \001(\005\022\020\n\010end_line\030\002 \001(\005\022\024\n" + - "\014start_offset\030\003 \001(\005\022\022\n\nend_offset\030\004 \001(\005\"" + - "~\n\007Symbols\022\020\n\010file_ref\030\001 \001(\005\022\037\n\006symbol\030\002" + - " \003(\0132\017.Symbols.Symbol\032@\n\006Symbol\022\033\n\013decla", - "ration\030\001 \001(\0132\006.Range\022\031\n\treference\030\002 \003(\0132" + - "\006.Range\"\260\001\n\010Coverage\022\014\n\004line\030\001 \001(\005\022\022\n\nco" + - "nditions\030\002 \001(\005\022\017\n\007ut_hits\030\003 \001(\010\022\017\n\007it_hi" + - "ts\030\004 \001(\010\022\035\n\025ut_covered_conditions\030\005 \001(\005\022" + - "\035\n\025it_covered_conditions\030\006 \001(\005\022\"\n\032overal" + - "l_covered_conditions\030\007 \001(\005\"L\n\022SyntaxHigh" + - "lighting\022\025\n\005range\030\001 \001(\0132\006.Range\022\037\n\004type\030" + - "\002 \001(\0162\021.HighlightingType\"\203\001\n\004Test\022\014\n\004nam" + - "e\030\001 \001(\t\022\027\n\004type\030\002 \001(\0162\t.TestType\022\033\n\006stat" + - "us\030\003 \001(\0162\013.TestStatus\022\026\n\016duration_in_ms\030", - "\004 \001(\003\022\022\n\nstacktrace\030\005 \001(\t\022\013\n\003msg\030\006 \001(\t\"\221" + - "\001\n\016CoverageDetail\022\021\n\ttest_name\030\001 \001(\t\0221\n\014" + - "covered_file\030\002 \003(\0132\033.CoverageDetail.Cove" + - "redFile\0329\n\013CoveredFile\022\020\n\010file_ref\030\001 \001(\005" + - "\022\030\n\014covered_line\030\002 \003(\005B\002\020\001B#\n\037org.sonar." + - "batch.protocol.outputH\001" + "2\006.Issue\022\026\n\016component_uuid\030\003 \001(\t\"\254\001\n\nCha" + + "ngesets\022\025\n\rcomponent_ref\030\001 \001(\005\022(\n\tchange" + + "set\030\002 \003(\0132\025.Changesets.Changeset\022 \n\024chan" + + "gesetIndexByLine\030\003 \003(\005B\002\020\001\032;\n\tChangeset\022" + + "\020\n\010revision\030\001 \001(\t\022\016\n\006author\030\002 \001(\t\022\014\n\004dat", + "e\030\003 \001(\003\"R\n\tDuplicate\022\026\n\016other_file_ref\030\001" + + " \001(\005\022\025\n\005range\030\002 \001(\0132\006.Range\022\026\n\016other_fil" + + "e_key\030\003 \001(\t\"M\n\013Duplication\022\037\n\017origin_pos" + + "ition\030\001 \001(\0132\006.Range\022\035\n\tduplicate\030\002 \003(\0132\n" + + ".Duplicate\"H\n\014Duplications\022\025\n\rcomponent_" + + "ref\030\001 \001(\005\022!\n\013duplication\030\002 \003(\0132\014.Duplica" + + "tion\"W\n\005Range\022\022\n\nstart_line\030\001 \001(\005\022\020\n\010end" + + "_line\030\002 \001(\005\022\024\n\014start_offset\030\003 \001(\005\022\022\n\nend" + + "_offset\030\004 \001(\005\"~\n\007Symbols\022\020\n\010file_ref\030\001 \001" + + "(\005\022\037\n\006symbol\030\002 \003(\0132\017.Symbols.Symbol\032@\n\006S", + "ymbol\022\033\n\013declaration\030\001 \001(\0132\006.Range\022\031\n\tre" + + "ference\030\002 \003(\0132\006.Range\"\260\001\n\010Coverage\022\014\n\004li" + + "ne\030\001 \001(\005\022\022\n\nconditions\030\002 \001(\005\022\017\n\007ut_hits\030" + + "\003 \001(\010\022\017\n\007it_hits\030\004 \001(\010\022\035\n\025ut_covered_con" + + "ditions\030\005 \001(\005\022\035\n\025it_covered_conditions\030\006" + + " \001(\005\022\"\n\032overall_covered_conditions\030\007 \001(\005" + + "\"L\n\022SyntaxHighlighting\022\025\n\005range\030\001 \001(\0132\006." + + "Range\022\037\n\004type\030\002 \001(\0162\021.HighlightingType\"\203" + + "\001\n\004Test\022\014\n\004name\030\001 \001(\t\022\027\n\004type\030\002 \001(\0162\t.Te" + + "stType\022\033\n\006status\030\003 \001(\0162\013.TestStatus\022\026\n\016d", + "uration_in_ms\030\004 \001(\003\022\022\n\nstacktrace\030\005 \001(\t\022" + + "\013\n\003msg\030\006 \001(\t\"\221\001\n\016CoverageDetail\022\021\n\ttest_" + + "name\030\001 \001(\t\0221\n\014covered_file\030\002 \003(\0132\033.Cover" + + "ageDetail.CoveredFile\0329\n\013CoveredFile\022\020\n\010" + + "file_ref\030\001 \001(\005\022\030\n\014covered_line\030\002 \003(\005B\002\020\001" + + "B#\n\037org.sonar.batch.protocol.outputH\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -23773,17 +23773,17 @@ public final class BatchReport { com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_Issues_descriptor, new java.lang.String[] { "ComponentRef", "Issue", "ComponentUuid", }); - internal_static_Scm_descriptor = + internal_static_Changesets_descriptor = getDescriptor().getMessageTypes().get(8); - internal_static_Scm_fieldAccessorTable = new + internal_static_Changesets_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_Scm_descriptor, + internal_static_Changesets_descriptor, new java.lang.String[] { "ComponentRef", "Changeset", "ChangesetIndexByLine", }); - internal_static_Scm_Changeset_descriptor = - internal_static_Scm_descriptor.getNestedTypes().get(0); - internal_static_Scm_Changeset_fieldAccessorTable = new + internal_static_Changesets_Changeset_descriptor = + internal_static_Changesets_descriptor.getNestedTypes().get(0); + internal_static_Changesets_Changeset_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_Scm_Changeset_descriptor, + internal_static_Changesets_Changeset_descriptor, new java.lang.String[] { "Revision", "Author", "Date", }); internal_static_Duplicate_descriptor = getDescriptor().getMessageTypes().get(9); diff --git a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportReader.java b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportReader.java index d673b58082b..c41ce080065 100644 --- a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportReader.java +++ b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportReader.java @@ -55,10 +55,10 @@ public class BatchReportReader { } @CheckForNull - public BatchReport.Scm readComponentScm(int componentRef) { - File file = fileStructure.fileFor(FileStructure.Domain.SCM, componentRef); + public BatchReport.Changesets readChangesets(int componentRef) { + File file = fileStructure.fileFor(FileStructure.Domain.CHANGESETS, componentRef); if (doesFileExists(file)) { - return ProtobufUtil.readFile(file, BatchReport.Scm.PARSER); + return ProtobufUtil.readFile(file, BatchReport.Changesets.PARSER); } return null; } @@ -111,13 +111,13 @@ public class BatchReportReader { } public boolean hasSyntaxHighlighting(int componentRef) { - File file = fileStructure.fileFor(FileStructure.Domain.SYNTAX_HIGHLIGHTING, componentRef); + File file = fileStructure.fileFor(FileStructure.Domain.SYNTAX_HIGHLIGHTINGS, componentRef); return file.exists(); } @CheckForNull public File readComponentSyntaxHighlighting(int fileRef) { - File file = fileStructure.fileFor(FileStructure.Domain.SYNTAX_HIGHLIGHTING, fileRef); + File file = fileStructure.fileFor(FileStructure.Domain.SYNTAX_HIGHLIGHTINGS, fileRef); if (doesFileExists(file)) { return file; } @@ -126,7 +126,7 @@ public class BatchReportReader { @CheckForNull public File readComponentCoverage(int fileRef) { - File file = fileStructure.fileFor(FileStructure.Domain.COVERAGE, fileRef); + File file = fileStructure.fileFor(FileStructure.Domain.COVERAGES, fileRef); if (doesFileExists(file)) { return file; } diff --git a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportWriter.java b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportWriter.java index 41d98e24ecf..9a58c825c0b 100644 --- a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportWriter.java +++ b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/BatchReportWriter.java @@ -71,9 +71,9 @@ public class BatchReportWriter { ProtobufUtil.writeToFile(measuresBuilder.build(), file); } - public void writeComponentScm(BatchReport.Scm scm) { - File file = fileStructure.fileFor(FileStructure.Domain.SCM, scm.getComponentRef()); - ProtobufUtil.writeToFile(scm, file); + public void writeComponentChangesets(BatchReport.Changesets changesets) { + File file = fileStructure.fileFor(FileStructure.Domain.CHANGESETS, changesets.getComponentRef()); + ProtobufUtil.writeToFile(changesets, file); } /** @@ -106,12 +106,12 @@ public class BatchReportWriter { } public void writeComponentSyntaxHighlighting(int componentRef, Iterable syntaxHighlightingRules) { - File file = fileStructure.fileFor(FileStructure.Domain.SYNTAX_HIGHLIGHTING, componentRef); + File file = fileStructure.fileFor(FileStructure.Domain.SYNTAX_HIGHLIGHTINGS, componentRef); ProtobufUtil.writeMessagesToFile(syntaxHighlightingRules, file); } public void writeComponentCoverage(int componentRef, Iterable coverageList) { - File file = fileStructure.fileFor(FileStructure.Domain.COVERAGE, componentRef); + File file = fileStructure.fileFor(FileStructure.Domain.COVERAGES, componentRef); ProtobufUtil.writeMessagesToFile(coverageList, file); } diff --git a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/FileStructure.java b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/FileStructure.java index 664ded567a0..a2a3729149e 100644 --- a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/FileStructure.java +++ b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/FileStructure.java @@ -32,10 +32,10 @@ public class FileStructure { COMPONENT("component-", Domain.PB), MEASURES("measures-", Domain.PB), DUPLICATIONS("duplications-", Domain.PB), - SYNTAX_HIGHLIGHTING("syntax-highlighting-", Domain.PB), - SCM("scm-", Domain.PB), - SYMBOLS("symbol-", Domain.PB), - COVERAGE("coverage-", Domain.PB), + SYNTAX_HIGHLIGHTINGS("syntax-highlightings-", Domain.PB), + CHANGESETS("changesets-", Domain.PB), + SYMBOLS("symbols-", Domain.PB), + COVERAGES("coverages-", Domain.PB), TESTS("tests-", Domain.PB), COVERAGE_DETAILS("coverage-details-", Domain.PB), SOURCE("source-", ".txt"); diff --git a/sonar-batch-protocol/src/main/protobuf/batch_report.proto b/sonar-batch-protocol/src/main/protobuf/batch_report.proto index 99825feb940..6f3620a22dc 100644 --- a/sonar-batch-protocol/src/main/protobuf/batch_report.proto +++ b/sonar-batch-protocol/src/main/protobuf/batch_report.proto @@ -157,10 +157,10 @@ message Issues { optional string component_uuid = 3; } -message Scm { +message Changesets { optional int32 component_ref = 1; repeated Changeset changeset = 2; - // if changesetIndexByLine[3] = 2 then it means that changeset[2] is the last one on line 4 + // if changesetIndexByLine[5] = 2 then it means that changeset[2] is the last one on line 6 repeated int32 changesetIndexByLine = 3 [packed = true]; message Changeset { 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 1eacfbd0f75..261980ce3d0 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 @@ -63,8 +63,8 @@ public class BatchReportReaderTest { assertThat(deletedComponentIssues.getIssueList()).hasSize(1); assertThat(sut.readComponentMeasures(1)).hasSize(1); assertThat(sut.readComponentMeasures(1).get(0).getStringValue()).isEqualTo("value_a"); - assertThat(sut.readComponentScm(1).getChangesetList()).hasSize(1); - assertThat(sut.readComponentScm(1).getChangeset(0).getDate()).isEqualTo(123_456_789L); + assertThat(sut.readChangesets(1).getChangesetList()).hasSize(1); + assertThat(sut.readChangesets(1).getChangeset(0).getDate()).isEqualTo(123_456_789L); } @Test @@ -295,7 +295,7 @@ public class BatchReportReaderTest { @Test public void null_if_no_scm_found() throws Exception { - assertThat(sut.readComponentScm(666)).isNull(); + assertThat(sut.readChangesets(666)).isNull(); } @Test @@ -366,10 +366,10 @@ public class BatchReportReaderTest { .setStringValue("value_a"); writer.writeComponentMeasures(1, Arrays.asList(measure.build())); - BatchReport.Scm.Builder scm = BatchReport.Scm.newBuilder() + BatchReport.Changesets.Builder scm = BatchReport.Changesets.newBuilder() .setComponentRef(1) - .addChangeset(BatchReport.Scm.Changeset.newBuilder().setDate(123_456_789).setAuthor("jack.daniels").setRevision("123-456-789")); - writer.writeComponentScm(scm.build()); + .addChangeset(BatchReport.Changesets.Changeset.newBuilder().setDate(123_456_789).setAuthor("jack.daniels").setRevision("123-456-789")); + writer.writeComponentChangesets(scm.build()); } } 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 8fa141e9772..74991cc171a 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 @@ -169,23 +169,23 @@ public class BatchReportWriterTest { @Test public void write_scm() throws Exception { - assertThat(sut.hasComponentData(FileStructure.Domain.SCM, 1)).isFalse(); + assertThat(sut.hasComponentData(FileStructure.Domain.CHANGESETS, 1)).isFalse(); - BatchReport.Scm scm = BatchReport.Scm.newBuilder() + BatchReport.Changesets scm = BatchReport.Changesets.newBuilder() .setComponentRef(1) .addChangesetIndexByLine(0) - .addChangeset(BatchReport.Scm.Changeset.newBuilder() + .addChangeset(BatchReport.Changesets.Changeset.newBuilder() .setRevision("123-456-789") .setAuthor("author") .setDate(123_456_789L)) .build(); - sut.writeComponentScm(scm); + sut.writeComponentChangesets(scm); - assertThat(sut.hasComponentData(FileStructure.Domain.SCM, 1)).isTrue(); - File file = sut.getFileStructure().fileFor(FileStructure.Domain.SCM, 1); + assertThat(sut.hasComponentData(FileStructure.Domain.CHANGESETS, 1)).isTrue(); + File file = sut.getFileStructure().fileFor(FileStructure.Domain.CHANGESETS, 1); assertThat(file).exists().isFile(); - BatchReport.Scm read = ProtobufUtil.readFile(file, BatchReport.Scm.PARSER); + BatchReport.Changesets read = ProtobufUtil.readFile(file, BatchReport.Changesets.PARSER); assertThat(read.getComponentRef()).isEqualTo(1); assertThat(read.getChangesetCount()).isEqualTo(1); assertThat(read.getChangesetList()).hasSize(1); @@ -259,7 +259,7 @@ public class BatchReportWriterTest { @Test public void write_syntax_highlighting() throws Exception { // no data yet - assertThat(sut.hasComponentData(FileStructure.Domain.SYNTAX_HIGHLIGHTING, 1)).isFalse(); + assertThat(sut.hasComponentData(FileStructure.Domain.SYNTAX_HIGHLIGHTINGS, 1)).isFalse(); sut.writeComponentSyntaxHighlighting(1, Arrays.asList( BatchReport.SyntaxHighlighting.newBuilder() @@ -271,13 +271,13 @@ public class BatchReportWriterTest { .build() )); - assertThat(sut.hasComponentData(FileStructure.Domain.SYNTAX_HIGHLIGHTING, 1)).isTrue(); + assertThat(sut.hasComponentData(FileStructure.Domain.SYNTAX_HIGHLIGHTINGS, 1)).isTrue(); } @Test public void write_coverage() throws Exception { // no data yet - assertThat(sut.hasComponentData(FileStructure.Domain.COVERAGE, 1)).isFalse(); + assertThat(sut.hasComponentData(FileStructure.Domain.COVERAGES, 1)).isFalse(); sut.writeComponentCoverage(1, Arrays.asList( BatchReport.Coverage.newBuilder() @@ -291,7 +291,7 @@ public class BatchReportWriterTest { .build() )); - assertThat(sut.hasComponentData(FileStructure.Domain.COVERAGE, 1)).isTrue(); + assertThat(sut.hasComponentData(FileStructure.Domain.COVERAGES, 1)).isTrue(); } @Test diff --git a/sonar-batch/src/main/java/org/sonar/batch/scm/DefaultBlameOutput.java b/sonar-batch/src/main/java/org/sonar/batch/scm/DefaultBlameOutput.java index c12a6afc58e..d369b9efec1 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scm/DefaultBlameOutput.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scm/DefaultBlameOutput.java @@ -29,7 +29,7 @@ import org.sonar.api.batch.scm.BlameLine; import org.sonar.batch.index.BatchResource; import org.sonar.batch.index.ResourceCache; import org.sonar.batch.protocol.output.BatchReport; -import org.sonar.batch.protocol.output.BatchReport.Scm.Builder; +import org.sonar.batch.protocol.output.BatchReport.Changesets.Builder; import org.sonar.batch.protocol.output.BatchReportWriter; import org.sonar.batch.util.ProgressReport; @@ -76,7 +76,7 @@ class DefaultBlameOutput implements BlameOutput { } BatchResource batchComponent = componentCache.get(file); - Builder scmBuilder = BatchReport.Scm.newBuilder(); + Builder scmBuilder = BatchReport.Changesets.newBuilder(); scmBuilder.setComponentRef(batchComponent.batchId()); Map changesetsIdByRevision = new HashMap<>(); @@ -93,14 +93,14 @@ class DefaultBlameOutput implements BlameOutput { addChangeset(scmBuilder, line); } } - writer.writeComponentScm(scmBuilder.build()); + writer.writeComponentChangesets(scmBuilder.build()); allFilesToBlame.remove(file); count++; progressReport.message(count + "/" + total + " files analyzed, last one was " + file.absolutePath()); } private void addChangeset(Builder scmBuilder, BlameLine line) { - BatchReport.Scm.Changeset.Builder changesetBuilder = BatchReport.Scm.Changeset.newBuilder(); + BatchReport.Changesets.Changeset.Builder changesetBuilder = BatchReport.Changesets.Changeset.newBuilder(); if (StringUtils.isNotBlank(line.revision())) { changesetBuilder.setRevision(line.revision()); } diff --git a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/scm/ScmMediumTest.java b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/scm/ScmMediumTest.java index 7c80e0db6dd..e11782bdd54 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/scm/ScmMediumTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/scm/ScmMediumTest.java @@ -32,9 +32,9 @@ import org.sonar.batch.mediumtest.BatchMediumTester; import org.sonar.batch.mediumtest.BatchMediumTester.TaskBuilder; import org.sonar.batch.mediumtest.TaskResult; import org.sonar.batch.protocol.input.FileData; +import org.sonar.batch.protocol.output.BatchReport; +import org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset; import org.sonar.batch.protocol.output.BatchReport.Component; -import org.sonar.batch.protocol.output.BatchReport.Scm; -import org.sonar.batch.protocol.output.BatchReport.Scm.Changeset; import org.sonar.batch.protocol.output.BatchReportReader; import org.sonar.xoo.XooPlugin; @@ -87,7 +87,7 @@ public class ScmMediumTest { .build()) .start(); - Scm fileScm = getScm(baseDir, 0); + BatchReport.Changesets fileScm = getChangesets(baseDir, 0); assertThat(fileScm.getChangesetIndexByLineList()).hasSize(5); @@ -107,14 +107,14 @@ public class ScmMediumTest { assertThat(changesetLine5.getAuthor()).isEqualTo("simon"); } - private Scm getScm(File baseDir, int fileId) { + private BatchReport.Changesets getChangesets(File baseDir, int fileId) { File reportDir = new File(baseDir, ".sonar/batch-report"); BatchReportReader reader = new BatchReportReader(reportDir); Component project = reader.readComponent(reader.readMetadata().getRootComponentRef()); Component dir = reader.readComponent(project.getChildRef(0)); Component file = reader.readComponent(dir.getChildRef(fileId)); - Scm fileScm = reader.readComponentScm(file.getRef()); + BatchReport.Changesets fileScm = reader.readChangesets(file.getRef()); return fileScm; } @@ -139,9 +139,9 @@ public class ScmMediumTest { .build()) .start(); - Scm fileScm = getScm(baseDir, 0); + BatchReport.Changesets changesets = getChangesets(baseDir, 0); - assertThat(fileScm).isNull(); + assertThat(changesets).isNull(); } @@ -165,10 +165,10 @@ public class ScmMediumTest { .build()) .start(); - Scm file1Scm = getScm(baseDir, 0); + BatchReport.Changesets file1Scm = getChangesets(baseDir, 0); assertThat(file1Scm).isNotNull(); - Scm file2Scm = getScm(baseDir, 1); + BatchReport.Changesets file2Scm = getChangesets(baseDir, 1); assertThat(file2Scm).isNull(); } @@ -201,10 +201,10 @@ public class ScmMediumTest { taskBuilder.start(); - Scm file1Scm = getScm(baseDir, 0); + BatchReport.Changesets file1Scm = getChangesets(baseDir, 0); assertThat(file1Scm).isNotNull(); - Scm file2Scm = getScm(baseDir, 1); + BatchReport.Changesets file2Scm = getChangesets(baseDir, 1); assertThat(file2Scm).isNotNull(); } @@ -226,7 +226,7 @@ public class ScmMediumTest { .build()) .start(); - Scm file1Scm = getScm(baseDir, 0); + BatchReport.Changesets file1Scm = getChangesets(baseDir, 0); assertThat(file1Scm).isNotNull(); } @@ -248,7 +248,7 @@ public class ScmMediumTest { .build()) .start(); - Scm file1Scm = getScm(baseDir, 0); + BatchReport.Changesets file1Scm = getChangesets(baseDir, 0); assertThat(file1Scm).isNotNull(); }