Package soot.jbco.jimpleTransformations
Class FieldRenamer
- java.lang.Object
-
- soot.Transformer
-
- soot.SceneTransformer
-
- soot.jbco.jimpleTransformations.FieldRenamer
-
- All Implemented Interfaces:
IJbcoTransform
public class FieldRenamer extends SceneTransformer implements IJbcoTransform
- Since:
- 26-Jan-2006
- Author:
- Michael Batchelder, Pavel Nesterovich
-
-
Field Summary
Fields Modifier and Type Field Description static int[]handedOutPairsstatic int[]handedOutRunPairsstatic Stringname-
Fields inherited from interface soot.jbco.IJbcoTransform
debug, out, output
-
-
Constructor Summary
Constructors Constructor Description FieldRenamer(Singletons.Global global)Singleton constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]getDependencies()Gets array ofjbco transformercode names on which current transformer depends on.StringgetName()Gets the code name ofjbco transformerimplementation.StringgetOrAddNewName(String originalName)Generates new unique name that have not existed before and mapping for it, or gets new name if one was already generated.SootField[]getRandomOpaques()intgetRandomOpaquesForRunnable()Set<String>getSkipFields()protected voidinternalTransform(String phaseName, Map<String,String> options)Performs the transformation on the Scene, under the given phaseName and with the given Options.booleanisRenameFields()voidoutputSummary()Prints summary of the produced changes.protected voidrenameField(SootClass sootClass, SootField field)protected voidsetBooleanTo(SootClass sootClass, SootField field, boolean value)voidsetRenameFields(boolean renameFields)voidsetSkipFields(Collection<String> fields)static voidupdateOpaqueRunnableCount(int i)static FieldRenamerv()Singleton getter.-
Methods inherited from class soot.SceneTransformer
transform, transform, transform
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface soot.jbco.IJbcoTransform
isDebugEnabled, isVerbose
-
-
-
-
Field Detail
-
name
public static final String name
- See Also:
- Constant Field Values
-
handedOutPairs
public static int[] handedOutPairs
-
handedOutRunPairs
public static int[] handedOutRunPairs
-
-
Constructor Detail
-
FieldRenamer
public FieldRenamer(Singletons.Global global)
Singleton constructor.- Parameters:
global- the singletons container. Must not benull- Throws:
NullPointerException- whenglobalargument isnull
-
-
Method Detail
-
v
public static FieldRenamer v()
Singleton getter.- Returns:
- returns instance of
FieldRenamer
-
getName
public String getName()
Description copied from interface:IJbcoTransformGets the code name ofjbco transformerimplementation.- Specified by:
getNamein interfaceIJbcoTransform- Returns:
- the code name of
jbco transformer
-
getDependencies
public String[] getDependencies()
Description copied from interface:IJbcoTransformGets array ofjbco transformercode names on which current transformer depends on.- Specified by:
getDependenciesin interfaceIJbcoTransform- Returns:
- array of code names
-
outputSummary
public void outputSummary()
Description copied from interface:IJbcoTransformPrints summary of the produced changes.- Specified by:
outputSummaryin interfaceIJbcoTransform
-
isRenameFields
public boolean isRenameFields()
-
setRenameFields
public void setRenameFields(boolean renameFields)
-
setSkipFields
public void setSkipFields(Collection<String> fields)
-
internalTransform
protected void internalTransform(String phaseName, Map<String,String> options)
Description copied from class:SceneTransformerPerforms the transformation on the Scene, under the given phaseName and with the given Options.- Specified by:
internalTransformin classSceneTransformer
-
getOrAddNewName
public String getOrAddNewName(String originalName)
Generates new unique name that have not existed before and mapping for it, or gets new name if one was already generated.- Parameters:
originalName- the original field name. Ifnullthen will be the same as generated one- Returns:
- the new unique name
-
getRandomOpaques
public SootField[] getRandomOpaques()
-
getRandomOpaquesForRunnable
public int getRandomOpaquesForRunnable()
-
updateOpaqueRunnableCount
public static void updateOpaqueRunnableCount(int i)
-
-