private SupertypeQueryResults computeSupertypes ( ClassDescriptor classDescriptor ) // throws // ClassNotFoundException { if ( DEBUG_QUERIES ) { System . out . println ( "Computing supertypes for " + classDescriptor . toDottedClassName ( ) ) ; } // Try to fully resolve the class and its superclasses/superinterfaces. ClassVertex typeVertex = optionallyResolveClassVertex ( classDescriptor ) ; // Create new empty SupertypeQueryResults. SupertypeQueryResults supertypeSet = new SupertypeQueryResults ( ) ; // Add all known superclasses/superinterfaces. // The ClassVertexes for all of them should be in the // InheritanceGraph by now. LinkedList < ClassVertex > workList = new LinkedList <> ( ) ; workList . addLast ( typeVertex ) ; while ( ! workList . isEmpty ( ) ) { ClassVertex vertex = workList . removeFirst ( ) ; supertypeSet . addSupertype ( vertex . getClassDescriptor ( ) ) ; if ( vertex . isResolved ( ) ) { if ( DEBUG_QUERIES ) { System . out . println ( " Adding supertype " + vertex . getClassDescriptor ( ) . toDottedClassName ( ) ) ; } } else { if ( DEBUG_QUERIES ) { System . out . println ( " Encountered unresolved class " + vertex . getClassDescriptor ( ) . toDottedClassName ( ) + " in supertype query" ) ; } supertypeSet . setEncounteredMissingClasses ( true ) ; } Iterator < InheritanceEdge > i = graph . outgoingEdgeIterator ( vertex ) ; while ( i . hasNext ( ) ) { InheritanceEdge edge = i . next ( ) ; workList . addLast ( edge . getTarget ( ) ) ; } } return supertypeSet ; }
Compute supertypes for class named by given ClassDescriptor .