aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2016-01-20 14:19:50 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2016-01-20 14:20:34 +0100
commit58c103e50993dc3bc06b1190da827f32826aa623 (patch)
treebe3296eef98b0d411afadb003f1dbb5ec851e720 /sonar-batch
parentf5c86a266910bba684ba5d8e6577aa76b22c8d8a (diff)
downloadsonarqube-58c103e50993dc3bc06b1190da827f32826aa623.tar.gz
sonarqube-58c103e50993dc3bc06b1190da827f32826aa623.zip
Make test more robust on Java 8 (use LinkedHashSet instead of HashSet)
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/report/JSONReport.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/report/JSONReport.java b/sonar-batch/src/main/java/org/sonar/batch/scan/report/JSONReport.java
index 7e987c9ecd6..3ad574574d9 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/report/JSONReport.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/report/JSONReport.java
@@ -19,11 +19,7 @@
*/
package org.sonar.batch.scan.report;
-import org.sonar.batch.issue.tracking.TrackedIssue;
-
-import org.sonar.batch.protocol.input.BatchInput.User;
import com.google.common.annotations.VisibleForTesting;
-
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
@@ -32,10 +28,10 @@ import java.io.OutputStreamWriter;
import java.io.Writer;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
+import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
-
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -55,10 +51,11 @@ import org.sonar.api.resources.Project;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.utils.text.JsonWriter;
import org.sonar.batch.issue.IssueCache;
+import org.sonar.batch.issue.tracking.TrackedIssue;
import org.sonar.batch.protocol.input.BatchInput;
+import org.sonar.batch.protocol.input.BatchInput.User;
import org.sonar.batch.repository.user.UserRepositoryLoader;
import org.sonar.batch.scan.filesystem.InputPathCache;
-import static com.google.common.collect.Sets.newHashSet;
@Properties({
@Property(
@@ -118,8 +115,8 @@ public class JSONReport implements Reporter {
json.beginObject();
json.prop("version", server.getVersion());
- Set<RuleKey> ruleKeys = newHashSet();
- Set<String> userLogins = newHashSet();
+ Set<RuleKey> ruleKeys = new LinkedHashSet<>();
+ Set<String> userLogins = new LinkedHashSet<>();
writeJsonIssues(json, ruleKeys, userLogins);
writeJsonComponents(json);
writeJsonRules(json, ruleKeys);