Fixes a ClassCastException in the TypeOracle. JDT was using a parameterized type binding to reference a non-generic, static inner class of a generic type.
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1573 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 4e84999..a5c80da 100644
--- a/dev/core/src/com/google/gwt/dev/jdt/TypeOracleBuilder.java
+++ b/dev/core/src/com/google/gwt/dev/jdt/TypeOracleBuilder.java
@@ -852,7 +852,7 @@
*/
return;
}
-
+
String qname;
String jclassName;
if (binding instanceof LocalTypeBinding) {
@@ -871,7 +871,7 @@
if (oracle.findType(qname) != null) {
// TODO: gname of generic types includes the type arguments, I think that
- // this would cause inner classes to not be found.
+ // this would cause inner classes to not be found.
return;
}
@@ -1332,20 +1332,18 @@
}
if (!failed) {
- JEnumType enumType = resolveType.isEnum();
- if (enumType != null) {
+ if (resolveType.isGenericType() != null) {
+ return oracle.getParameterizedType(resolveType.isGenericType(),
+ enclosingType, typeArguments);
+ } else {
/*
- * An enumerated type that is nested within a generic type is referenced
+ * A static type (enum or class) that does not declare any type
+ * parameters that is nested within a generic type might be referenced
* via a parameterized type by JDT. In this case we just return the
- * enumerated type and don't treat it as a parameterized type since
- * enumerations cannot be parameterized and are implicitly static.
+ * type and don't treat it as a parameterized.
*/
- return enumType;
+ return resolveType;
}
-
- JGenericType genericType = (JGenericType) resolveType;
- return oracle.getParameterizedType(genericType, enclosingType,
- typeArguments);
} else {
// Fall-through to failure
}