Author: akazakov
Date: 2012-02-07 20:00:44 -0500 (Tue, 07 Feb 2012)
New Revision: 38490
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java
Log:
https://issues.jboss.org/browse/JBIDE-10809 Can't Resolve Property if Interface
Extending another Interface
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java 2012-02-07
23:49:15 UTC (rev 38489)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java 2012-02-08
01:00:44 UTC (rev 38490)
@@ -35,9 +35,8 @@
import org.eclipse.jdt.core.Signature;
import org.jboss.tools.common.el.core.ELCorePlugin;
import org.jboss.tools.common.el.core.ca.preferences.ELContentAssistPreferences;
-import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
+import org.jboss.tools.common.util.BeanUtil;
import org.jboss.tools.common.util.EclipseJavaUtil;
-import org.jboss.tools.common.util.BeanUtil;
/**
* This class helps to collect information of java elements used in Seam EL.
@@ -810,8 +809,22 @@
fTypeInfo = new TypeInfo(binType, fMember, fMember.isDataModel());
}
TypeInfo parent = fTypeInfo;
+ Set<IType> allTypes = new HashSet<IType>();
+ Set<IType> superinterfaces = new HashSet<IType>();
while (binType != null) {
- IMethod[] binMethods = binType.getMethods();
+ allTypes.add(binType);
+ initSuperinterfaces(binType, superinterfaces); // JBIDE-10809
+ binType = getSuperclass(binType);
+ if(binType!=null) {
+ TypeInfo superType = new TypeInfo(binType, originalParent, parent.isDataModel());
+ parent.setSuperType(superType);
+ parent = superType;
+ }
+ }
+
+ allTypes.addAll(superinterfaces);
+ for (IType type : allTypes) {
+ IMethod[] binMethods = type.getMethods();
for (int i = 0; binMethods != null && i < binMethods.length; i++) {
if (binMethods[i].isConstructor()) {
continue;
@@ -821,14 +834,7 @@
info.setDataModel(true);
}
fMethods.add(info);
-
}
- binType = getSuperclass(binType);
- if(binType!=null) {
- TypeInfo superType = new TypeInfo(binType, originalParent, parent.isDataModel());
- parent.setSuperType(superType);
- parent = superType;
- }
}
// This inserts here methods "public int size()" and "public boolean
isEmpty()" for javax.faces.model.DataModel
@@ -972,6 +978,23 @@
return null;
}
+ public static void initSuperinterfaces(IType type, Set<IType> result) throws
JavaModelException {
+// IType superType = getSuperclass(type);
+// if(superType)
+ String[] superinterfaceNames = type.getSuperInterfaceNames();
+ for (String superinterface : superinterfaceNames) {
+ String fullySuperclassName = EclipseJavaUtil.resolveType(type, superinterface);
+ if(fullySuperclassName!=null) {
+ if(fullySuperclassName.equals(type.getFullyQualifiedName())) {
+ break;
+ }
+ IType superType = type.getJavaProject().findType(fullySuperclassName);
+ result.add(superType);
+ initSuperinterfaces(superType, result);
+ }
+ }
+ }
+
public MethodInfo[] findMethodInfos(IMethod iMethod) {
List<MethodInfo> methods = new ArrayList<MethodInfo>();