### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java,v retrieving revision 1.91 diff -u -r1.91 ASTConverterTestAST3_2.java --- src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 10 Apr 2006 14:02:58 -0000 1.91 +++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 18 Apr 2006 03:15:54 -0000 @@ -107,7 +107,7 @@ static { // TESTS_NAMES = new String[] {"test0602"}; -// TESTS_NUMBERS = new int[] { 642, 643, 644 }; +// TESTS_NUMBERS = new int[] { 645 }; } public static Test suite() { return buildModelTestSuite(ASTConverterTestAST3_2.class); @@ -7686,4 +7686,33 @@ workingCopy.discardWorkingCopy(); } } + + /** + * http://dev.eclipse.org/bugs/show_bug.cgi?id=136972 + */ + public void test0645() throws JavaModelException { + ICompilationUnit workingCopy = null; + try { + String contents = + "public class X {\n" + + " static {\n" + + " class A\n" + + " Object o = new Object(){\n" + + " void test(){\n" + + " }\n" + + " };\n" + + " }\n" + + "}"; + workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/); + ASTNode node = buildAST( + contents, + workingCopy, + false, + true); + assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); + } finally { + if (workingCopy != null) + workingCopy.discardWorkingCopy(); + } + } }