We were assuming that JDT's TypeVariableBinding.firstBound would always be a class which may not be true. Based on the JDT 3.1 source this should have always been possible; however people only ran into this problem after we upgraded to JDT 3.3.
Review by: spoon
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1850 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/jdt/TypeOracleBuilder.java b/dev/core/src/com/google/gwt/dev/jdt/TypeOracleBuilder.java
index d5b1234..087982c 100644
--- a/dev/core/src/com/google/gwt/dev/jdt/TypeOracleBuilder.java
+++ b/dev/core/src/com/google/gwt/dev/jdt/TypeOracleBuilder.java
@@ -697,24 +697,28 @@
List<JClassType> bounds = new ArrayList<JClassType>();
JClassType jfirstBound = (JClassType) resolveType(logger, firstBound);
-
if (jfirstBound == null) {
return null;
}
- if (jfirstBound.isClass() != null) {
- bounds.add(jfirstBound);
- }
+ bounds.add(jfirstBound);
ReferenceBinding[] superInterfaces = tvBinding.superInterfaces();
for (ReferenceBinding superInterface : superInterfaces) {
- JClassType jsuperInterface = (JClassType) resolveType(logger,
- superInterface);
-
- if (jsuperInterface == null || jsuperInterface.isInterface() == null) {
- return null;
+ if (superInterface != firstBound) {
+ JClassType jsuperInterface = (JClassType) resolveType(logger,
+ superInterface);
+ if (jsuperInterface == null) {
+ return null;
+ }
+ bounds.add(jsuperInterface);
+ } else {
+ /*
+ * If the first bound was an interface JDT will still include it in the
+ * set of superinterfaces. So, we ignore it since we have already added
+ * it to the bounds.
+ */
}
- bounds.add(jsuperInterface);
}
return new JUpperBound(bounds.toArray(NO_JCLASSES));