[jbosstools-commits] JBoss Tools SVN: r43103 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: core/extension/feature and 3 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Aug 17 19:13:26 EDT 2012


Author: scabanovich
Date: 2012-08-17 19:13:26 -0400 (Fri, 17 Aug 2012)
New Revision: 43103

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/IBean.java
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IScoped.java
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IAmbiguousBeanResolverFeature.java
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeansXMLData.java
   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/ClassBean.java
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/EventBean.java
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointParameter.java
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeansXMLDefinition.java
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIMarkerResolutionUtils.java
Log:
JBIDE-12417
https://issues.jboss.org/browse/JBIDE-12417
Replaced Set by Collection in interfaces.

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-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -721,9 +721,9 @@
 	 * @param bean
 	 * @return
 	 */
-	public static Set<IInjectionPointParameter> getInjectionPointParameters(IClassBean bean) {
+	public static Collection<IInjectionPointParameter> getInjectionPointParameters(IClassBean bean) {
 		Collection<IInjectionPoint> points = bean.getInjectionPoints();
-		Set<IInjectionPointParameter> params = new HashSet<IInjectionPointParameter>();
+		Collection<IInjectionPointParameter> params = new ArrayList<IInjectionPointParameter>();
 		for (IInjectionPoint injection : points) {
 			if(injection instanceof IInjectionPointParameter) {
 				params.add((IInjectionPointParameter)injection);

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java	2012-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -11,7 +11,6 @@
 package org.jboss.tools.cdi.core;
 
 import java.util.Collection;
-import java.util.Set;
 
 import org.eclipse.jdt.core.IType;
 import org.jboss.tools.common.el.core.resolver.IVariable;

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IScoped.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IScoped.java	2012-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IScoped.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -11,7 +11,6 @@
 package org.jboss.tools.cdi.core;
 
 import java.util.Collection;
-import java.util.Set;
 
 /**
  * This interface if common protocol to have access to scoped of bean class or

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IAmbiguousBeanResolverFeature.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IAmbiguousBeanResolverFeature.java	2012-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IAmbiguousBeanResolverFeature.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -10,7 +10,7 @@
  ******************************************************************************/
 package org.jboss.tools.cdi.core.extension.feature;
 
-import java.util.Set;
+import java.util.Collection;
 
 import org.jboss.tools.cdi.core.IBean;
 
@@ -28,6 +28,6 @@
 	 * @param result
 	 * @return
 	 */
-	public Set<IBean> getResolvedBeans(Set<IBean> result);
+	public Collection<IBean> getResolvedBeans(Collection<IBean> result);
 
 }

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java	2012-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -271,12 +271,12 @@
 		return result;
 	}
 
-	public Set<IScopeDeclaration> getScopeDeclarations() {
+	public Collection<IScopeDeclaration> getScopeDeclarations() {
 		return getScopeDeclarations(getCDIProject().getNature(), definition.getAnnotations());
 	}
 
-	public static Set<IScopeDeclaration> getScopeDeclarations(CDICoreNature n, List<? extends IAnnotationDeclaration> ds) {
-		Set<IScopeDeclaration> result = new HashSet<IScopeDeclaration>();
+	public static Collection<IScopeDeclaration> getScopeDeclarations(CDICoreNature n, List<? extends IAnnotationDeclaration> ds) {
+		Collection<IScopeDeclaration> result = new ArrayList<IScopeDeclaration>(1);
 		for (IAnnotationDeclaration d: ds) {
 			int k = n.getDefinitions().getAnnotationKind(d.getType());
 			if(k > 0 && (k & AnnotationDefinition.SCOPE) > 0 && d instanceof IScopeDeclaration) {

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeansXMLData.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeansXMLData.java	2012-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeansXMLData.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -10,6 +10,8 @@
  ******************************************************************************/
 package org.jboss.tools.cdi.internal.core.impl;
 
+import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -17,10 +19,10 @@
 
 public class BeansXMLData {
 
-	private Set<INodeReference> interceptors = new HashSet<INodeReference>();
-	private Set<INodeReference> decorators = new HashSet<INodeReference>();
-	private Set<INodeReference> stereotypeAlternatives = new HashSet<INodeReference>();
-	private Set<INodeReference> typeAlternatives = new HashSet<INodeReference>();
+	private Collection<INodeReference> interceptors = new ArrayList<INodeReference>();
+	private Collection<INodeReference> decorators = new ArrayList<INodeReference>();
+	private Collection<INodeReference> stereotypeAlternatives = new ArrayList<INodeReference>();
+	private Collection<INodeReference> typeAlternatives = new ArrayList<INodeReference>();
 
 	private Set<String> interceptorTypes = new HashSet<String>();
 	private Set<String> decoratorTypes = new HashSet<String>();
@@ -42,62 +44,64 @@
 		}
 	}
 
-	public Set<INodeReference> getInterceptors() {
+	public Collection<INodeReference> getInterceptors() {
 		return interceptors;
 	}
 
-	public Set<INodeReference> getDecorators() {
+	public Collection<INodeReference> getDecorators() {
 		return decorators;
 	}
 
-	public Set<INodeReference> getStereotypeAlternatives() {
+	public Collection<INodeReference> getStereotypeAlternatives() {
 		return stereotypeAlternatives;
 	}
 
-	public Set<INodeReference> getTypeAlternatives() {
+	public Collection<INodeReference> getTypeAlternatives() {
 		return typeAlternatives;
 	}
 
-	public Set<String> getInterceptorTypes() {
+	public Collection<String> getInterceptorTypes() {
 		return interceptorTypes;
 	}
 
-	public Set<String> getDecoratorTypes() {
+	public Collection<String> getDecoratorTypes() {
 		return decoratorTypes;
 	}
 
-	public Set<String> getStereotypeAlternativeTypes() {
+	public Collection<String> getStereotypeAlternativeTypes() {
 		return stereotypeAlternativeTypes;
 	}
 
-	public Set<String> getTypeAlternativeTypes() {
+	public Collection<String> getTypeAlternativeTypes() {
 		return typeAlternativeTypes;
 	}
 
-	public void addInterceptor(INodeReference r) {
-		synchronized (this) {
-			interceptors.add(r);
-		}
+	public synchronized void addInterceptor(INodeReference r) {
+		interceptors.add(r);
 		if (r.getValue() != null) {
-			synchronized (this) {
-				interceptorTypes.add(r.getValue());
-			}
+			interceptorTypes.add(r.getValue());
 		}
 	}
 
 	public synchronized void addDecorator(INodeReference r) {
 		decorators.add(r);
-		decoratorTypes.add(r.getValue());
+		if (r.getValue() != null) {
+			decoratorTypes.add(r.getValue());
+		}
 	}
 
 	public synchronized void addStereotypeAlternative(INodeReference r) {
 		stereotypeAlternatives.add(r);
-		stereotypeAlternativeTypes.add(r.getValue());
+		if (r.getValue() != null) {
+			stereotypeAlternativeTypes.add(r.getValue());
+		}
 	}
 
 	public synchronized void addTypeAlternative(INodeReference r) {
 		typeAlternatives.add(r);
-		typeAlternativeTypes.add(r.getValue());
+		if (r.getValue() != null) {
+			typeAlternativeTypes.add(r.getValue());
+		}
 	}
 
 }

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-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -115,7 +115,7 @@
 
 	public CDIProject() {}
 
-	public CDIProject getModifiedCopy(IFile file, Set<IBean> beans) {
+	public CDIProject getModifiedCopy(IFile file, Collection<IBean> beans) {
 		CDIProject p = null;
 		try {
 			p = (CDIProject)clone();
@@ -128,7 +128,7 @@
 		synchronized(this) {
 			p.allBeans.addAll(allBeans);
 		}
-		Set<IBean> oldBeans = getBeans(file.getFullPath());
+		Collection<IBean> oldBeans = getBeans(file.getFullPath());
 		p.allBeans.removeAll(oldBeans);
 		p.allBeans.addAll(beans);
 		
@@ -239,8 +239,8 @@
 	public List<INodeReference> getAlternatives(String fullQualifiedTypeName) {
 		List<INodeReference> result = new ArrayList<INodeReference>();
 		synchronized (allBeansXMLData) {
-			Set<INodeReference> typeAlternatives = allBeansXMLData.getTypeAlternatives();
-			Set<INodeReference> stereotypeAlternatives = allBeansXMLData.getStereotypeAlternatives();
+			Collection<INodeReference> typeAlternatives = allBeansXMLData.getTypeAlternatives();
+			Collection<INodeReference> stereotypeAlternatives = allBeansXMLData.getStereotypeAlternatives();
 			for (INodeReference r: typeAlternatives) {
 				if(fullQualifiedTypeName.equals(r.getValue())) result.add(r);
 			}
@@ -269,7 +269,7 @@
 		return null;
 	}
 
-	public Set<IBean> getBeans(String name,	boolean attemptToResolveAmbiguousNames) {
+	public Collection<IBean> getBeans(String name,	boolean attemptToResolveAmbiguousNames) {
 		Set<IBean> result = new HashSet<IBean>();
 		synchronized (this) {
 			Set<IBean> beans = beansByName.get(name);
@@ -281,7 +281,7 @@
 		return getResolvedBeans(result, attemptToResolveAmbiguousNames);
 	}
 
-	public Set<IBean> getResolvedBeans(Set<IBean> result, boolean attemptToResolveAmbiguousness) {
+	public Collection<IBean> getResolvedBeans(Collection<IBean> result, boolean attemptToResolveAmbiguousness) {
 		if(result.size() > 1) {
 			Iterator<IBean> it = result.iterator();
 			while(it.hasNext()) {
@@ -358,7 +358,7 @@
 		return result;
 	}
 
-	public Set<IBean> getBeans(boolean attemptToResolveAmbiguousDependency,
+	public Collection<IBean> getBeans(boolean attemptToResolveAmbiguousDependency,
 			IParametedType beanType, IQualifierDeclaration... qualifiers) {
 		Set<IBean> result = new HashSet<IBean>();
 		IParametedType type = beanType;
@@ -717,11 +717,8 @@
 		return result.toString();
 	}
 
-	public synchronized Set<IBean> getBeans(IPath path) {
-		Set<IBean> result = new HashSet<IBean>();
-		Set<IBean> beans = beansByPath.get(path);
-		if(beans != null && !beans.isEmpty()) result.addAll(beans);
-		return result;
+	public synchronized Collection<IBean> getBeans(IPath path) {
+		return (beansByPath.containsKey(path)) ? new ArrayList<IBean>(beansByPath.get(path)) : new ArrayList<IBean>(0);
 	}
 	
 	static int q = 0;
@@ -750,8 +747,7 @@
 	public List<INodeReference> getDecoratorClasses(String fullQualifiedTypeName) {
 		List<INodeReference> result = new ArrayList<INodeReference>();
 		synchronized (allBeansXMLData) {
-			Set<INodeReference> decorators = allBeansXMLData.getDecorators();
-			for (INodeReference r: decorators) {
+			for (INodeReference r: allBeansXMLData.getDecorators()) {
 				if(fullQualifiedTypeName.equals(r.getValue())) result.add(r);
 			}
 		}
@@ -770,8 +766,7 @@
 			String fullQualifiedTypeName) {
 		List<INodeReference> result = new ArrayList<INodeReference>();
 		synchronized (allBeansXMLData) {
-			Set<INodeReference> interceptors = allBeansXMLData.getInterceptors();
-			for (INodeReference r: interceptors) {
+			for (INodeReference r: allBeansXMLData.getInterceptors()) {
 				if(fullQualifiedTypeName.equals(r.getValue())) result.add(r);
 			}
 		}
@@ -1507,15 +1502,15 @@
 	 * (non-Javadoc)
 	 * @see org.jboss.tools.cdi.core.IBeanManager#getNamedBeans(boolean)
 	 */
-	public Set<IBean> getNamedBeans(boolean attemptToResolveAmbiguousNames) {
+	public Collection<IBean> getNamedBeans(boolean attemptToResolveAmbiguousNames) {
 		//TODO use a cache for named beans with attemptToResolveAmbiguousNames==true
-		Set<IBean> result = new HashSet<IBean>();
+		Collection<IBean> result = new HashSet<IBean>();
 		synchronized (this) {
 			if(attemptToResolveAmbiguousNames) {
 				Set<String> names = new HashSet<String>();
 				for (IBean bean : namedBeans) {
 					if(!names.contains(bean.getName())) {
-						Set<IBean> beans = getBeans(bean.getName(), attemptToResolveAmbiguousNames);
+						Collection<IBean> beans = getBeans(bean.getName(), attemptToResolveAmbiguousNames);
 						if(beans.isEmpty()) {
 							result.add(bean);
 						} else {
@@ -1535,11 +1530,11 @@
 	 * (non-Javadoc)
 	 * @see org.jboss.tools.cdi.core.IBeanManager#getBeans(boolean, org.eclipse.jdt.core.IType, org.eclipse.jdt.core.IType[])
 	 */
-	public Set<IBean> getBeans(boolean attemptToResolveAmbiguousDependency,
+	public Collection<IBean> getBeans(boolean attemptToResolveAmbiguousDependency,
 			IParametedType beanType, IType... qualifiers) {
-		Set<IBean> result = new HashSet<IBean>();
+		Collection<IBean> result = new HashSet<IBean>();
 		IParametedType type = beanType;
-		Set<IBean> beans = new HashSet<IBean>();
+		Collection<IBean> beans = new ArrayList<IBean>();
 		synchronized(this) {
 			beans.addAll(allBeans);
 		}
@@ -1563,7 +1558,7 @@
 	 * (non-Javadoc)
 	 * @see org.jboss.tools.cdi.core.IBeanManager#getBeans(boolean, java.lang.String, java.lang.String[])
 	 */
-	public Set<IBean> getBeans(boolean attemptToResolveAmbiguousDependency,
+	public Collection<IBean> getBeans(boolean attemptToResolveAmbiguousDependency,
 			String fullyQualifiedBeanType,
 			String... fullyQualifiedQualifiersTypes) {
 		IType type = getNature().getType(fullyQualifiedBeanType);

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-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProjectAsYouType.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -76,7 +76,7 @@
 	ICDIProject project;
 	IFile file;
 
-	Set<IBean> beans = new HashSet<IBean>();
+	Collection<IBean> beans = new HashSet<IBean>();
 	StereotypeElement stereotype;
 	QualifierElement qualifier;
 	ScopeElement scope;

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java	2012-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -164,17 +164,19 @@
 	}
 
 	public void setSuperClassBean(IClassBean bean) {
-		if(!(bean instanceof ClassBean)) return;
-		
-		HashSet<IClassBean> beans = new HashSet<IClassBean>();
-		beans.add(this);
-		IClassBean b = bean;
-		while(b != null) {
-			if(beans.contains(b)) {
-				bean = null;
-				break;
+		if(!(bean instanceof ClassBean) || bean == this) return;
+
+		if(bean.getSuperClassBean() != null) {
+			HashSet<IClassBean> beans = new HashSet<IClassBean>();
+			beans.add(this);
+			IClassBean b = bean;
+			while(b != null) {
+				if(beans.contains(b)) {
+					bean = null;
+					break;
+				}
+				b = b.getSuperClassBean();
 			}
-			b = b.getSuperClassBean();
 		}		
 		
 		superClassBean = (ClassBean)bean;
@@ -234,7 +236,7 @@
 	}
 
 	public static Collection<IInterceptorBindingDeclaration> getInterceptorBindingDeclarations(AbstractMemberDefinition definition) {
-		Set<IInterceptorBindingDeclaration> result = new HashSet<IInterceptorBindingDeclaration>();
+		Collection<IInterceptorBindingDeclaration> result = new ArrayList<IInterceptorBindingDeclaration>();
 		List<IAnnotationDeclaration> as = definition.getAnnotations();
 		for (IAnnotationDeclaration a: as) {
 			if(a instanceof InterceptorBindingDeclaration) {
@@ -461,7 +463,7 @@
 
 	protected void computeScope() {
 		//1. Declaration of scope in the class.
-		Set<IScopeDeclaration> scopes = getScopeDeclarations();
+		Collection<IScopeDeclaration> scopes = getScopeDeclarations();
 		if(!scopes.isEmpty()) {
 			scope = scopes.iterator().next().getScope();
 			return;

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/EventBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/EventBean.java	2012-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/EventBean.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -12,9 +12,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
 import org.eclipse.jdt.core.IType;
 import org.jboss.tools.cdi.core.CDIConstants;
@@ -56,16 +54,16 @@
 		return getCDIProject().getScope(CDIConstants.DEPENDENT_ANNOTATION_TYPE_NAME);
 	}
 
-	public Set<IScopeDeclaration> getScopeDeclarations() {
-		return new HashSet<IScopeDeclaration>();
+	public Collection<IScopeDeclaration> getScopeDeclarations() {
+		return new ArrayList<IScopeDeclaration>(0);
 	}
 
 	public Collection<IStereotypeDeclaration> getStereotypeDeclarations() {
-		return new HashSet<IStereotypeDeclaration>();
+		return new ArrayList<IStereotypeDeclaration>(0);
 	}
 
 	public List<IAnnotationDeclaration> getAnnotations() {
-		return new ArrayList<IAnnotationDeclaration>();
+		return new ArrayList<IAnnotationDeclaration>(0);
 	}
 
 	public IAnnotationDeclaration getAnnotation(String annotationTypeName) {
@@ -92,18 +90,18 @@
 		return null;
 	}
 
-	public Set<IParametedType> getLegalTypes() {
+	public Collection<IParametedType> getLegalTypes() {
 		return getAllTypes();
 	}
 
-	public Set<IParametedType> getAllTypes() {
-		Set<IParametedType> result = new HashSet<IParametedType>();
+	public Collection<IParametedType> getAllTypes() {
+		ArrayList<IParametedType> result = new ArrayList<IParametedType>(1);
 		result.add(type);
 		return result;
 	}
 
-	public Set<ITypeDeclaration> getAllTypeDeclarations() {
-		return new HashSet<ITypeDeclaration>();
+	public Collection<ITypeDeclaration> getAllTypeDeclarations() {
+		return new ArrayList<ITypeDeclaration>(0);
 	}
 
 	public Collection<ITypeDeclaration> getRestrictedTypeDeclaratios() {
@@ -153,8 +151,8 @@
 		return null;
 	}
 
-	public Set<IInjectionPoint> getInjectionPoints() {
-		return new HashSet<IInjectionPoint>();
+	public Collection<IInjectionPoint> getInjectionPoints() {
+		return new ArrayList<IInjectionPoint>(0);
 	}
 
 	public IBean getSpecializedBean() {

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointParameter.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointParameter.java	2012-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointParameter.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -10,13 +10,10 @@
  ******************************************************************************/ 
 package org.jboss.tools.cdi.internal.core.impl;
 
-import java.util.Set;
-
 import org.jboss.tools.cdi.core.CDIConstants;
 import org.jboss.tools.cdi.core.CDIUtil;
 import org.jboss.tools.cdi.core.IBean;
 import org.jboss.tools.cdi.core.IInjectionPointParameter;
-import org.jboss.tools.cdi.core.IQualifierDeclaration;
 import org.jboss.tools.common.java.IAnnotationDeclaration;
 import org.jboss.tools.common.text.ITextSourceReference;
 
@@ -39,15 +36,6 @@
 
 	/*
 	 * (non-Javadoc)
-	 * @see org.jboss.tools.cdi.core.IInjectionPoint#getQualifierDeclarations()
-	 */
-	@Override
-	public Set<IQualifierDeclaration> getQualifierDeclarations() {
-		return super.getQualifierDeclarations();
-	}
-
-	/*
-	 * (non-Javadoc)
 	 * @see org.jboss.tools.cdi.core.IInjectionPoint#isDelegate()
 	 */
 	@Override

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java	2012-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -12,9 +12,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
 import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.ILocalVariable;
@@ -89,7 +87,7 @@
 		return getDefinition().getVariable();
 	}
 
-	public Set<String> getAnnotationTypes() {
+	public Collection<String> getAnnotationTypes() {
 		return getDefinition().getAnnotationTypes();
 	}
 
@@ -110,8 +108,8 @@
 		return result;
 	}
 
-	public Set<IQualifierDeclaration> getQualifierDeclarations() {
-		Set<IQualifierDeclaration> result = new HashSet<IQualifierDeclaration>();
+	public Collection<IQualifierDeclaration> getQualifierDeclarations() {
+		Collection<IQualifierDeclaration> result = new ArrayList<IQualifierDeclaration>();
 		
 		List<IAnnotationDeclaration> ds = definition.getAnnotations();
 		for (IAnnotationDeclaration d: ds) {

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java	2012-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -10,9 +10,9 @@
  ******************************************************************************/ 
 package org.jboss.tools.cdi.internal.core.impl;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
-import java.util.Set;
 
 import org.eclipse.jdt.core.IType;
 import org.jboss.tools.cdi.core.CDIConstants;
@@ -39,8 +39,8 @@
 
 	public ProducerField() {}
 
-	public Set<ITypeDeclaration> getAllTypeDeclarations() {
-		Set<ITypeDeclaration> result = new HashSet<ITypeDeclaration>();
+	public Collection<ITypeDeclaration> getAllTypeDeclarations() {
+		Collection<ITypeDeclaration> result = new ArrayList<ITypeDeclaration>(1);
 		if(typeDeclaration != null && typeDeclaration.getStartPosition() > 0) {
 			result.add(typeDeclaration);
 		}
@@ -55,16 +55,15 @@
 		return getClassBean().getBeanClass();
 	}
 
-	public Set<IInjectionPoint> getInjectionPoints() {
-		return new HashSet<IInjectionPoint>();
+	public Collection<IInjectionPoint> getInjectionPoints() {
+		return new ArrayList<IInjectionPoint>(0);
 	}
 
-	public Set<IParametedType> getLegalTypes() {
-		Set<IParametedType> result = new HashSet<IParametedType>();
+	public Collection<IParametedType> getLegalTypes() {
 		AnnotationDeclaration d = getDefinition().getTypedAnnotation();
-		Set<IParametedType> all = getAllTypes();
+		Collection<IParametedType> all = getAllTypes();
 		if(d != null) {
-			result.addAll(getRestrictedTypeDeclarations(all));
+			Collection<IParametedType> result = new HashSet<IParametedType>(getRestrictedTypeDeclarations(all));
 			ParametedType object = getObjectType(getBeanClass());
 			if(object != null) {
 				result.add(object);
@@ -78,11 +77,11 @@
 	 * (non-Javadoc)
 	 * @see org.jboss.tools.cdi.core.IBean#getAllTypes()
 	 */
-	public Set<IParametedType> getAllTypes() {
+	public Collection<IParametedType> getAllTypes() {
 		if(typeDeclaration != null) {
 			return typeDeclaration.getAllTypes();
 		}
-		return new HashSet<IParametedType>();
+		return new ArrayList<IParametedType>(0);
 	}
 
 	public Collection<ITypeDeclaration> getRestrictedTypeDeclaratios() {
@@ -141,11 +140,11 @@
 	}
 
 	public IScope getScope() {
-		Set<IScopeDeclaration> ds = getScopeDeclarations();
+		Collection<IScopeDeclaration> ds = getScopeDeclarations();
 		if(!ds.isEmpty()) {
 			return ds.iterator().next().getScope();
 		}
-		Set<IScope> defaults = new HashSet<IScope>();
+		Collection<IScope> defaults = new HashSet<IScope>();
 		for (IStereotypeDeclaration d: getStereotypeDeclarations()) {
 			IStereotype s = d.getStereotype();
 			IScope sc = s.getScope();

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java	2012-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -10,6 +10,7 @@
  ******************************************************************************/ 
 package org.jboss.tools.cdi.internal.core.impl;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -59,8 +60,8 @@
 		return new InjectionPointParameter();
 	}
 
-	public Set<ITypeDeclaration> getAllTypeDeclarations() {
-		Set<ITypeDeclaration> result = new HashSet<ITypeDeclaration>();
+	public Collection<ITypeDeclaration> getAllTypeDeclarations() {
+		Collection<ITypeDeclaration> result = new HashSet<ITypeDeclaration>();
 		if(typeDeclaration != null && typeDeclaration.getStartPosition() > 0) {
 			result.add(typeDeclaration);
 		}
@@ -75,8 +76,8 @@
 		return getClassBean().getBeanClass();
 	}
 
-	public Set<IInjectionPoint> getInjectionPoints() {
-		HashSet<IInjectionPoint> result = new HashSet<IInjectionPoint>();
+	public Collection<IInjectionPoint> getInjectionPoints() {
+		Collection<IInjectionPoint> result = new ArrayList<IInjectionPoint>();
 		for (IParameter p: parameters) {
 			if(p instanceof IInjectionPoint) {
 				result.add((IInjectionPoint)p);
@@ -85,10 +86,10 @@
 		return result;
 	}
 
-	public Set<IParametedType> getLegalTypes() {
-		Set<IParametedType> result = new HashSet<IParametedType>();
+	public Collection<IParametedType> getLegalTypes() {
+		Collection<IParametedType> result = new HashSet<IParametedType>();
 		AnnotationDeclaration d = getDefinition().getTypedAnnotation();
-		Set<IParametedType> all = getAllTypes();
+		Collection<IParametedType> all = getAllTypes();
 		if(d != null) {
 			result.addAll(getRestrictedTypeDeclarations(all));
 			ParametedType object = getObjectType(getBeanClass());
@@ -104,11 +105,11 @@
 	 * (non-Javadoc)
 	 * @see org.jboss.tools.cdi.core.IBean#getAllTypes()
 	 */
-	public Set<IParametedType> getAllTypes() {
+	public Collection<IParametedType> getAllTypes() {
 		if(typeDeclaration != null) {
 			return typeDeclaration.getAllTypes();
 		}
-		return new HashSet<IParametedType>();
+		return new ArrayList<IParametedType>(0);
 	}
 
 	public Collection<ITypeDeclaration> getRestrictedTypeDeclaratios() {
@@ -207,7 +208,7 @@
 
 	//same as ProducerField.getScope
 	public IScope getScope() {
-		Set<IScopeDeclaration> ds = getScopeDeclarations();
+		Collection<IScopeDeclaration> ds = getScopeDeclarations();
 		if(!ds.isEmpty()) {
 			return ds.iterator().next().getScope();
 		}

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java	2012-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -10,11 +10,10 @@
  ******************************************************************************/ 
 package org.jboss.tools.cdi.internal.core.impl;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
 import org.jboss.tools.cdi.core.CDIUtil;
 import org.jboss.tools.cdi.core.IInterceptorBinding;
@@ -72,7 +71,7 @@
 	 * @see org.jboss.tools.cdi.core.IStereotype#getStereotypeDeclarations()
 	 */
 	public Collection<IStereotypeDeclaration> getStereotypeDeclarations() {
-		Set<IStereotypeDeclaration> result = new HashSet<IStereotypeDeclaration>();
+		Collection<IStereotypeDeclaration> result = new ArrayList<IStereotypeDeclaration>();
 		for (IAnnotationDeclaration d: definition.getAnnotations()) {
 			if(d instanceof IStereotypeDeclaration) {
 				result.add((IStereotypeDeclaration)d);
@@ -99,7 +98,7 @@
 	 * @see org.jboss.tools.cdi.core.IScoped#getScope()
 	 */
 	public IScope getScope() {
-		Set<IScopeDeclaration> ss = getScopeDeclarations();
+		Collection<IScopeDeclaration> ss = getScopeDeclarations();
 		if(!ss.isEmpty()) {
 			return ss.iterator().next().getScope();
 		}
@@ -117,7 +116,7 @@
 	 * (non-Javadoc)
 	 * @see org.jboss.tools.cdi.core.IScoped#getScopeDeclarations()
 	 */
-	public Set<IScopeDeclaration> getScopeDeclarations() {
+	public Collection<IScopeDeclaration> getScopeDeclarations() {
 		return ProducerField.getScopeDeclarations(getCDIProject().getNature(), definition.getAnnotations());
 	}
 

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java	2012-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -10,9 +10,9 @@
  ******************************************************************************/ 
 package org.jboss.tools.cdi.internal.core.impl.definition;
 
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
@@ -99,9 +99,9 @@
 		return parametedType.getInheritedTypes();
 	}
 
-	public Set<IParametedType> getAllTypes() {
+	public Collection<IParametedType> getAllTypes() {
 		if(parametedType == null) {
-			return Collections.emptySet(); 
+			return Collections.emptyList(); 
 		} 
 		return parametedType.getAllTypes();
 	}

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeansXMLDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeansXMLDefinition.java	2012-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeansXMLDefinition.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -10,8 +10,8 @@
  ******************************************************************************/ 
 package org.jboss.tools.cdi.internal.core.impl.definition;
 
-import java.util.HashSet;
-import java.util.Set;
+import java.util.ArrayList;
+import java.util.Collection;
 
 import org.eclipse.core.runtime.IPath;
 import org.jboss.tools.cdi.xml.beans.model.CDIBeansConstants;
@@ -28,10 +28,10 @@
 public class BeansXMLDefinition implements CDIBeansConstants {
 
 	private IPath path;
-	private Set<INodeReference> typeAlternatives = new HashSet<INodeReference>();
-	private Set<INodeReference> stereotypeAlternatives = new HashSet<INodeReference>();
-	private Set<INodeReference> decorators = new HashSet<INodeReference>();
-	private Set<INodeReference> interceptors = new HashSet<INodeReference>();
+	private Collection<INodeReference> typeAlternatives = new ArrayList<INodeReference>();
+	private Collection<INodeReference> stereotypeAlternatives = new ArrayList<INodeReference>();
+	private Collection<INodeReference> decorators = new ArrayList<INodeReference>();
+	private Collection<INodeReference> interceptors = new ArrayList<INodeReference>();
 
 	public BeansXMLDefinition() {}
 
@@ -82,19 +82,19 @@
 		return path;
 	}
 
-	public Set<INodeReference> getTypeAlternatives() {
+	public Collection<INodeReference> getTypeAlternatives() {
 		return typeAlternatives;
 	}
 
-	public Set<INodeReference> getStereotypeAlternatives() {
+	public Collection<INodeReference> getStereotypeAlternatives() {
 		return stereotypeAlternatives;
 	}
 
-	public Set<INodeReference> getDecorators() {
+	public Collection<INodeReference> getDecorators() {
 		return decorators;
 	}
 
-	public Set<INodeReference> getInterceptors() {
+	public Collection<INodeReference> getInterceptors() {
 		return interceptors;
 	}
 

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIMarkerResolutionUtils.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIMarkerResolutionUtils.java	2012-08-17 22:35:57 UTC (rev 43102)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIMarkerResolutionUtils.java	2012-08-17 23:13:26 UTC (rev 43103)
@@ -12,9 +12,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jdt.core.IAnnotation;
@@ -259,15 +257,15 @@
 		return null;
 	}
 	
-	public static boolean checkBeanQualifiers(IBean selectedBean, IBean bean, Set<IQualifier> qualifiers){
-		HashSet<ValuedQualifier> valuedQualifiers = new HashSet<ValuedQualifier>();
+	public static boolean checkBeanQualifiers(IBean selectedBean, IBean bean, Collection<IQualifier> qualifiers){
+		Collection<ValuedQualifier> valuedQualifiers = new ArrayList<ValuedQualifier>();
 		for(IQualifier qualifier : qualifiers){
 			valuedQualifiers.add(new ValuedQualifier(qualifier));
 		}
 		return checkValuedQualifiers(selectedBean, bean, valuedQualifiers);
 	}
 	
-	public static boolean checkValuedQualifiers(IBean selectedBean, IBean bean, Set<ValuedQualifier> qualifiers){
+	public static boolean checkValuedQualifiers(IBean selectedBean, IBean bean, Collection<ValuedQualifier> qualifiers){
 		for(ValuedQualifier qualifier : qualifiers){
 			if(!isBeanContainQualifier(bean, qualifier)){
 				return false;



More information about the jbosstools-commits mailing list