Author: scabanovich
Date: 2010-09-01 11:06:57 -0400 (Wed, 01 Sep 2010)
New Revision: 24611
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DecoratorBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
https://jira.jboss.org/browse/JBIDE-6957
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DecoratorBean.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DecoratorBean.java 2010-09-01
14:36:07 UTC (rev 24610)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DecoratorBean.java 2010-09-01
15:06:57 UTC (rev 24611)
@@ -10,8 +10,12 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.impl;
+import java.util.HashSet;
import java.util.Set;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IDecorator;
import org.jboss.tools.cdi.core.IParametedType;
@@ -30,8 +34,22 @@
* @see org.jboss.tools.cdi.core.IDecorator#getDecoratedTypes()
*/
public Set<IParametedType> getDecoratedTypes() {
- return getLegalTypes();
-// return ((TypeDefinition)definition).getInheritedTypes();
+ Set<IParametedType> result = new HashSet<IParametedType>();
+
+ Set<IParametedType> legalTypes = getLegalTypes();
+ for (IParametedType pt: legalTypes) {
+ IType t = pt.getType();
+ try {
+ if(!t.isInterface()) continue;
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
+ continue;
+ }
+ if(!"java.io.Serializable".equals(t.getFullyQualifiedName())) {
+ result.add(pt);
+ }
+ }
+ return result;
}
/*
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-09-01
14:36:07 UTC (rev 24610)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-09-01
15:06:57 UTC (rev 24611)
@@ -82,6 +82,7 @@
import org.jboss.tools.cdi.core.ITypeDeclaration;
import org.jboss.tools.cdi.core.preferences.CDIPreferences;
import org.jboss.tools.cdi.internal.core.impl.CDIProject;
+import org.jboss.tools.cdi.internal.core.impl.ParametedType;
import org.jboss.tools.cdi.internal.core.impl.Parameter;
import org.jboss.tools.cdi.internal.core.impl.SessionBean;
import org.jboss.tools.common.EclipseUtil;
@@ -1717,19 +1718,13 @@
}
private List<String> getSuppers(IParametedType type) {
- try {
- List<IType> types = EclipseJavaUtil.getSupperTypes(type.getType());
- List<String> signatures = new ArrayList<String>();
- for (IType iType : types) {
- IParametedType superType =
cdiProject.getNature().getTypeFactory().newParametedType(iType);
- signatures.add(superType.getSignature());
- }
- signatures.add(type.getSignature());
- return signatures;
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
+ Set<IParametedType> types = ((ParametedType)type).getAllTypes();
+ List<String> signatures = new ArrayList<String>();
+ for (IParametedType superType : types) {
+ signatures.add(superType.getSignature());
}
- return Collections.emptyList();
+ signatures.add(type.getSignature());
+ return signatures;
}
/*