Previously, the TypeOracleBuilder would throw a NPE on declarations of the form:

public class <C extends AnotherClass<M>, M extends AThirdClass> MyClass {

...

}

A similar declaration for a generic method would cause the same problem. To fix this issue,  type parameters on a generic type are constructed (along with JClassTypes, JGenericTypes, etc..) on the first pass through the AST (i.e. the 'process' phase). However, they are only partially constructed. The type bounds on a type parameter are created during the second pass through the AST (the 'resolve' phase).

Performed a bit of cleanup in TypeOracleBuilder by getting rid of the bifurcated methods for resolving type parameters on generic types vs. abstract methods. This was done by using an interface common to both types - HasTypeParameters.

Modified JTypeParameter.getEnclosingType() to always return null, since type parameters do not have enclosing types.


Patch by: rdayal, mmendez

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1739 8db76d5a-ed1c-0410-87a9-c151d255dfc7
13 files changed