private static Collection<AncestryTreeNode> buildAncestryTree(RefType root) { if (root.getSootClass().isPhantom()) { return Collections.emptyList(); } LinkedList<AncestryTreeNode> leafs = new LinkedList<AncestryTreeNode>(); leafs.add(new AncestryTreeNode(null, root)); LinkedList<AncestryTreeNode> r = new LinkedList<AncestryTreeNode>(); final RefType objectType = RefType.v("java.lang.Object"); while (!leafs.isEmpty()) { AncestryTreeNode node = leafs.remove(); if (TypeResolver.typesEqual(node.type, objectType)) { r.add(node); } else { SootClass sc = node.type.getSootClass(); for (SootClass i : sc.getInterfaces()) { leafs.add(new AncestryTreeNode(node, (i).getType())); } // The superclass of all interfaces is Object // -- try to discard phantom interfaces. if ((!sc.isInterface() || sc.getInterfaceCount() == 0) && !sc.isPhantom()) { leafs.add(new AncestryTreeNode(node, sc.getSuperclass().getType())); } } } return r; }
String[] interfaces = new String[sc.getInterfaceCount()]; Iterator<SootClass> implementedInterfaces = sc.getInterfaces().iterator(); int i = 0;
= xmlClassNode.addChild("interfaces", "", new String[] { "count" }, new String[] { cl.getInterfaceCount() + "" });
@Override public Collection<SootClass> load(SootClass sc) throws Exception { Set<SootClass> set = new HashSet<SootClass>(sc.getInterfaceCount()); for (SootClass i : sc.getInterfaces()) { set.add(i); set.addAll(interfacesOf.getUnchecked(i)); } SootClass superClass = sc.getSuperclassUnsafe(); if (superClass != null) set.addAll(interfacesOf.getUnchecked(superClass)); return set; }
@Override public Collection<SootClass> load(SootClass sc) throws Exception { Set<SootClass> set = new HashSet<SootClass>(sc.getInterfaceCount()); for (SootClass i : sc.getInterfaces()) { set.add(i); set.addAll(interfacesOf.getUnchecked(i)); } if (sc.hasSuperclass()) set.addAll(interfacesOf.getUnchecked(sc.getSuperclass())); return set; }
@Override public Collection<SootClass> load(SootClass sc) throws Exception { Set<SootClass> set = new HashSet<SootClass>(sc.getInterfaceCount()); for (SootClass i : sc.getInterfaces()) { set.add(i); set.addAll(interfacesOf.getUnchecked(i)); } if (sc.hasSuperclass()) set.addAll(interfacesOf.getUnchecked(sc.getSuperclass())); return set; }
if (fromClass.getInterfaceCount() > 0) {