Tabnine Logo
SootClass.hasSuperclass
Code IndexAdd Tabnine to your IDE (free)

How to use
hasSuperclass
method
in
soot.SootClass

Best Java code snippets using soot.SootClass.hasSuperclass (Showing top 20 results out of 315)

origin: Sable/soot

private boolean isCallClassSubClass(SootClass call, SootClass check) {
 if (!call.hasSuperclass()) {
  return false;
 }
 if (call.getSuperclass().equals(check)) {
  return true;
 }
 return false;
}
origin: Sable/soot

private boolean hasNoHierarchy(RefType type) {
 final SootClass sootClass = type.getSootClass();
 return !(sootClass.hasSuperclass() || JAVA_LANG_OBJECT_CLASS == sootClass);
}
origin: Sable/soot

private boolean catches_Exception(IterableSet tryExceptionSet, SootClass c) {
 Iterator it = tryExceptionSet.iterator();
 while (it.hasNext()) {
  SootClass thrownException = (SootClass) it.next();
  while (true) {
   if (thrownException == c) {
    return true;
   }
   if (thrownException.hasSuperclass() == false) {
    break;
   }
   thrownException = thrownException.getSuperclass();
  }
 }
 return false;
}
origin: Sable/soot

private boolean handled_Exception(HashSet handledExceptions, SootClass c) {
 SootClass thrownException = c;
 if (is_HandledByRuntime(thrownException)) {
  return true;
 }
 if (handledExceptions == null) {
  return false;
 }
 while (true) {
  if (handledExceptions.contains(thrownException)) {
   return true;
  }
  if (thrownException.hasSuperclass() == false) {
   return false;
  }
  thrownException = thrownException.getSuperclass();
 }
}
origin: Sable/soot

public static List<SootField> getAllFields(SootClass sc) {
 // Get list of reachable methods declared in this class
 // Also get list of fields declared in this class
 List<SootField> allFields = new ArrayList<SootField>();
 for (SootField field : sc.getFields()) {
  allFields.add(field);
 }
 // Add reachable methods and fields declared in superclasses
 SootClass superclass = sc;
 if (superclass.hasSuperclass()) {
  superclass = superclass.getSuperclass();
 }
 while (superclass.hasSuperclass()) // we don't want to process Object
 {
  for (SootField scField : superclass.getFields()) {
   allFields.add(scField);
  }
  superclass = superclass.getSuperclass();
 }
 return allFields;
}
origin: Sable/soot

public static List<SootMethod> getAllReachableMethods(SootClass sc) {
 ReachableMethods rm = Scene.v().getReachableMethods();
 // Get list of reachable methods declared in this class
 List<SootMethod> allMethods = new ArrayList<SootMethod>();
 Iterator methodsIt = sc.methodIterator();
 while (methodsIt.hasNext()) {
  SootMethod method = (SootMethod) methodsIt.next();
  if (rm.contains(method)) {
   allMethods.add(method);
  }
 }
 // Add reachable methods declared in superclasses
 SootClass superclass = sc;
 if (superclass.hasSuperclass()) {
  superclass = superclass.getSuperclass();
 }
 while (superclass.hasSuperclass()) // we don't want to process Object
 {
  Iterator scMethodsIt = superclass.methodIterator();
  while (scMethodsIt.hasNext()) {
   SootMethod scMethod = (SootMethod) scMethodsIt.next();
   if (rm.contains(scMethod)) {
    allMethods.add(scMethod);
   }
  }
  superclass = superclass.getSuperclass();
 }
 return allMethods;
}
origin: Sable/soot

private static Deque<RefType> superclassPath(RefType t, RefType anchor) {
 Deque<RefType> r = new ArrayDeque<RefType>();
 r.addFirst(t);
 if (TypeResolver.typesEqual(t, anchor)) {
  return r;
 }
 SootClass sc = t.getSootClass();
 while (sc.hasSuperclass()) {
  sc = sc.getSuperclass();
  RefType cur = sc.getType();
  r.addFirst(cur);
  if (TypeResolver.typesEqual(cur, anchor)) {
   break;
  }
 }
 if (!TypeResolver.typesEqual(r.getFirst(), anchor)) {
  r.addFirst(anchor);
 }
 return r;
}
origin: Sable/soot

if (superclass.hasSuperclass()) {
 superclass = sootClass.getSuperclass();
while (superclass.hasSuperclass()) // we don't want to process Object
origin: Sable/soot

/**
 * Returns a list of <strong>direct</strong> superclasses of passed class in reverse order, starting with its parent.
 *
 * @param sootClass
 *          the <strong>class</strong> of which superclasses will be taken. Must not be {@code null} or interface
 * @return list of superclasses
 * @throws IllegalArgumentException
 *           when passed class is an interface
 * @throws NullPointerException
 *           when passed argument is {@code null}
 */
public List<SootClass> getSuperclassesOf(SootClass sootClass) {
 sootClass.checkLevel(SootClass.HIERARCHY);
 if (sootClass.isInterface()) {
  throw new IllegalArgumentException(sootClass.getName() + " is an interface, but class is expected");
 }
 checkState();
 final List<SootClass> superclasses = new ArrayList<>();
 SootClass current = sootClass;
 while (current.hasSuperclass()) {
  superclasses.add(current.getSuperclass());
  current = current.getSuperclass();
 }
 return Collections.unmodifiableList(superclasses);
}
origin: Sable/soot

if (superclass.hasSuperclass()) {
 superclass = superclass.getSuperclass();
while (superclass.hasSuperclass()) {
 if (superclass.isApplicationClass()) {
  externalMethods.addAll(uf.getExtMethods(superclass));
if (superclass.hasSuperclass()) {
 superclass = superclass.getSuperclass();
while (superclass.hasSuperclass()) {
 if (superclass.isApplicationClass()) {
  externalFields.addAll(uf.getExtFields(superclass));
origin: Sable/soot

 private boolean isRewritable(Trap t) {
  // ignore traps that already catch their own begin unit
  if (t.getBeginUnit() == t.getHandlerUnit()) {
   return false;
  }

  // ignore runtime try blocks - these may have weird side-effects do to asynchronous exceptions
  SootClass exc = t.getException();
  if (exc.getName().equals("java.lang.Throwable")) {
   return false;
  }

  do {
   if (exc.getName().equals("java.lang.RuntimeException")) {
    return false;
   }
  } while (exc.hasSuperclass() && (exc = exc.getSuperclass()) != null);

  return true;
 }
}
origin: Sable/soot

private Set<SootClass> getParentsOfIncluding(Collection<SootClass> classes) {
 final Set<SootClass> parents = new HashSet<>(classes);
 for (SootClass clazz : classes) {
  // add implementing interfaces
  parents.addAll(clazz.getInterfaces());
  // add extending class if any
  if (!clazz.isInterface() && clazz.hasSuperclass()) {
   parents.add(clazz.getSuperclass());
  }
  // and superclasses (superinterfaces) of passed applicationClass
  parents.addAll(clazz.isInterface() ? Scene.v().getActiveHierarchy().getSuperinterfacesOfIncluding(clazz)
    : Scene.v().getActiveHierarchy().getSuperclassesOfIncluding(clazz));
 }
 return parents;
}
origin: Sable/soot

 private boolean is_HandledByRuntime(SootClass c) {
  SootClass thrownException = c, runtimeException = Scene.v().getSootClass("java.lang.RuntimeException"),
    error = Scene.v().getSootClass("java.lang.Error");

  while (true) {
   if ((thrownException == runtimeException) || (thrownException == error)) {
    return true;
   }

   if (thrownException.hasSuperclass() == false) {
    return false;
   }

   thrownException = thrownException.getSuperclass();
  }
 }
}
origin: Sable/soot

private List<SootClass> getParentsOfIncluding(SootClass applicationClass) {
 // result contains of interfaces that implements passed applicationClass
 final List<SootClass> result = HierarchyUtils.getAllInterfacesOf(applicationClass);
 // add implementing interfaces
 result.addAll(applicationClass.getInterfaces());
 // add extending class if any
 if (!applicationClass.isInterface() && applicationClass.hasSuperclass()) {
  result.add(applicationClass.getSuperclass());
 }
 // and superclasses (superinterfaces) of passed applicationClass
 result.addAll(
   applicationClass.isInterface() ? Scene.v().getActiveHierarchy().getSuperinterfacesOfIncluding(applicationClass)
     : Scene.v().getActiveHierarchy().getSuperclassesOfIncluding(applicationClass));
 return result;
}
origin: Sable/soot

 private boolean catches_RuntimeException(SootClass c) {
  if ((c == Scene.v().getSootClass("java.lang.Throwable")) || (c == Scene.v().getSootClass("java.lang.Exception"))) {
   return true;
  }

  SootClass caughtException = c, runtimeException = Scene.v().getSootClass("java.lang.RuntimeException");

  while (true) {
   if (caughtException == runtimeException) {
    return true;
   }

   if (caughtException.hasSuperclass() == false) {
    return false;
   }

   caughtException = caughtException.getSuperclass();
  }
 }
}
origin: Sable/soot

 return;
if (currClass.hasSuperclass() && !currClass.getSuperclass().isPhantom()
  && !currClass.getSuperclass().getName().equals("java.lang.Object")) {
 currClass = currClass.getSuperclass();
origin: Sable/soot

if (superclass.hasSuperclass()) {
 superclass = sm.getDeclaringClass().getSuperclass();
while (superclass.hasSuperclass()) // we don't want to process Object
origin: Sable/soot

String superClass = c.hasSuperclass() ? SootToDexUtils.getDexTypeDescriptor(c.getSuperclass().getType()) : null;
origin: Sable/soot

outer: do {
 while (!c.getName().equals("java.lang.ClassLoader")) {
  if (!c.hasSuperclass()) {
   break outer;
origin: Sable/soot

} else {
 while (curClass.hasSuperclass()) {
  curClass = curClass.getSuperclass();
  if (type instanceof RefType && curClass.isPhantom()) {
sootSootClasshasSuperclass

Javadoc

WARNING: interfaces are subclasses of the java.lang.Object class! Does this class have a superclass? False implies that this is the java.lang.Object class. Note that interfaces are subclasses of the java.lang.Object class.

Popular methods of SootClass

  • isInterface
    Convenience method; returns true if this class is an interface.
  • getMethods
  • getName
    Returns the name of this class.
  • setApplicationClass
    Makes this class an application class.
  • getFields
    Returns a backed Chain of fields.
  • getInterfaces
    Returns a backed Chain of the interfaces that are directly implemented by this class. (see getInterf
  • getSuperclass
    WARNING: interfaces are subclasses of the java.lang.Object class! Returns the superclass of this cla
  • resolvingLevel
  • addMethod
    Adds the given method to this class.
  • declaresMethod
    Does this class declare a method with the given subsignature?
  • getMethod
  • getType
    Returns the RefType corresponding to this class.
  • getMethod,
  • getType,
  • isApplicationClass,
  • isLibraryClass,
  • addField,
  • isAbstract,
  • isPhantom,
  • <init>,
  • declaresField

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onRequestPermissionsResult (Fragment)
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Notification (javax.management)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Table (org.hibernate.mapping)
    A relational table
  • Option (scala)
  • Top PhpStorm plugins
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