Author: scabanovich
Date: 2012-08-15 20:14:03 -0400 (Wed, 15 Aug 2012)
New Revision: 43055
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanValidator.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.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java 2012-08-16
00:13:04 UTC (rev 43054)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java 2012-08-16
00:14:03 UTC (rev 43055)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.solder.core;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -182,12 +183,11 @@
String defaultBeanAnnotationTypeName =
getVersion().getDefaultBeanAnnotationTypeName();
ICDIProject cdiProject = CDICorePlugin.getCDIProject(file.getProject(), true);
if(cdiProject == null) return;
- Set<IBean> bs = cdiProject.getBeans(file.getFullPath());
- for (IBean bean: bs) {
+ for (IBean bean: cdiProject.getBeans(file.getFullPath())) {
if(isBeanDefault(bean)) {
ITextSourceReference a = bean.getAnnotation(defaultBeanAnnotationTypeName);
if(a == null) {
- Set<ITypeDeclaration> ds = bean.getAllTypeDeclarations();
+ Collection<ITypeDeclaration> ds = bean.getAllTypeDeclarations();
if(!ds.isEmpty()) {
IMember e = bean instanceof IJavaReference ?
((IJavaReference)bean).getSourceMember() : bean.getBeanClass();
a = CDIUtil.convertToJavaSourceReference(ds.iterator().next(), e);
@@ -215,9 +215,8 @@
}
}
}
- Set<IBean> bs2 = cdiProject.getBeans(false, type, qs);
StringBuilder otherDefaultBeans = new StringBuilder();
- for (IBean b: bs2) {
+ for (IBean b: cdiProject.getBeans(false, type, qs)) {
try {
if(b != bean && isBeanDefault(b)
&& CDIProject.areMatchingQualifiers(bean.getQualifierDeclarations(),
b.getQualifierDeclarations(true))) {
@@ -244,7 +243,7 @@
}
private IParametedType getDefaultType(IBean bean) {
- Set<IParametedType> ts = bean.getLegalTypes();
+ Collection<IParametedType> ts = bean.getLegalTypes();
if(ts.size() < 3) {
for (IParametedType t: ts) {
if(!"java.lang.Object".equals(t.getType().getFullyQualifiedName())) {
@@ -266,7 +265,7 @@
return null;
}
- private String createKey(IParametedType type, Set<IQualifierDeclaration> qs) {
+ private String createKey(IParametedType type, Collection<IQualifierDeclaration>
qs) {
Set<String> ss = new TreeSet<String>();
for (IQualifierDeclaration q: qs) {
if(!q.getTypeName().equals(CDIConstants.ANY_QUALIFIER_TYPE_NAME)
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java 2012-08-16
00:13:04 UTC (rev 43054)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java 2012-08-16
00:14:03 UTC (rev 43055)
@@ -139,8 +139,7 @@
cb.setDefinition(ti);
p.addBean(cb);
- Set<IProducer> producers = cb.getProducers();
- for (IProducer producer: producers) {
+ for (IProducer producer: cb.getProducers()) {
p.addBean(producer);
}
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanValidator.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanValidator.java 2012-08-16
00:13:04 UTC (rev 43054)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanValidator.java 2012-08-16
00:14:03 UTC (rev 43055)
@@ -144,8 +144,7 @@
}
private IBean findGenericBean(IFile file, IMember member, CDICoreNature project) {
- Set<IBean> bs = project.getDelegate().getBeans(file.getFullPath());
- for (IBean b: bs) {
+ for (IBean b: project.getDelegate().getBeans(file.getFullPath())) {
if(b instanceof IClassBean) {
if(member.equals(((IClassBean)b).getBeanClass())) return b;
} else if(b instanceof IProducer) {