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

How to use
getFields
method
in
soot.SootClass

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

origin: Sable/soot

public static boolean hasRecursiveField(SootClass sootClass) {
 Chain fields = sootClass.getFields();
 for (Iterator iter = fields.iterator(); iter.hasNext();) {
  SootField sootField = (SootField) iter.next();
  Type type = sootField.getType();
  if (type instanceof RefType) {
   RefType refType = (RefType) type;
   SootClass sootClass2 = refType.getSootClass();
   if (sootClass == sootClass2) {
    return true;
   }
  }
 }
 return false;
}
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 ArrayList<SootField> findFinalFields() {
 // first thing is to get a list of all final fields in the class
 ArrayList<SootField> interestingFinalFields = new ArrayList<SootField>();
 Iterator fieldIt = sootClass.getFields().iterator();
 while (fieldIt.hasNext()) {
  SootField tempField = (SootField) fieldIt.next();
  if (tempField.isFinal()) {
   // if its static final and method is static add
   if (tempField.isStatic() && sootMethod.getName().compareTo("<clinit>") == 0) {
    interestingFinalFields.add(tempField);
   }
   // if its non static and final and method is constructor add
   if ((!tempField.isStatic()) && sootMethod.getName().compareTo("<init>") == 0) {
    interestingFinalFields.add(tempField);
   }
  }
 }
 return interestingFinalFields;
}
origin: Sable/soot

public static void retrieveAllNames() {
 if (namesHaveBeenRetrieved) {
  return;
 }
 // iterate through application classes, rename fields with junk
 for (SootClass c : soot.Scene.v().getApplicationClasses()) {
  nameList.add(c.getName());
  for (SootMethod m : c.getMethods()) {
   nameList.add(m.getName());
  }
  for (SootField m : c.getFields()) {
   nameList.add(m.getName());
  }
 }
 namesHaveBeenRetrieved = true;
}
origin: Sable/soot

private void handleClass(SootClass cl) {
 for (Iterator<SootField> fIt = cl.getFields().iterator(); fIt.hasNext();) {
  final SootField f = fIt.next();
  if (!f.isStatic()) {
origin: Sable/soot

private Iterator getScopedFields() {
 // get the fields for this class and store them
 SootClass sootClass = methodNode.getDavaBody().getMethod().getDeclaringClass();
 fields = sootClass.getFields();
 return fields.iterator();
}
origin: Sable/soot

Iterator<SootField> fieldIt = c.getFields().iterator();
while (fieldIt.hasNext()) {
 SootField field = fieldIt.next();
origin: Sable/soot

Iterator<SootField> fieldIt = this.getFields().iterator();
int fieldCount = 0;
origin: Sable/soot

SootClass appClass = (SootClass) getClassesIt.next();
Iterator getFieldsIt = appClass.getFields().iterator();
while (getFieldsIt.hasNext()) {
 SootField field = (SootField) getFieldsIt.next();
origin: Sable/soot

while (classesIt.hasNext()) {
 SootClass appClass = (SootClass) classesIt.next();
 Iterator fieldsIt = appClass.getFields().iterator();
 while (fieldsIt.hasNext()) {
  SootField sf = (SootField) fieldsIt.next();
origin: Sable/soot

SootClass tempClass = (SootClass) it.next();
Chain tempChain = tempClass.getFields();
Iterator tempIt = tempChain.iterator();
while (tempIt.hasNext()) {
origin: Sable/soot

for (SootField sf : sc.getFields()) {
 if (minVersion >= Options.java_version_1_5) {
  break;
origin: Sable/soot

/**
 * Collect tags from all fields and methods of <code>sc</code>. If <code>includeBodies</code> is true, then tags are also
 * collected from method bodies.
 *
 * @param sc
 *          The class from which to collect the tags.
 */
public void collectTags(SootClass sc, boolean includeBodies) {
 // tag the class
 collectClassTags(sc);
 // tag fields
 for (SootField sf : sc.getFields()) {
  collectFieldTags(sf);
 }
 // tag methods
 for (SootMethod sm : sc.getMethods()) {
  collectMethodTags(sm);
  if (!includeBodies || !sm.hasActiveBody()) {
   continue;
  }
  Body b = sm.getActiveBody();
  collectBodyTags(b);
 }
}
origin: Sable/soot

if (!baseClasses.contains(RefType.v("java.lang.Exception").getSootClass())) {
 for (SootClass baseClass : baseClasses) {
  for (Iterator baseFieldIt = baseClass.getFields().iterator(); baseFieldIt.hasNext();) {
   SootField baseField = (SootField) baseFieldIt.next();
   if (!baseField.isStatic()) {
origin: Sable/soot

protected void bringToSignaturesUnchecked(SootClass sc) {
 for (SootField f : sc.getFields()) {
  addToResolveWorklist(f.getType(), SootClass.HIERARCHY);
 }
 for (SootMethod m : sc.getMethods()) {
  addToResolveWorklist(m.getReturnType(), SootClass.HIERARCHY);
  for (Type ptype : m.getParameterTypes()) {
   addToResolveWorklist(ptype, SootClass.HIERARCHY);
  }
  List<SootClass> exceptions = m.getExceptionsUnsafe();
  if (exceptions != null) {
   for (SootClass exception : exceptions) {
    addToResolveWorklist(exception, SootClass.HIERARCHY);
   }
  }
 }
 // Bring superclasses to signatures
 reResolveHierarchy(sc, SootClass.SIGNATURES);
}
origin: Sable/soot

 m.setPhantom(true);
for (SootField f : sc.getFields()) {
 f.setPhantom(true);
origin: Sable/soot

if (!c.getFields().isEmpty()) {
 fields = new ArrayList<Field>();
 for (SootField f : c.getFields()) {
origin: Sable/soot

for (SootField sf : sm.getDeclaringClass().getFields()) {
 EquivalentValue fieldRefEqVal = InfoFlowAnalysis.getNodeForFieldRef(sm, sf);
 if (!infoFlowGraph.containsNode(fieldRefEqVal)) {
 for (SootField scField : superclass.getFields()) {
  EquivalentValue fieldRefEqVal = InfoFlowAnalysis.getNodeForFieldRef(sm, scField);
  if (!infoFlowGraph.containsNode(fieldRefEqVal)) {
origin: Sable/soot

/**
 * Emits the bytecode for all fields of the class
 */
protected void generateFields() {
 for (SootField f : sc.getFields()) {
  if (f.isPhantom()) {
   continue;
  }
  String name = f.getName();
  String desc = toTypeDesc(f.getType());
  String sig = null;
  if (f.hasTag("SignatureTag")) {
   SignatureTag genericSignature = (SignatureTag) f.getTag("SignatureTag");
   sig = genericSignature.getSignature();
  }
  Object value = getDefaultValue(f);
  int access = getModifiers(f.getModifiers(), f);
  FieldVisitor fv = cv.visitField(access, name, desc, sig, value);
  if (fv != null) {
   generateAnnotations(fv, f);
   generateAttributes(fv, f);
   fv.visitEnd();
  }
 }
}
origin: Sable/soot

throw new RuntimeException(
  "Trying to get field val$" + li.name() + " from some outer class but can't access the outer class of: "
    + currentClass.getName() + "!" + " current class contains fields: " + currentClass.getFields());
sootSootClassgetFields

Javadoc

Returns a backed Chain of fields.

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.
  • 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
  • hasSuperclass
    WARNING: interfaces are subclasses of the java.lang.Object class! Does this class have a superclass?
  • 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