Last active
May 14, 2018 11:19
-
-
Save ujjkumsi/bd1d190cade59151ef33d37b0e1fa498 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Invoker implements InvokerIfc { | |
public Object doit(Integer b) { | |
return fake(new Something()).target(b); | |
} | |
} | |
public static Class rewrite(Class old)throws IOException,InvalidConstantPoolFormatException{ | |
HashMap constPatchMap=new HashMap(); | |
constPatchMap.put("fake","real"); | |
ConstantPoolPatch patch=new ConstantPoolPatch(Invoker.class); | |
patch.putPatches(constPatchMap,null,null,true); | |
return new AnonymousClassLoader(Invoker.class).loadClass(patch); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment