View | Details | Raw Unified | Return to bug 154667 | Differences between
and this patch

Collapse All | Expand All

(-)search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java (-9 / +4 lines)
Lines 712-726 Link Here
712
	if (simpleTypeName.equals(binaryTypeQualifiedName))
712
	if (simpleTypeName.equals(binaryTypeQualifiedName))
713
		return binaryType; // answer only top-level types, sometimes the classFile is for a member/local type
713
		return binaryType; // answer only top-level types, sometimes the classFile is for a member/local type
714
714
715
	try {
715
	// type name may be null for anonymous (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=164791)
716
		// type name may be null for anonymous (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=164791)
716
	String classFileName = simpleTypeName.length() == 0 ? binaryTypeQualifiedName : simpleTypeName;
717
		String classFileName = simpleTypeName.length() == 0 ? binaryTypeQualifiedName : simpleTypeName;
717
	IClassFile classFile = binaryType.getPackageFragment().getClassFile(classFileName + SuffixConstants.SUFFIX_STRING_class);
718
		IClassFile classFile = binaryType.getPackageFragment().getClassFile(classFileName + SuffixConstants.SUFFIX_STRING_class);
718
	return classFile.getType();
719
		return classFile.getType();
720
	} catch (JavaModelException e) {
721
		// ignore as implementation of getType() cannot throw this exception
722
	}
723
	return null;
724
}
719
}
725
protected boolean encloses(IJavaElement element) {
720
protected boolean encloses(IJavaElement element) {
726
	return element != null && this.scope.encloses(element);
721
	return element != null && this.scope.encloses(element);
(-)model/org/eclipse/jdt/core/IClassFile.java (-4 / +2 lines)
Lines 90-102 Link Here
90
byte[] getBytes() throws JavaModelException;
90
byte[] getBytes() throws JavaModelException;
91
/**
91
/**
92
 * Returns the type contained in this class file.
92
 * Returns the type contained in this class file.
93
 * This is a handle-only method. The type may or may not exist.
93
 *
94
 *
94
 * @return the type contained in this class file
95
 * @return the type contained in this class file
95
 *
96
 * @exception JavaModelException if this element does not exist or if an
97
 *      exception occurs while accessing its corresponding resource
98
 */
96
 */
99
IType getType() throws JavaModelException;
97
IType getType();
100
/**
98
/**
101
 * Returns a working copy on the source associated with this class file using the given 
99
 * Returns a working copy on the source associated with this class file using the given 
102
 * factory to create the buffer, or <code>null</code> if there is no source associated
100
 * factory to create the buffer, or <code>null</code> if there is no source associated

Return to bug 154667