Lines 48-53
Link Here
|
48 |
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; |
48 |
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; |
49 |
import org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding; |
49 |
import org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding; |
50 |
import org.eclipse.jdt.internal.compiler.lookup.WildcardBinding; |
50 |
import org.eclipse.jdt.internal.compiler.lookup.WildcardBinding; |
|
|
51 |
import org.eclipse.jdt.internal.compiler.util.SuffixConstants; |
51 |
import org.eclipse.jdt.internal.compiler.util.Util; |
52 |
import org.eclipse.jdt.internal.compiler.util.Util; |
52 |
import org.eclipse.jdt.internal.core.ClassFile; |
53 |
import org.eclipse.jdt.internal.core.ClassFile; |
53 |
import org.eclipse.jdt.internal.core.JavaElement; |
54 |
import org.eclipse.jdt.internal.core.JavaElement; |
Lines 397-404
Link Here
|
397 |
referenceBinding = (ReferenceBinding) typeBinding; |
398 |
referenceBinding = (ReferenceBinding) typeBinding; |
398 |
char[] fileName = referenceBinding.getFileName(); |
399 |
char[] fileName = referenceBinding.getFileName(); |
399 |
if (Util.isClassFileName(fileName)) { |
400 |
if (Util.isClassFileName(fileName)) { |
400 |
ClassFile classFile = (ClassFile) getClassFile(fileName); |
401 |
int lastSlash = CharOperation.lastIndexOf('/', fileName); |
401 |
if (classFile == null) return null; |
402 |
if (lastSlash == -1) |
|
|
403 |
lastSlash = CharOperation.lastIndexOf(File.separatorChar, fileName); |
404 |
if (lastSlash == -1) |
405 |
return null; |
406 |
IPackageFragment pkg = getPackageFragment(fileName, lastSlash); |
407 |
char[] constantPoolName = referenceBinding.constantPoolName(); |
408 |
if (constantPoolName == null) { |
409 |
ClassFile classFile = (ClassFile) getClassFile(fileName); |
410 |
return classFile == null ? null : (JavaElement) classFile.getType(); |
411 |
} |
412 |
lastSlash = CharOperation.lastIndexOf('/', constantPoolName); |
413 |
char[] classFileName = CharOperation.subarray(constantPoolName, lastSlash+1, constantPoolName.length); |
414 |
ClassFile classFile = (ClassFile) pkg.getClassFile(new String(classFileName) + SuffixConstants.SUFFIX_STRING_class); |
402 |
return (JavaElement) classFile.getType(); |
415 |
return (JavaElement) classFile.getType(); |
403 |
} |
416 |
} |
404 |
if (referenceBinding.isLocalType() || referenceBinding.isAnonymousType()) { |
417 |
if (referenceBinding.isLocalType() || referenceBinding.isAnonymousType()) { |