private void collectHierarchyMirrors(TypeMirror typeMirror, String stringRepresentation) {
if (typeMirror.getKind() != TypeKind.DECLARED
|| typeMirror.toString().equals(Object.class.getName())) {
return;
}
DeclaredType declaredType = toDeclaredType(typeMirror);
TypeElement e = toTypeElement(declaredType);
TypevarContext context = new TypevarContext(e, stringRepresentation);
collectInterfacesMirrors(declaredType, context);
TypeMirror superclassMirror = e.getSuperclass();
if (superclassMirror.getKind() != TypeKind.NONE) {
DeclaredType superclass = toDeclaredType(superclassMirror);
String stringified = stringify(superclass, context);
if (!stringified.equals(Object.class.getName())) {
extendedClasses.add(toTypeElement(superclass));
extendedClassNames.add(stringified);
collectHierarchyMirrors(superclass, stringified);
}
}
for (TypeMirror m : e.getInterfaces()) {
collectUnresolvedInterface(m, context);
collectInterfacesMirrors(m, context);
}
}