}
// Current type reference is not parameterized. So, it is the last type argument
return (((long) depth) << 32) + lastTypeArgument.sourceEnd;
}
protected IBinaryType getBinaryInfo(ClassFile classFile, IResource resource) throws CoreException {
BinaryType binaryType = (BinaryType) classFile.getType();
if (classFile.isOpen())
return (IBinaryType) binaryType.getElementInfo(); // reuse the info from the java model cache
// create a temporary info
IBinaryType info;
try {
PackageFragment pkg = (PackageFragment) classFile.getParent();
PackageFragmentRoot root = (PackageFragmentRoot) pkg.getParent();
if (root.isArchive()) {
// class file in a jar
String classFileName = classFile.getElementName();
String classFilePath = Util.concatWith(pkg.names, classFileName, '/');
ZipFile zipFile = null;
try {
zipFile = ((JarPackageFragmentRoot) root).getJar();
info = ClassFileReader.read(zipFile, classFilePath);
} finally {
JavaModelManager.getJavaModelManager().closeZipFile(zipFile);
}
} else {
// class file in a directory
info = Util.newClassFileReader(resource);
}
if (info == null) throw binaryType.newNotPresentException();
return info;
} catch (ClassFormatException e) {
//e.printStackTrace();
return null;
} catch (java.io.IOException e) {