aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-03-05 11:08:17 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-03-05 11:10:00 +0100
commit33e7b484acb9b0cda2e638dd5356b5e33c0ec1b4 (patch)
treeb0e198c98a182363d66a09c9a73ef4a22ea1d882 /sonar-batch/src
parent29f7b15feea86c67c8e75fb89c8fa0dd4b807ba8 (diff)
downloadsonarqube-33e7b484acb9b0cda2e638dd5356b5e33c0ec1b4.tar.gz
sonarqube-33e7b484acb9b0cda2e638dd5356b5e33c0ec1b4.zip
Fix quality flaws
Diffstat (limited to 'sonar-batch/src')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/report/ComponentsPublisher.java6
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/report/IssuesPublisher.java8
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/report/PublishReportJob.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/report/ComponentsPublisherTest.java4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/report/IssuesPublisherTest.java6
6 files changed, 16 insertions, 16 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/report/ComponentsPublisher.java b/sonar-batch/src/main/java/org/sonar/batch/report/ComponentsPublisher.java
index 7850f6e2db4..d075a9a6300 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/report/ComponentsPublisher.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/report/ComponentsPublisher.java
@@ -26,7 +26,7 @@ import org.sonar.api.resources.ResourceUtils;
import org.sonar.batch.index.BatchResource;
import org.sonar.batch.index.ResourceCache;
import org.sonar.batch.protocol.Constants;
-import org.sonar.batch.protocol.output.BatchOutputWriter;
+import org.sonar.batch.protocol.output.BatchReportWriter;
import org.sonar.batch.protocol.output.BatchReport;
import javax.annotation.CheckForNull;
@@ -45,12 +45,12 @@ public class ComponentsPublisher implements ReportPublisher {
}
@Override
- public void publish(BatchOutputWriter writer) {
+ public void publish(BatchReportWriter writer) {
BatchResource rootProject = resourceCache.get(reactor.getRoot().getKeyWithBranch());
recursiveWriteComponent(rootProject, writer);
}
- private void recursiveWriteComponent(BatchResource batchResource, BatchOutputWriter writer) {
+ private void recursiveWriteComponent(BatchResource batchResource, BatchReportWriter writer) {
Resource r = batchResource.resource();
BatchReport.Component.Builder builder = BatchReport.Component.newBuilder();
diff --git a/sonar-batch/src/main/java/org/sonar/batch/report/IssuesPublisher.java b/sonar-batch/src/main/java/org/sonar/batch/report/IssuesPublisher.java
index fd7bd13b814..0cefc7d25db 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/report/IssuesPublisher.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/report/IssuesPublisher.java
@@ -30,7 +30,7 @@ import org.sonar.batch.index.BatchResource;
import org.sonar.batch.index.ResourceCache;
import org.sonar.batch.issue.IssueCache;
import org.sonar.batch.protocol.Constants;
-import org.sonar.batch.protocol.output.BatchOutputWriter;
+import org.sonar.batch.protocol.output.BatchReportWriter;
import org.sonar.batch.protocol.output.BatchReport;
import javax.annotation.Nullable;
@@ -52,7 +52,7 @@ public class IssuesPublisher implements ReportPublisher {
}
@Override
- public void publish(BatchOutputWriter writer) {
+ public void publish(BatchReportWriter writer) {
Collection<Object> deletedComponentKeys = issueCache.componentKeys();
for (BatchResource resource : resourceCache.all()) {
String componentKey = resource.resource().getEffectiveKey();
@@ -71,7 +71,7 @@ public class IssuesPublisher implements ReportPublisher {
exportMetadata(writer, count);
}
- private void exportMetadata(BatchOutputWriter writer, int count) {
+ private void exportMetadata(BatchReportWriter writer, int count) {
BatchResource rootProject = resourceCache.get(reactor.getRoot().getKeyWithBranch());
BatchReport.Metadata.Builder builder = BatchReport.Metadata.newBuilder()
.setAnalysisDate(((Project) rootProject.resource()).getAnalysisDate().getTime())
@@ -85,7 +85,7 @@ public class IssuesPublisher implements ReportPublisher {
writer.writeMetadata(builder.build());
}
- private int exportIssuesOfDeletedComponents(Collection<Object> deletedComponentKeys, BatchOutputWriter writer) {
+ private int exportIssuesOfDeletedComponents(Collection<Object> deletedComponentKeys, BatchReportWriter writer) {
int deletedComponentCount = 0;
for (Object componentKey : deletedComponentKeys) {
deletedComponentCount++;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/report/PublishReportJob.java b/sonar-batch/src/main/java/org/sonar/batch/report/PublishReportJob.java
index 76713e6a747..3a70259bede 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/report/PublishReportJob.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/report/PublishReportJob.java
@@ -33,7 +33,7 @@ import org.sonar.api.utils.TempFolder;
import org.sonar.api.utils.ZipUtils;
import org.sonar.batch.bootstrap.DefaultAnalysisMode;
import org.sonar.batch.bootstrap.ServerClient;
-import org.sonar.batch.protocol.output.BatchOutputWriter;
+import org.sonar.batch.protocol.output.BatchReportWriter;
import java.io.File;
import java.io.IOException;
@@ -84,7 +84,7 @@ public class PublishReportJob implements BatchComponent {
try {
long startTime = System.currentTimeMillis();
File reportDir = temp.newDir("batch-report");
- BatchOutputWriter writer = new BatchOutputWriter(reportDir);
+ BatchReportWriter writer = new BatchReportWriter(reportDir);
for (ReportPublisher publisher : publishers) {
publisher.publish(writer);
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java b/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java
index 6fe18f50889..07aa03fccbe 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java
@@ -19,13 +19,13 @@
*/
package org.sonar.batch.report;
-import org.sonar.batch.protocol.output.BatchOutputWriter;
+import org.sonar.batch.protocol.output.BatchReportWriter;
/**
* Adds a sub-part of data to output report
*/
public interface ReportPublisher {
- void publish(BatchOutputWriter writer);
+ void publish(BatchReportWriter writer);
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/report/ComponentsPublisherTest.java b/sonar-batch/src/test/java/org/sonar/batch/report/ComponentsPublisherTest.java
index 30f56d3a46e..5bcc75aa6db 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/report/ComponentsPublisherTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/report/ComponentsPublisherTest.java
@@ -30,7 +30,7 @@ import org.sonar.api.resources.Java;
import org.sonar.api.resources.Project;
import org.sonar.api.utils.DateUtils;
import org.sonar.batch.index.ResourceCache;
-import org.sonar.batch.protocol.output.BatchOutputWriter;
+import org.sonar.batch.protocol.output.BatchReportWriter;
import org.sonar.batch.protocol.output.FileStructure;
import static org.assertj.core.api.Assertions.assertThat;
@@ -77,7 +77,7 @@ public class ComponentsPublisherTest {
testFile.setId(6).setUuid("TEST_FILE_UUID");
resourceCache.add(testFile, dir).setSnapshot(new Snapshot().setId(16));
- BatchOutputWriter writer = new BatchOutputWriter(temp.newFolder());
+ BatchReportWriter writer = new BatchReportWriter(temp.newFolder());
publisher.publish(writer);
assertThat(writer.hasComponentData(FileStructure.Domain.COMPONENT, 1)).isTrue();
diff --git a/sonar-batch/src/test/java/org/sonar/batch/report/IssuesPublisherTest.java b/sonar-batch/src/test/java/org/sonar/batch/report/IssuesPublisherTest.java
index 2674e1ddc78..9a020765298 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/report/IssuesPublisherTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/report/IssuesPublisherTest.java
@@ -33,7 +33,7 @@ import org.sonar.api.rule.RuleKey;
import org.sonar.api.utils.Duration;
import org.sonar.batch.index.ResourceCache;
import org.sonar.batch.issue.IssueCache;
-import org.sonar.batch.protocol.output.BatchOutputWriter;
+import org.sonar.batch.protocol.output.BatchReportWriter;
import org.sonar.batch.protocol.output.BatchReport.Metadata;
import org.sonar.batch.protocol.output.BatchReportReader;
@@ -98,7 +98,7 @@ public class IssuesPublisherTest {
when(issueCache.byComponent("foo:src/Foo.php")).thenReturn(Arrays.asList(issue1, issue2));
File outputDir = temp.newFolder();
- BatchOutputWriter writer = new BatchOutputWriter(outputDir);
+ BatchReportWriter writer = new BatchReportWriter(outputDir);
publisher.publish(writer);
@@ -149,7 +149,7 @@ public class IssuesPublisherTest {
when(issueCache.componentKeys()).thenReturn(Arrays.<Object>asList("foo:deleted.php"));
File outputDir = temp.newFolder();
- BatchOutputWriter writer = new BatchOutputWriter(outputDir);
+ BatchReportWriter writer = new BatchReportWriter(outputDir);
publisher.publish(writer);