Package com.tonic.analysis
Class ConstPoolRemapper
- java.lang.Object
-
- com.tonic.analysis.ConstPoolRemapper
-
public final class ConstPoolRemapper extends Object
-
-
Constructor Summary
Constructors Constructor Description ConstPoolRemapper(ClassFile source, ClassFile target)Creates a stateful remapper from the source class file's constant pool into the target's.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intremap(int srcIndex)Returns the index in the target pool of the constant equivalent tosrcIndexin the source pool, creating it (and any dependencies) if absent.
-
-
-
Constructor Detail
-
ConstPoolRemapper
public ConstPoolRemapper(ClassFile source, ClassFile target)
Creates a stateful remapper from the source class file's constant pool into the target's.- Parameters:
source- the class file whose pool indices are being translatedtarget- the class file whose pool receives the constants
-
-
Method Detail
-
remap
public int remap(int srcIndex)
Returns the index in the target pool of the constant equivalent tosrcIndexin the source pool, creating it (and any dependencies) if absent.- Parameters:
srcIndex- a constant-pool index in the source pool- Returns:
- the equivalent index in the target pool
-
-