Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java =================================================================== RCS file: /data/cvs/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java,v retrieving revision 1.126 diff -u -r1.126 ASTConverterTest2.java --- src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java 3 Jun 2004 11:47:57 -0000 1.126 +++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java 7 Jun 2004 15:37:44 -0000 @@ -4352,6 +4352,32 @@ sourceUnit.discardWorkingCopy(); } } + /* + * Ensures that asking for well known type doesn't throw a NPE if the problem requestor is not active. + * (regression test for bug 64750 NPE in Java AST Creation - editing some random file) + */ + public void test0538h() throws JavaModelException { + ICompilationUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + try { + ReconcilerTests.ProblemRequestor pbRequestor = new ReconcilerTests.ProblemRequestor() { + public boolean isActive() { + return false; + } + }; + sourceUnit.becomeWorkingCopy(pbRequestor, null); + sourceUnit.getBuffer().setContents( + "package test0538;\n" + + "public class A {\n" + + " Object field;\n" + + "}" + ); + // TODO improve test for AST.JLS3 + CompilationUnit unit = sourceUnit.reconcile(AST.JLS2, false, null, null); + assertEquals("Unexpected well known type", null, unit.getAST().resolveWellKnownType("void")); + } finally { + sourceUnit.discardWorkingCopy(); + } + } /** * http://dev.eclipse.org/bugs/show_bug.cgi?id=53477 */