Community
Participate
Working Groups
An internal error occurred during: "Java AST creation". 1) I had the following source: An internal error occurred during: "Java AST creation". java.lang.NullPointerException org.eclipse.jdt.internal.compiler.ast.MessageSend.computeConversion (MessageSend.java:63) org.eclipse.jdt.internal.compiler.ast.ForStatement.resolve (ForStatement.java:291) org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatemen ts(AbstractMethodDeclaration.java:400) org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements (MethodDeclaration.java:139) org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve (AbstractMethodDeclaration.java:378) org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve (TypeDeclaration.java:940) org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve (TypeDeclaration.java:989) org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve (CompilationUnitDeclaration.java:280) org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve (CompilationUnitResolver.java:437) org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve (CompilationUnitResolver.java:314) org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:658) org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:574) org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST (ASTProvider.java:441) org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:393) org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartLis tenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:164) org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run (SelectionListenerWithASTManager.java:141) org.eclipse.core.internal.jobs.Worker.run(Worker.java:66) ->got the following NPE java.lang.NullPointerException org.eclipse.jdt.internal.compiler.ast.MessageSend.computeConversion (MessageSend.java:63) org.eclipse.jdt.internal.compiler.ast.ForStatement.resolve (ForStatement.java:291) org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatemen ts(AbstractMethodDeclaration.java:400) org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements (MethodDeclaration.java:139) org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve (AbstractMethodDeclaration.java:378) org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve (TypeDeclaration.java:940) org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve (TypeDeclaration.java:989) org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve (CompilationUnitDeclaration.java:280) org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve (CompilationUnitResolver.java:437) org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve (CompilationUnitResolver.java:314) org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:658) org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:574) org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST (ASTProvider.java:441) org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:393) org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartLis tenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:164) org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run (SelectionListenerWithASTManager.java:141) org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
grr... when in this state I cannot copy the source anymore... here it is (you have to disable Update imports on Paste) file InheritedTestCase.java package junit.tests; import java.util.ArrayList; import java.util.Enumeration; import java.util.Iterator; import java.util.List; import junit.framework.Test; /** * Test class used in SuiteTest */ public class InheritedTestCase extends TestCase { public InheritedTestCase(String name) { super(name); } public void test2() { List<String> l= new ArrayList<String>(); for (Iterator<String> i= l.iterator(); i.next(); ) { } } }
Custom conversion were missing null checks. Added regression test: GenericTypeTest#test301 Fixed
Test is actually #test302.
*** Bug 74066 has been marked as a duplicate of this bug. ***
Verified for 3.1 M2 with build I200409231635.