/** * Changes the set of parameter types of this method. */ public synchronized void setParameterTypes(List<Type> l) { boolean wasDeclared = isDeclared; SootClass oldDeclaringClass = declaringClass; if (wasDeclared) { oldDeclaringClass.removeMethod(this); } this.parameterTypes = l.toArray(new Type[l.size()]); subSig = null; sig = null; subsignature = Scene.v().getSubSigNumberer().findOrAdd(getSubSignature()); if (wasDeclared) { oldDeclaringClass.addMethod(this); } }
/** Sets the return type of this method. */ public synchronized void setReturnType(Type t) { boolean wasDeclared = isDeclared; SootClass oldDeclaringClass = declaringClass; if (wasDeclared) { oldDeclaringClass.removeMethod(this); } returnType = t; subSig = null; sig = null; subsignature = Scene.v().getSubSigNumberer().findOrAdd(getSubSignature()); if (wasDeclared) { oldDeclaringClass.addMethod(this); } }
/** Sets the name of this method. */ public synchronized void setName(String name) { boolean wasDeclared = isDeclared; SootClass oldDeclaringClass = declaringClass; if (wasDeclared) { oldDeclaringClass.removeMethod(this); } this.name = name; subSig = null; sig = null; subsignature = Scene.v().getSubSigNumberer().findOrAdd(getSubSignature()); if (wasDeclared) { oldDeclaringClass.addMethod(this); } }
s.removeMethod(constructor);
/** * Changes the set of parameter types of this method. */ public void setParameterTypes( List l ) { boolean wasDeclared = isDeclared; SootClass oldDeclaringClass = declaringClass; if( wasDeclared ) oldDeclaringClass.removeMethod(this); List al = new ArrayList(); al.addAll(l); this.parameterTypes = Collections.unmodifiableList(al); subsignature = Scene.v().getSubSigNumberer().findOrAdd(getSubSignature()); if( wasDeclared) oldDeclaringClass.addMethod(this); }
/** * Changes the set of parameter types of this method. */ public void setParameterTypes( List l ) { boolean wasDeclared = isDeclared; SootClass oldDeclaringClass = declaringClass; if( wasDeclared ) oldDeclaringClass.removeMethod(this); List al = new ArrayList(); al.addAll(l); this.parameterTypes = Collections.unmodifiableList(al); subsignature = Scene.v().getSubSigNumberer().findOrAdd(getSubSignature()); if( wasDeclared) oldDeclaringClass.addMethod(this); }
/** * Removes all units that have previously been created by the instrumenter */ public void undoInstrumentation() { // Remove the redirection methods for (SootMethod sm : source2RedirectMethod.values()) sm.getDeclaringClass().removeMethod(sm); for (Body body : instrumentedUnits.keySet()) { for (Unit u : instrumentedUnits.get(body)) { body.getUnits().remove(u); } } instrumentedUnits.clear(); source2RedirectMethod.clear(); }
/** Sets the name of this method. */ public void setName(String name) { boolean wasDeclared = isDeclared; SootClass oldDeclaringClass = declaringClass; if( wasDeclared ) oldDeclaringClass.removeMethod(this); this.name = name; subsignature = Scene.v().getSubSigNumberer().findOrAdd(getSubSignature()); if( wasDeclared) oldDeclaringClass.addMethod(this); }
/** Sets the return type of this method. */ public void setReturnType(Type t) { boolean wasDeclared = isDeclared; SootClass oldDeclaringClass = declaringClass; if( wasDeclared ) oldDeclaringClass.removeMethod(this); returnType = t; subsignature = Scene.v().getSubSigNumberer().findOrAdd(getSubSignature()); if( wasDeclared) oldDeclaringClass.addMethod(this); }
/** Sets the return type of this method. */ public void setReturnType(Type t) { boolean wasDeclared = isDeclared; SootClass oldDeclaringClass = declaringClass; if( wasDeclared ) oldDeclaringClass.removeMethod(this); returnType = t; subsignature = Scene.v().getSubSigNumberer().findOrAdd(getSubSignature()); if( wasDeclared) oldDeclaringClass.addMethod(this); }
/** * Removes all methods that have been generated by this entry point creator * * @param removeClass True if the generated class shall also be removed. False * to only remove the methods, but keep the class */ public void removeGeneratedMethods(boolean removeClass) { // Remove the dummy main method itself final SootClass mainClass = mainMethod.getDeclaringClass(); if (removeClass) Scene.v().removeClass(mainClass); else mainClass.removeMethod(mainMethod); // Remove the additional methods for (SootMethod sm : getAdditionalMethods()) { if (sm.isDeclared()) { final SootClass declaringClass = sm.getDeclaringClass(); if (declaringClass.isInScene()) declaringClass.removeMethod(sm); } } }
/** Sets the name of this method. */ public void setName(String name) { boolean wasDeclared = isDeclared; SootClass oldDeclaringClass = declaringClass; if( wasDeclared ) oldDeclaringClass.removeMethod(this); this.name = name; subsignature = Scene.v().getSubSigNumberer().findOrAdd(getSubSignature()); if( wasDeclared) oldDeclaringClass.addMethod(this); }
@Override public void reset() { super.reset(); // Get rid of the generated component methods for (SootMethod sm : getAdditionalMethods()) { if (sm.isDeclared()) sm.getDeclaringClass().removeMethod(sm); } for (SootField sf : getAdditionalFields()) { if (sf.isDeclared()) sf.getDeclaringClass().removeField(sf); } // Get rid of the generated fields for (SootField fld : callbackClassToField.values()) { if (fld.isDeclared()) fld.getDeclaringClass().removeField(fld); } componentToInfo.clear(); callbackClassToField.clear(); }
mainClass.removeMethod(mainMethod); mainMethod = null;
mainClass.removeMethod(mainMethod); mainMethod = null;