Arrays.sort(allPotentialSubTypes);
ArrayList potentialSubtypes = new ArrayList();
try {
// create element infos for subtypes
HandleFactory factory = new HandleFactory();
IJavaProject currentProject = null;
if (monitor != null) monitor.beginTask("", length*2 /* 1 for build binding, 1 for connect hierarchy*/); //$NON-NLS-1$
for (int i = 0; i < length; i++) {
try {
String resourcePath = allPotentialSubTypes[i];
// skip duplicate paths (e.g. if focus path was injected when it was already a potential subtype)
if (i > 0 && resourcePath.equals(allPotentialSubTypes[i-1])) continue;
Openable handle;
org.eclipse.jdt.core.ICompilationUnit workingCopy = (org.eclipse.jdt.core.ICompilationUnit)wcPaths.get(resourcePath);
if (workingCopy != null) {
handle = (Openable)workingCopy;
} else {
handle =
resourcePath.equals(focusPath) ?
focusCU :
factory.createOpenable(resourcePath, this.scope);
if (handle == null) continue; // match is outside classpath
}
IJavaProject project = handle.getJavaProject();
if (currentProject == null) {