Community
Participate
Working Groups
I20050104-1600 + jdt.core from HEAD The ASTParser throws an NPE when trying to compile the invalid class declaration below (missing parentheses after "new Cla<String>"). class Cla<T> { T getT() { return null; } void m() { String s= new Cla<String>.getT(); } } Error Jan 11, 2005 12:59:51.819 An internal error occurred during: "Java AST creation". java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.ast.AllocationExpression.resolveType(AllocationExpression.java:246) at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.resolve(LocalDeclaration.java:201) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:411) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:160) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:389) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1014) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1063) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:280) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:801) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:464) at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:759) at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:575) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:563) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:494) at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:165) at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:142) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
The NPE occurs in the compiler. The AST converter is simply calling the compiler to resolve the code.
Added GenericTypeTest#test465. Allocation expression did not properly handle unbound parameterized type. Fixed
Verified in I20050214