### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java,v retrieving revision 1.285 diff -u -r1.285 MatchLocator.java --- search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 24 Nov 2006 01:32:04 -0000 1.285 +++ search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 23 Feb 2007 16:26:34 -0000 @@ -712,15 +712,10 @@ if (simpleTypeName.equals(binaryTypeQualifiedName)) return binaryType; // answer only top-level types, sometimes the classFile is for a member/local type - try { - // type name may be null for anonymous (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=164791) - String classFileName = simpleTypeName.length() == 0 ? binaryTypeQualifiedName : simpleTypeName; - IClassFile classFile = binaryType.getPackageFragment().getClassFile(classFileName + SuffixConstants.SUFFIX_STRING_class); - return classFile.getType(); - } catch (JavaModelException e) { - // ignore as implementation of getType() cannot throw this exception - } - return null; + // type name may be null for anonymous (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=164791) + String classFileName = simpleTypeName.length() == 0 ? binaryTypeQualifiedName : simpleTypeName; + IClassFile classFile = binaryType.getPackageFragment().getClassFile(classFileName + SuffixConstants.SUFFIX_STRING_class); + return classFile.getType(); } protected boolean encloses(IJavaElement element) { return element != null && this.scope.encloses(element); Index: model/org/eclipse/jdt/core/IClassFile.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClassFile.java,v retrieving revision 1.23 diff -u -r1.23 IClassFile.java --- model/org/eclipse/jdt/core/IClassFile.java 16 Feb 2007 19:43:35 -0000 1.23 +++ model/org/eclipse/jdt/core/IClassFile.java 23 Feb 2007 16:26:33 -0000 @@ -90,13 +90,11 @@ byte[] getBytes() throws JavaModelException; /** * Returns the type contained in this class file. + * This is a handle-only method. The type may or may not exist. * * @return the type contained in this class file - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource */ -IType getType() throws JavaModelException; +IType getType(); /** * Returns a working copy on the source associated with this class file using the given * factory to create the buffer, or null if there is no source associated