aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch-protocol
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2015-01-05 10:35:47 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2015-01-05 10:42:52 +0100
commite87e06f2789cc3c42c30de31f62084552f6295d3 (patch)
tree2b7d343c3f21f18571ebe7d07dec26d992fbadf0 /sonar-batch-protocol
parent84f8f13db2dc88cc233f9e593ffc9b7b0cf7e74b (diff)
downloadsonarqube-e87e06f2789cc3c42c30de31f62084552f6295d3.tar.gz
sonarqube-e87e06f2789cc3c42c30de31f62084552f6295d3.zip
Fix some quality flaws
Diffstat (limited to 'sonar-batch-protocol')
-rw-r--r--sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/resource/ReportComponent.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/resource/ReportComponent.java b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/resource/ReportComponent.java
index 578cf92d73d..e9ff00c57ac 100644
--- a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/resource/ReportComponent.java
+++ b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/output/resource/ReportComponent.java
@@ -20,6 +20,7 @@
package org.sonar.batch.protocol.output.resource;
import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collection;
@@ -83,11 +84,15 @@ public class ReportComponent {
return path;
}
- public ReportComponent setName(String name) {
+ public ReportComponent setName(@Nullable String name) {
this.name = name;
return this;
}
+ /**
+ * @return null for files and directories since it is the same as the path
+ */
+ @CheckForNull
public String name() {
return name;
}
@@ -101,7 +106,7 @@ public class ReportComponent {
return type;
}
- public ReportComponent setTest(Boolean isTest) {
+ public ReportComponent setTest(@Nullable Boolean isTest) {
this.isTest = isTest;
return this;
}
@@ -114,11 +119,15 @@ public class ReportComponent {
return isTest;
}
- public ReportComponent setLanguageKey(String languageKey) {
+ public ReportComponent setLanguageKey(@Nullable String languageKey) {
this.languageKey = languageKey;
return this;
}
+ /**
+ * @return null when not a file
+ */
+ @CheckForNull
public String languageKey() {
return languageKey;
}