class FieldTagger extends BodyTransformer {
  public FieldTagger(Singletons.Global g) {
  }

  public static FieldTagger v() {
    return G.v().soot_jimple_spark_fieldrw_FieldTagger();
  }

  private final HashSet<SootMethod> processedMethods = new HashSet<SootMethod>();
  private final HashMultiMap methodToWrite = new HashMultiMap();
  private final HashMultiMap methodToRead = new HashMultiMap();

  protected void ensureProcessed(SootMethod m) {
    if (processedMethods.contains(m)) {
      return;
    }
    processedMethods.add(m);
    if (!m.isConcrete() || m.isPhantom()) {
      return;
    }
    for (Iterator sIt = m.retrieveActiveBody().getUnits().iterator(); sIt.hasNext();) {
      final Stmt s = (Stmt) sIt.next();
      if (s instanceof AssignStmt) {
        AssignStmt as = (AssignStmt) s;
        Value l = as.getLeftOp();
        if (l instanceof FieldRef) {
          methodToWrite.put(m, ((FieldRef) l).getField());
        }
        Value r = as.getRightOp();
        if (r instanceof FieldRef) {
          methodToRead.put(m, ((FieldRef) r).getField());
        }
      }
    }
  }

  protected void internalTransform(Body body, String phaseName, Map options) {<FILL_FUNCTION_BODY>}
}

    int threshold = PhaseOptions.getInt(options, "threshold");

    ensureProcessed(body.getMethod());

    CallGraph cg = Scene.v().getCallGraph();
    TransitiveTargets tt = new TransitiveTargets(cg);
    statement: for (Iterator sIt = body.getUnits().iterator(); sIt.hasNext();) {
      final Stmt s = (Stmt) sIt.next();
      HashSet read = new HashSet();
      HashSet write = new HashSet();
      Iterator<MethodOrMethodContext> it = tt.iterator(s);
      while (it.hasNext()) {
        SootMethod target = (SootMethod) it.next();
        ensureProcessed(target);
        if (target.isNative() || target.isPhantom()) {
          continue statement;
        }
        read.addAll(methodToRead.get(target));
        write.addAll(methodToWrite.get(target));
        if (read.size() + write.size() > threshold) {
          continue statement;
        }
      }
      s.addTag(new FieldReadTag(read));
      s.addTag(new FieldWriteTag(write));
    }
  
<methods>public non-sealed void <init>() ,public final void transform(soot.Body, java.lang.String, Map<java.lang.String,java.lang.String>) ,public final void transform(soot.Body, java.lang.String) ,public final void transform(soot.Body) <variables>private static final Map<java.lang.String,java.lang.String> enabledOnlyMap