boolean (final ClassRepr fromClass, IntSet visitedClasses) { if (visitedClasses == null) { visitedClasses = new IntOpenHashSet(); visitedClasses.add(fromClass.name); } for (TypeRepr.ClassType superName : fromClass.getSuperTypes()) { if (!visitedClasses.add(superName.className) || superName.className == myObjectClassName) { continue; } Iterator<ClassRepr> superClasses = reprsByName(superName.className, ClassRepr.class).iterator(); if (!superClasses.hasNext()) { return true; } while (superClasses.hasNext()) { if (extendsLibraryClass(superClasses.next(), visitedClasses)) { return true; } } } return false; }