public Set possibleTypes() { if (subsets == null) { return Collections.EMPTY_SET; } HashSet ret = new HashSet(); for (PointsToSet subset : subsets) { ret.addAll(subset.possibleTypes()); } return ret; }
protected void handleClass(PrintWriter out, SootClass c) { for (SootMethod m : c.getMethods()) { if (!m.isConcrete()) { continue; } Body b = m.retrieveActiveBody(); Local[] sortedLocals = b.getLocals().toArray(new Local[b.getLocalCount()]); Arrays.sort(sortedLocals, new StringComparator<Local>()); for (Local l : sortedLocals) { out.println("V " + m + l); if (l.getType() instanceof RefLikeType) { Set<Type> types = pa.reachingObjects(l).possibleTypes(); Type[] sortedTypes = types.toArray(new Type[types.size()]); Arrays.sort(sortedTypes, new StringComparator<Type>()); for (Type type : sortedTypes) { out.println("T " + type); } } } } } }
final Local receiver = receiverIt.next(); final PointsToSet p2set = pa.reachingObjects(receiver); for (Iterator<Type> typeIt = p2set.possibleTypes().iterator(); typeIt.hasNext();) { final Type type = typeIt.next(); ofcgb.addType(receiver, momc.context(), type, null); for (Local base : bases) { PointsToSet pts = pa.reachingObjects(base); for (Type ty : pts.possibleTypes()) { ofcgb.addBaseType(base, momc.context(), ty); for (Type t : pa.reachingObjectsOfArrayElement(pts).possibleTypes()) { ofcgb.addInvokeArgType(argArray, momc.context(), t);
for (Type ty : pag.reachingObjectsOfArrayElement(p2set).possibleTypes()) { ofcgb.addInvokeArgType(receiver, context, ty);
protected void handleClass( PrintWriter out, SootClass c ) { for( Iterator mIt = c.methodIterator(); mIt.hasNext(); ) { final SootMethod m = (SootMethod) mIt.next(); if( !m.isConcrete() ) continue; Body b = m.retrieveActiveBody(); TreeSet sortedLocals = new TreeSet( new StringComparator() ); sortedLocals.addAll( b.getLocals() ); for( Iterator lIt = sortedLocals.iterator(); lIt.hasNext(); ) { final Local l = (Local) lIt.next(); out.println( "V "+m+l ); if( l.getType() instanceof RefLikeType ) { Set types = pa.reachingObjects( l ).possibleTypes(); TreeSet sortedTypes = new TreeSet( new StringComparator() ); sortedTypes.addAll( types ); for( Iterator tIt = sortedTypes.iterator(); tIt.hasNext(); ) { out.println( "T "+tIt.next() ); } } } } } class StringComparator implements Comparator {
protected void handleClass( PrintWriter out, SootClass c ) { for( Iterator mIt = c.methodIterator(); mIt.hasNext(); ) { final SootMethod m = (SootMethod) mIt.next(); if( !m.isConcrete() ) continue; Body b = m.retrieveActiveBody(); TreeSet sortedLocals = new TreeSet( new StringComparator() ); sortedLocals.addAll( b.getLocals() ); for( Iterator lIt = sortedLocals.iterator(); lIt.hasNext(); ) { final Local l = (Local) lIt.next(); out.println( "V "+m+l ); if( l.getType() instanceof RefLikeType ) { Set types = pa.reachingObjects( l ).possibleTypes(); TreeSet sortedTypes = new TreeSet( new StringComparator() ); sortedTypes.addAll( types ); for( Iterator tIt = sortedTypes.iterator(); tIt.hasNext(); ) { out.println( "T "+tIt.next() ); } } } } } class StringComparator implements Comparator {
final Local receiver = (Local) receiverIt.next(); final PointsToSet p2set = pa.reachingObjects( receiver ); for( Iterator typeIt = p2set.possibleTypes().iterator(); typeIt.hasNext(); ) { final Type type = (Type) typeIt.next(); ofcgb.addType( receiver, momc.context(), type, null );
final Local receiver = (Local) receiverIt.next(); final PointsToSet p2set = pa.reachingObjects( receiver ); for( Iterator typeIt = p2set.possibleTypes().iterator(); typeIt.hasNext(); ) { final Type type = (Type) typeIt.next(); ofcgb.addType( receiver, momc.context(), type, null );
.possibleTypes(); for (Type possibleType : possibleTypes) { RefType baseType;
for (Type tp : pts.possibleTypes()) { if (tp instanceof RefType) { RefType rt = (RefType) tp;