### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: model/org/eclipse/jdt/internal/core/ClassFile.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFile.java,v retrieving revision 1.124 diff -u -r1.124 ClassFile.java --- model/org/eclipse/jdt/internal/core/ClassFile.java 26 Apr 2006 10:31:32 -0000 1.124 +++ model/org/eclipse/jdt/internal/core/ClassFile.java 31 May 2006 16:51:52 -0000 @@ -11,6 +11,7 @@ package org.eclipse.jdt.internal.core; import java.io.IOException; +import java.util.HashMap; import java.util.Map; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -95,6 +96,10 @@ IType type = new BinaryType(this, simpleName(typeInfo.getName())); info.setChildren(new IJavaElement[] {type}); newElements.put(type, typeInfo); + + // Read children + ((ClassFileInfo) info).readBinaryChildren((HashMap) newElements, typeInfo); + return true; } /** #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/ExistenceTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExistenceTests.java,v retrieving revision 1.22 diff -u -r1.22 ExistenceTests.java --- src/org/eclipse/jdt/core/tests/model/ExistenceTests.java 4 May 2006 09:33:14 -0000 1.22 +++ src/org/eclipse/jdt/core/tests/model/ExistenceTests.java 31 May 2006 16:51:57 -0000 @@ -64,6 +64,18 @@ } assertTrue("Should not be able to get underlying resource", gotException); } +public void testBinaryMethodAfterNonExistingMember() throws CoreException { + try { + IJavaProject project = createJavaProject("P", new String[] {}, new String[] {"JCL_LIB"}, ""); + IClassFile classFile = project.getPackageFragmentRoot(getExternalJCLPathString()).getPackageFragment("java.lang").getClassFile("Object.class"); + classFile.open(null); + IType type = classFile.getType(); + type.getMethod("foo", new String[0]).exists(); + assertTrue("Object.toString() should exist", type.getMethod("toString", new String[0]).exists()); + } finally { + deleteProject("P"); + } +} public void testClassFileInBinary() throws CoreException { try { this.createJavaProject("P", new String[] {"src"}, "bin");