### 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.145 diff -u -r1.145 ASTConverterTestAST3_2.java --- src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 31 Jul 2008 15:08:38 -0000 1.145 +++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 6 Aug 2008 14:24:33 -0000 @@ -122,7 +122,7 @@ static { // TESTS_NAMES = new String[] {"test0602"}; // TESTS_RANGE = new int[] { 670, -1 }; -// TESTS_NUMBERS = new int[] { 691 }; +// TESTS_NUMBERS = new int[] { 692 }; } public static Test suite() { return buildModelTestSuite(ASTConverterTestAST3_2.class); @@ -9803,4 +9803,31 @@ ASTNode node = parser.createAST(null); assertNotNull("No node", node); } + /* + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=242961 + */ + public void test0692() throws JavaModelException { + ICompilationUnit workingCopy = null; + try { + String contents = + "/*start*/public class X {\n" + + " int k;\n" + + " Zork z;\n" + + "}/*end*/"; + workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/); + TypeDeclaration typeDeclaration = (TypeDeclaration) buildAST( + contents, + workingCopy, + false, + false, + false); + ITypeBinding binding = typeDeclaration.resolveBinding(); + IVariableBinding[] declaredFields = binding.getDeclaredFields(); + assertEquals("Wrong size", 1, declaredFields.length); + } finally { + if (workingCopy != null) { + workingCopy.discardWorkingCopy(); + } + } + } }