[jbosstools-commits] JBoss Tools SVN: r43625 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Sep 12 15:46:56 EDT 2012


Author: dazarov
Date: 2012-09-12 15:46:56 -0400 (Wed, 12 Sep 2012)
New Revision: 43625

Modified:
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
Log:
CDI hyper links should work on modified files correctly https://issues.jboss.org/browse/JBIDE-12404

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java	2012-09-12 13:02:08 UTC (rev 43624)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java	2012-09-12 19:46:56 UTC (rev 43625)
@@ -22,6 +22,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.TreeMap;
 
 import org.apache.tools.ant.util.FileUtils;
 import org.eclipse.core.resources.IContainer;
@@ -246,32 +247,32 @@
 	 * @param beans
 	 */
 	public static List<IBean> sortBeans(Collection<IBean> beans) {
-		Set<IBean> alternativeBeans = new HashSet<IBean>();
-		Set<IBean> selectedAlternativeBeans = new HashSet<IBean>();
-		Set<IBean> nonAlternativeBeans = new HashSet<IBean>();
-		Set<IBean> decorators = new HashSet<IBean>();
-		Set<IBean> interceptors = new HashSet<IBean>();
+		TreeMap<String, IBean> alternativeBeans = new TreeMap<String, IBean>();
+		TreeMap<String, IBean> selectedAlternativeBeans = new TreeMap<String, IBean>();
+		TreeMap<String, IBean> nonAlternativeBeans = new TreeMap<String, IBean>();
+		TreeMap<String, IBean> decorators = new TreeMap<String, IBean>();
+		TreeMap<String, IBean> interceptors = new TreeMap<String, IBean>();
 
 		for (IBean bean : beans) {
 			if (bean.isSelectedAlternative()) {
-				selectedAlternativeBeans.add(bean);
+				selectedAlternativeBeans.put(bean.getElementName(), bean);
 			} else if (bean.isAlternative()) {
-				alternativeBeans.add(bean);
+				alternativeBeans.put(bean.getElementName(), bean);
 			} else if (bean instanceof IDecorator) {
-				decorators.add(bean);
+				decorators.put(bean.getElementName(), bean);
 			} else if (bean instanceof IInterceptor) {
-				interceptors.add(bean);
+				interceptors.put(bean.getElementName(), bean);
 			} else {
-				nonAlternativeBeans.add(bean);
+				nonAlternativeBeans.put(bean.getElementName(), bean);
 			}
 		}
 
 		ArrayList<IBean> sortedBeans = new ArrayList<IBean>();
-		sortedBeans.addAll(selectedAlternativeBeans);
-		sortedBeans.addAll(nonAlternativeBeans);
-		sortedBeans.addAll(alternativeBeans);
-		sortedBeans.addAll(decorators);
-		sortedBeans.addAll(interceptors);
+		sortedBeans.addAll(selectedAlternativeBeans.values());
+		sortedBeans.addAll(nonAlternativeBeans.values());
+		sortedBeans.addAll(alternativeBeans.values());
+		sortedBeans.addAll(decorators.values());
+		sortedBeans.addAll(interceptors.values());
 		return sortedBeans;
 	}
 



More information about the jbosstools-commits mailing list