Bug 44535 [misc] Wrong message displayed while opening a class file outside classapth
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/ResourceLocator.java
public IResource getUnderlyingResource(Object element) throws JavaModelException {
		if (element instanceof IJavaElement)
			return ((IJavaElement) element).getUnderlyingResource();
		else
			return null;
	}
	public IResource getCorrespondingResource(Object element) throws JavaModelException {
		if (element instanceof IJavaElement)
			return ((IJavaElement) element).getUnderlyingResource();
		else
			return null;
	}
	public IResource getContainingResource(Object element) throws JavaModelException {
		IResource resource= null;
		if (element instanceof IResource)
			resource= (IResource) element;
		if (element instanceof IJavaElement) {
			resource= ((IJavaElement) element).getUnderlyingResource();
			if (resource == null)
				resource= ((IJavaElement) element).getJavaProject().getProject();
		}
		return resource;
	}
}