]> source.dussan.org Git - sonarqube.git/commitdiff
Make test more robust on Java 8 (use LinkedHashSet instead of HashSet)
authorJulien HENRY <julien.henry@sonarsource.com>
Wed, 20 Jan 2016 13:19:50 +0000 (14:19 +0100)
committerJulien HENRY <julien.henry@sonarsource.com>
Wed, 20 Jan 2016 13:20:34 +0000 (14:20 +0100)
sonar-batch/src/main/java/org/sonar/batch/scan/report/JSONReport.java

index 7e987c9ecd6462d8c075a84954b0f97d0dec6166..3ad574574d9d7bc57d164863a7a05fcf712f61dc 100644 (file)
  */
 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);