Codota Logo
FastHierarchy.getAllImplementersOfInterface
Code IndexAdd Codota to your IDE (free)

How to use
getAllImplementersOfInterface
method
in
soot.FastHierarchy

Best Java code snippets using soot.FastHierarchy.getAllImplementersOfInterface (Showing top 17 results out of 315)

  • Common ways to obtain FastHierarchy
private void myMethod () {
FastHierarchy f =
  • Codota IconScene.v().getOrMakeFastHierarchy()
  • Codota IconScene.v().getFastHierarchy()
  • Codota Iconnew FastHierarchy()
  • Smart code suggestions by Codota
}
origin: Sable/soot

private Set<Type> resolveToClasses(Set<Type> rawTypes) {
 Set<Type> toReturn = new HashSet<Type>();
 for (Type ty : rawTypes) {
  if (ty instanceof AnySubType) {
   AnySubType anySubType = (AnySubType) ty;
   RefType base = anySubType.getBase();
   Set<SootClass> classRoots;
   if (base.getSootClass().isInterface()) {
    classRoots = fh.getAllImplementersOfInterface(base.getSootClass());
   } else {
    classRoots = Collections.singleton(base.getSootClass());
   }
   toReturn.addAll(getTransitiveSubClasses(classRoots));
  } else if (ty instanceof ArrayType || ty instanceof RefType) {
   toReturn.add(ty);
  }
 }
 return toReturn;
}
origin: Sable/soot

/**
 * For an interface parent (MUST be an interface), returns set of all implementers of it but NOT their subclasses.
 * 
 * This method can be used concurrently (is thread safe).
 * 
 * @param parent
 *          the parent interface.
 * @return an set, possibly empty
 */
public Set<SootClass> getAllImplementersOfInterface(SootClass parent) {
 parent.checkLevel(SootClass.HIERARCHY);
 Set<SootClass> result = interfaceToAllImplementers.get(parent);
 if (result.size() > 0) {
  return result;
 }
 result = new HashSet<>();
 for (SootClass subinterface : getAllSubinterfaces(parent)) {
  if (subinterface == parent) {
   continue;
  }
  result.addAll(getAllImplementersOfInterface(subinterface));
 }
 result.addAll(interfaceToImplementers.get(parent));
 interfaceToAllImplementers.putAll(parent, result);
 return result;
}
origin: Sable/soot

cl = worklist.removeFirst();
if (cl.isInterface()) {
 for (Iterator<SootClass> cIt = fh.getAllImplementersOfInterface(cl).iterator(); cIt.hasNext();) {
  final SootClass c = cIt.next();
  if (workset.add(c)) {
origin: Sable/soot

final Set<SootClass> impl = getAllImplementersOfInterface(parent);
if (impl.size() > 1000) {
origin: Sable/soot

worklist.addAll(getAllImplementersOfInterface(concreteType));
continue;
origin: Sable/soot

Deque<SootClass> worklist = new ArrayDeque<SootClass>();
if (base.isInterface()) {
 worklist.addAll(getAllImplementersOfInterface(base));
} else {
 worklist.add(base);
origin: Sable/soot

final private BitVector makeMaskOfInterface(SootClass interf) {
 if (!(interf.isInterface())) {
  throw new RuntimeException();
 }
 BitVector ret = new BitVector(pag.getAllocNodeNumberer().size());
 typeMask.put(interf.getType(), ret);
 Collection<SootClass> implementers = getFastHierarchy().getAllImplementersOfInterface(interf);
 for (SootClass impl : implementers) {
  BitVector other = typeMask.get(impl.getType());
  if (other == null) {
   other = makeClassTypeMask(impl);
  }
  ret.or(other);
 }
 // I think, the following can be eliminated. It is added to make
 // type-masks exactly the same as the original type-masks
 if (implementers.size() == 0) {
  for (AllocNode an : anySubtypeAllocs) {
   ret.set(an.getNumber());
  }
 }
 return ret;
}
origin: ibinti/bugvm

/** Given an object of declared type child, returns true if the object
 * can be stored in a variable of type parent. If child is an interface
 * that is not a subinterface of parent, this method will return false
 * even though some objects implementing the child interface may also
 * implement the parent interface. */
protected boolean canStoreClass( SootClass child, SootClass parent ) {
  parent.checkLevel(SootClass.HIERARCHY);
  child.checkLevel(SootClass.HIERARCHY);
  Interval parentInterval = classToInterval.get( parent );
  Interval childInterval = classToInterval.get( child );
  if( parentInterval != null && childInterval != null ) {
    return parentInterval.isSubrange( childInterval );
  }
  if( childInterval == null ) { // child is interface
    if( parentInterval != null ) { // parent is not interface
      return parent.equals( RefType.v("java.lang.Object").getSootClass() );
    } else {
      return getAllSubinterfaces( parent ).contains( child );
    }
  } else {
    Set impl = getAllImplementersOfInterface( parent );
    for( Iterator it = impl.iterator(); it.hasNext(); ) {
      parentInterval = classToInterval.get( it.next() );
      if( parentInterval != null && parentInterval.isSubrange( childInterval ) ) {
        return true;
      }
    }
    return false;
  }
}
origin: com.bugvm/bugvm-soot

/** Given an object of declared type child, returns true if the object
 * can be stored in a variable of type parent. If child is an interface
 * that is not a subinterface of parent, this method will return false
 * even though some objects implementing the child interface may also
 * implement the parent interface. */
protected boolean canStoreClass( SootClass child, SootClass parent ) {
  parent.checkLevel(SootClass.HIERARCHY);
  child.checkLevel(SootClass.HIERARCHY);
  Interval parentInterval = classToInterval.get( parent );
  Interval childInterval = classToInterval.get( child );
  if( parentInterval != null && childInterval != null ) {
    return parentInterval.isSubrange( childInterval );
  }
  if( childInterval == null ) { // child is interface
    if( parentInterval != null ) { // parent is not interface
      return parent.equals( RefType.v("java.lang.Object").getSootClass() );
    } else {
      return getAllSubinterfaces( parent ).contains( child );
    }
  } else {
    Set impl = getAllImplementersOfInterface( parent );
    for( Iterator it = impl.iterator(); it.hasNext(); ) {
      parentInterval = classToInterval.get( it.next() );
      if( parentInterval != null && parentInterval.isSubrange( childInterval ) ) {
        return true;
      }
    }
    return false;
  }
}
origin: ibinti/bugvm

SootClass savedConcreteType = concreteType;
if( concreteType.isInterface() ) {
  worklist.addAll( getAllImplementersOfInterface( concreteType ) );
  continue;
origin: com.bugvm/bugvm-soot

SootClass savedConcreteType = concreteType;
if( concreteType.isInterface() ) {
  worklist.addAll( getAllImplementersOfInterface( concreteType ) );
  continue;
origin: ibinti/bugvm

/** For an interface parent (MUST be an interface), returns set of all
 * implementers of it but NOT their subclasses. */
public Set getAllImplementersOfInterface( SootClass parent ) {
  parent.checkLevel(SootClass.HIERARCHY);
  if( !interfaceToAllImplementers.containsKey( parent ) ) {
    for( Iterator subinterfaceIt = getAllSubinterfaces( parent ).iterator(); subinterfaceIt.hasNext(); ) {
      final SootClass subinterface = (SootClass) subinterfaceIt.next();
      if( subinterface == parent ) continue;
      interfaceToAllImplementers.putAll(parent,
        getAllImplementersOfInterface( subinterface ) );
    }
    interfaceToAllImplementers.putAll(parent, 
        interfaceToImplementers.get( parent ) );
  }
  return interfaceToAllImplementers.get( parent );
}
origin: com.bugvm/bugvm-soot

/** For an interface parent (MUST be an interface), returns set of all
 * implementers of it but NOT their subclasses. */
public Set getAllImplementersOfInterface( SootClass parent ) {
  parent.checkLevel(SootClass.HIERARCHY);
  if( !interfaceToAllImplementers.containsKey( parent ) ) {
    for( Iterator subinterfaceIt = getAllSubinterfaces( parent ).iterator(); subinterfaceIt.hasNext(); ) {
      final SootClass subinterface = (SootClass) subinterfaceIt.next();
      if( subinterface == parent ) continue;
      interfaceToAllImplementers.putAll(parent,
        getAllImplementersOfInterface( subinterface ) );
    }
    interfaceToAllImplementers.putAll(parent, 
        interfaceToImplementers.get( parent ) );
  }
  return interfaceToAllImplementers.get( parent );
}
origin: ibinti/bugvm

cl = worklist.removeFirst();
if( cl.isInterface() ) {
  for( Iterator cIt = fh.getAllImplementersOfInterface(cl).iterator(); cIt.hasNext(); ) {
    final SootClass c = (SootClass) cIt.next();
    if( workset.add( c ) ) worklist.add( c );
origin: com.bugvm/bugvm-soot

cl = worklist.removeFirst();
if( cl.isInterface() ) {
  for( Iterator cIt = fh.getAllImplementersOfInterface(cl).iterator(); cIt.hasNext(); ) {
    final SootClass c = (SootClass) cIt.next();
    if( workset.add( c ) ) worklist.add( c );
origin: ibinti/bugvm

SootClass parentClass = ((RefType) parent).getSootClass();
LinkedList worklist = new LinkedList();
if( base.isInterface() ) worklist.addAll(getAllImplementersOfInterface(base));
else worklist.add(base);
Set<SootClass> workset = new HashSet<SootClass>();
origin: com.bugvm/bugvm-soot

SootClass parentClass = ((RefType) parent).getSootClass();
LinkedList worklist = new LinkedList();
if( base.isInterface() ) worklist.addAll(getAllImplementersOfInterface(base));
else worklist.add(base);
Set<SootClass> workset = new HashSet<SootClass>();
sootFastHierarchygetAllImplementersOfInterface

Javadoc

For an interface parent (MUST be an interface), returns set of all implementers of it but NOT their subclasses.

Popular methods of FastHierarchy

  • canStoreType
    Given an object of declared type child, returns true if the object can be stored in a variable of ty
  • isSubclass
    Return true if class child is a subclass of class parent, neither of them being allowed to be interf
  • <init>
    Constructs a hierarchy from the current scene.
  • canStoreClass
    Given an object of declared type child, returns true if the object can be stored in a variable of ty
  • dfsVisit
  • getAllSubinterfaces
    For an interface parent (MUST be an interface), returns set of all subinterfaces.
  • getSubclassesOf
  • isVisible
    Returns true if the method m is visible from code in the class from.
  • resolveConcreteDispatch
    Given an object of actual type C (o = new C()), returns the method which will be called on an o.f()
  • put
  • canStoreClassClassic
    "Classic" implementation using the intuitive approach (without using Interval) to check whetherchild
  • resolveAbstractDispatch
    Given an object of declared type C, returns the methods which could be called on an o.f() invocation
  • canStoreClassClassic,
  • resolveAbstractDispatch

Popular in Java

  • Finding current android device location
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (Timer)
  • startActivity (Activity)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JList (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now