aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2015-02-10 21:53:21 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2015-02-10 21:54:25 +0100
commitf3523f5679f80f40835712160b8ddfa688bace8e (patch)
tree0c2f0084ce38a6f0368b9b4c0de7b806e1aad7f4
parent148fc31b4ca59239d7d2f69a16990f45757501cf (diff)
downloadsonarqube-f3523f5679f80f40835712160b8ddfa688bace8e.tar.gz
sonarqube-f3523f5679f80f40835712160b8ddfa688bace8e.zip
SONAR-6048 Use LinkedHashMap to make behavior more consistent
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/InputPathCache.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/InputPathCache.java b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/InputPathCache.java
index 6270eda9cf2..41eda45c49a 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/InputPathCache.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/InputPathCache.java
@@ -31,7 +31,7 @@ import javax.annotation.CheckForNull;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.Map;
/**
@@ -40,9 +40,9 @@ import java.util.Map;
*/
public class InputPathCache implements BatchComponent {
- private final Map<String, Map<String, InputFile>> inputFileCache = new HashMap<>();
- private final Map<String, Map<String, InputDir>> inputDirCache = new HashMap<>();
- private final Map<String, Map<String, InputFileMetadata>> inputFileMetadataCache = new HashMap<>();
+ private final Map<String, Map<String, InputFile>> inputFileCache = new LinkedHashMap<>();
+ private final Map<String, Map<String, InputDir>> inputDirCache = new LinkedHashMap<>();
+ private final Map<String, Map<String, InputFileMetadata>> inputFileMetadataCache = new LinkedHashMap<>();
public Iterable<InputFile> allFiles() {
return Iterables.concat(Iterables.transform(inputFileCache.values(), new Function<Map<String, InputFile>, Collection<InputFile>>() {
@@ -102,7 +102,7 @@ public class InputPathCache implements BatchComponent {
public InputPathCache put(String moduleKey, InputFile inputFile) {
if (!inputFileCache.containsKey(moduleKey)) {
- inputFileCache.put(moduleKey, new HashMap<String, InputFile>());
+ inputFileCache.put(moduleKey, new LinkedHashMap<String, InputFile>());
}
inputFileCache.get(moduleKey).put(inputFile.relativePath(), inputFile);
return this;
@@ -110,7 +110,7 @@ public class InputPathCache implements BatchComponent {
public synchronized InputPathCache put(String moduleKey, String relativePath, InputFileMetadata metadata) {
if (!inputFileMetadataCache.containsKey(moduleKey)) {
- inputFileMetadataCache.put(moduleKey, new HashMap<String, InputFileMetadata>());
+ inputFileMetadataCache.put(moduleKey, new LinkedHashMap<String, InputFileMetadata>());
}
inputFileMetadataCache.get(moduleKey).put(relativePath, metadata);
return this;
@@ -118,7 +118,7 @@ public class InputPathCache implements BatchComponent {
public InputPathCache put(String moduleKey, InputDir inputDir) {
if (!inputDirCache.containsKey(moduleKey)) {
- inputDirCache.put(moduleKey, new HashMap<String, InputDir>());
+ inputDirCache.put(moduleKey, new LinkedHashMap<String, InputDir>());
}
inputDirCache.get(moduleKey).put(inputDir.relativePath(), inputDir);
return this;