Author: scabanovich
Date: 2012-08-30 17:59:50 -0400 (Thu, 30 Aug 2012)
New Revision: 43333
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProjectAsYouType.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java
Log:
JBIDE-12417
https://issues.jboss.org/browse/JBIDE-12417
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2012-08-30
18:36:49 UTC (rev 43332)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2012-08-30
21:59:50 UTC (rev 43333)
@@ -97,7 +97,7 @@
private Set<IBean> allBeans = new HashSet<IBean>();
private Set<IBean> declaredBeans = new HashSet<IBean>();
- private Map<IPath, Set<IBean>> beansByPath = new HashMap<IPath,
Set<IBean>>();
+ private Map<IPath, List<IBean>> beansByPath = new HashMap<IPath,
List<IBean>>();
private Map<String, Set<IBean>> beansByName = new HashMap<String,
Set<IBean>>();
private List<Set<IBean>> beansByTypes = new
ArrayList<Set<IBean>>();
private Set<IBean> namedBeans = new HashSet<IBean>();
@@ -265,7 +265,7 @@
public IClassBean getBeanClass(IType type) {
IPath path = type.getPath();
synchronized (this) {
- Set<IBean> bs = beansByPath.get(path);
+ List<IBean> bs = beansByPath.get(path);
if(bs != null) {
for (IBean b: bs) {
if(b instanceof IClassBean) {
@@ -1442,9 +1442,9 @@
synchronized(this) {
String name = bean.getName();
IPath path = bean.getSourcePath();
- Set<IBean> bs = beansByPath.get(path);
+ List<IBean> bs = beansByPath.get(path);
if(bs == null) {
- bs = new HashSet<IBean>();
+ bs = new ArrayList<IBean>();
beansByPath.put(path, bs);
}
bs.add(bean);
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProjectAsYouType.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProjectAsYouType.java 2012-08-30
18:36:49 UTC (rev 43332)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProjectAsYouType.java 2012-08-30
21:59:50 UTC (rev 43333)
@@ -76,7 +76,7 @@
ICDIProject project;
IFile file;
- Collection<IBean> beans = new HashSet<IBean>();
+ Collection<IBean> beans = new ArrayList<IBean>();
StereotypeElement stereotype;
QualifierElement qualifier;
ScopeElement scope;
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2012-08-30
18:36:49 UTC (rev 43332)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2012-08-30
21:59:50 UTC (rev 43333)
@@ -16,6 +16,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.TreeMap;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IJavaProject;
@@ -38,7 +39,7 @@
private Set<String> types = new HashSet<String>();
private Map<IPath, Set<IPath>> childPaths = new HashMap<IPath,
Set<IPath>>();
private Map<IPath, Set<String>> resources = new HashMap<IPath,
Set<String>>();
- private Map<String, TypeDefinition> typeDefinitions = new HashMap<String,
TypeDefinition>();
+ private Map<String, TypeDefinition> typeDefinitions = new TreeMap<String,
TypeDefinition>();
private Map<String, AnnotationDefinition> annotations = new HashMap<String,
AnnotationDefinition>();
private Map<String, AnnotationDefinition> usedAnnotations = new HashMap<String,
AnnotationDefinition>();
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java 2012-08-30
18:36:49 UTC (rev 43332)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java 2012-08-30
21:59:50 UTC (rev 43333)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.scanner;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -50,19 +51,17 @@
public void build(FileSet fileSet, DefinitionContext context) {
Set<IPath> ps = fileSet.getAllPaths();
for (IPath p: ps) context.clean(p);
- Map<IPath, Set<IType>> as = fileSet.getAnnotations();
+ Map<IPath, List<IType>> as = fileSet.getAnnotations();
for (IPath f: as.keySet()) {
- Set<IType> ts = as.get(f);
- for (IType type: ts) {
+ for (IType type: as.get(f)) {
//this builds annotation definition
context.getAnnotationKind(type);
}
}
- Map<IPath, Set<IType>> is = fileSet.getInterfaces();
+ Map<IPath, List<IType>> is = fileSet.getInterfaces();
for (IPath f: is.keySet()) {
- Set<IType> ts = is.get(f);
- for (IType type: ts) {
+ for (IType type: is.get(f)) {
// Jars present package-info as binary interface
// whereas sources present it as compilation unit with package declaration.
if(type.getElementName().equals("package-info")) {
@@ -73,10 +72,9 @@
}
}
- Map<IPath, Set<IType>> cs = fileSet.getClasses();
+ Map<IPath, List<IType>> cs = fileSet.getClasses();
for (IPath f: cs.keySet()) {
- Set<IType> ts = cs.get(f);
- for (IType type: ts) {
+ for (IType type: cs.get(f)) {
TypeDefinition def = new TypeDefinition();
def.setType(type, context, 0);
context.addType(f, type.getFullyQualifiedName(), def);
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java 2012-08-30
18:36:49 UTC (rev 43332)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java 2012-08-30
21:59:50 UTC (rev 43333)
@@ -10,8 +10,10 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.scanner;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -26,9 +28,9 @@
public class FileSet {
private Set<IPath> allpaths = new HashSet<IPath>();
private Set<IPath> nonmodel = new HashSet<IPath>();
- private Map<IPath, Set<IType>> annotations = new HashMap<IPath,
Set<IType>>();
- private Map<IPath, Set<IType>> interfaces = new HashMap<IPath,
Set<IType>>();
- private Map<IPath, Set<IType>> classes = new HashMap<IPath,
Set<IType>>();
+ private Map<IPath, List<IType>> annotations = new HashMap<IPath,
List<IType>>();
+ private Map<IPath, List<IType>> interfaces = new HashMap<IPath,
List<IType>>();
+ private Map<IPath, List<IType>> classes = new HashMap<IPath,
List<IType>>();
private Map<IPath, IPackageDeclaration> packages = new HashMap<IPath,
IPackageDeclaration>();
private Map<IPath, XModelObject> beanXMLs = new HashMap<IPath,
XModelObject>();
@@ -92,10 +94,10 @@
return true;
}
- private void add(Map<IPath, Set<IType>> target, IPath path, IType type) {
- Set<IType> ts = target.get(path);
+ private void add(Map<IPath, List<IType>> target, IPath path, IType type) {
+ List<IType> ts = target.get(path);
if(ts == null) {
- ts = new HashSet<IType>();
+ ts = new ArrayList<IType>();
target.put(path, ts);
}
ts.add(type);
@@ -114,15 +116,15 @@
return nonmodel;
}
- public Map<IPath, Set<IType>> getAnnotations() {
+ public Map<IPath, List<IType>> getAnnotations() {
return annotations;
}
- public Map<IPath, Set<IType>> getInterfaces() {
+ public Map<IPath, List<IType>> getInterfaces() {
return interfaces;
}
- public Map<IPath, Set<IType>> getClasses() {
+ public Map<IPath, List<IType>> getClasses() {
return classes;
}