if (this.type.isBinary()) {
BinaryTypeBinding binding = this.locator.cacheBinaryType(this.type, null);
if (binding != null)
collectSuperTypeNames(binding);
} else {
ICompilationUnit unit = this.type.getCompilationUnit();
SourceType sourceType = (SourceType) this.type;
boolean isTopLevelOrMember = sourceType.getOuterMostLocalContext() == null;
CompilationUnitDeclaration parsedUnit = buildBindings(unit, isTopLevelOrMember);
if (parsedUnit != null) {
TypeDeclaration typeDecl = new ASTNodeFinder(parsedUnit).findType(this.type);
if (typeDecl != null && typeDecl.binding != null)
collectSuperTypeNames(typeDecl.binding);
}
}
} catch (AbortCompilation e) {
// problem with classpath: report inacurrate matches
return null;
}
if (this.result.length > this.resultIndex)
System.arraycopy(this.result, 0, this.result = new char[this.resultIndex][][], 0, this.resultIndex);
return this.result;
}
// Collect the paths of the cus that declare a type which matches declaringQualification + declaringSimpleName
String[] paths = getPathsOfDeclaringType();
if (paths == null) return null;
// Create bindings from source types and binary types and collect super type names of the type declaration
// that match the given declaring type
Util.sort(paths); // sort by projects
JavaProject previousProject = null;
this.result = new char[1][][];
this.resultIndex = 0;
for (int i = 0, length = paths.length; i < length; i++) {
try {
Openable openable = this.locator.handleFactory.createOpenable(paths[i], this.locator.scope);
if (openable == null) continue; // outside classpath
IJavaProject project = openable.getJavaProject();
if (!project.equals(previousProject)) {
previousProject = (JavaProject) project;
this.locator.initialize(previousProject, 0);
}
if (openable instanceof ICompilationUnit) {
ICompilationUnit unit = (ICompilationUnit) openable;
CompilationUnitDeclaration parsedUnit = buildBindings(unit, true /*only toplevel and member types are visible to the focus type*/);
if (parsedUnit != null)
parsedUnit.traverse(new TypeDeclarationVisitor(), parsedUnit.scope);
} else if (openable instanceof IClassFile) {
IClassFile classFile = (IClassFile) openable;