Tabnine Logo
FastHierarchy.getAllImplementersOfInterface
Code IndexAdd Tabnine 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)

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

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • onCreateOptionsMenu (Activity)
  • getContentResolver (Context)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • IsNull (org.hamcrest.core)
    Is the value null?
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now