java.util.HashMapjava.util.LinkedHashMap



Project Activiti/Activiti in file ...org.activiti.bpmn.model.FlowElementsContainer.java (2012-11-02)
@@ -13,7 +13,7 @@
 package org.activiti.bpmn.model;
 
 import java.util.Collection;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
 
 /**
@@ -21,7 +21,7 @@ import java.util.Map;
  */
 public class FlowElementsContainer extends BaseElement {
 
-  protected Map<String, FlowElement> flowElementMap = new HashMap<String, FlowElement>();
+  protected Map<String, FlowElement> flowElementMap = new LinkedHashMap<String, FlowElement>(); // Linked hashmap to preserve order of inserted elements
 
   public FlowElement getFlowElement(String id) {
     return flowElementMap.get(id);
Project Atmosphere/atmosphere in file ...cpr.src.main.java.org.atmosphere.util.IOUtils.java (2014-05-08)
@@ -36,7 +36,7 @@ import java.io.UnsupportedEncodingException;
 import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.regex.Matcher;
@@ -305,7 +305,7 @@ public class IOUtils {
      * @return the map associating class to action
      */
     public static Map<String, AtmosphereFramework.MetaServiceAction> readServiceFile(final String path) {
-        final Map<String, AtmosphereFramework.MetaServiceAction> b = new HashMap<String, AtmosphereFramework.MetaServiceAction>();
+        final Map<String, AtmosphereFramework.MetaServiceAction> b = new LinkedHashMap<String, AtmosphereFramework.MetaServiceAction>();
 
         String line;
         InputStream is = null;
Project Jasig/cas in file ...java.org.jasig.cas.monitor.HealthCheckMonitor.java (2012-07-17)
@@ -18,11 +18,11 @@
  */
 package org.jasig.cas.monitor;
 
-import javax.validation.constraints.NotNull;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
+import javax.validation.constraints.NotNull;
 
 /**
  * Simple health check monitor that reports the overall health as the greatest reported
@@ -55,7 +55,7 @@ public class HealthCheckMonitor implements Monitor<HealthStatus> {
 
     /** {@inheritDoc} */
     public HealthStatus observe() {
-        final Map<String, Status> results = new HashMap<String, Status>(monitors.size());
+        final Map<String, Status> results = new LinkedHashMap<String, Status>(monitors.size());
         StatusCode code = StatusCode.UNKNOWN;
         Status result;
         for (Monitor monitor : monitors) {
Project JetBrains/intellij-community in file ...ns.idea.maven.navigator.MavenProjectNavigator.java (2008-04-15)
@@ -34,7 +34,7 @@ import javax.swing.tree.TreeSelectionModel;
 import java.awt.*;
 import java.awt.event.InputEvent;
 import java.util.Collection;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
 
 @State(name = "MavenProjectNavigator", storages = {@Storage(id = "default", file = "$WORKSPACE_FILE$")})
@@ -54,7 +54,7 @@ public class MavenProjectNavigator extends PomTreeStructure implements ProjectCo
   private final SimpleTreeBuilder treeBuilder;
   final SimpleTree tree;
 
-  private Map<VirtualFile, PomNode> fileToNode = new HashMap<VirtualFile, PomNode>();
+  private Map<VirtualFile, PomNode> fileToNode = new LinkedHashMap<VirtualFile, PomNode>();
 
   public MavenProjectNavigator(final Project project, MavenProjectsManager projectsManager, MavenRepository repository, MavenEventsHandler eventsHandler) {
     super(project, projectsManager, repository, eventsHandler);
Project OpenRefine/OpenRefine in file ...com.google.refine.importers.RdfTripleImporter.java (2015-01-30)
@@ -39,7 +39,7 @@ import static org.jrdf.graph.AnySubjectNode.ANY_SUBJECT_NODE;
 
 import java.io.InputStream;
 import java.util.ArrayList;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -107,7 +107,7 @@ public class RdfTripleImporter extends ImportingParserBase {
         
         ClosableIterable<Triple> triples = graph.find(ANY_SUBJECT_NODE, ANY_PREDICATE_NODE, ANY_OBJECT_NODE);
         try {
-            Map<String, List<Row>> subjectToRows = new HashMap<String, List<Row>>();
+            Map<String, List<Row>> subjectToRows = new LinkedHashMap<String, List<Row>>();
             Column subjectColumn = new Column(project.columnModel.allocateNewCellIndex(), "subject");
             project.columnModel.addColumn(0, subjectColumn, false);
             project.columnModel.setKeyColumnIndex(0);