diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2012-10-06 14:47:31 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2012-10-06 14:47:31 +0000 |
commit | 3ab8b841312f792dc64016800193cb1b0368a9f9 (patch) | |
tree | 981c95a6f1657ea8289be88ef2cc7cc7877fa916 /src/test/test4/InvokeDyn.java | |
parent | effbfdc89cd7cb85127319b5951871dbefec5ea3 (diff) | |
download | javassist-3ab8b841312f792dc64016800193cb1b0368a9f9.tar.gz javassist-3ab8b841312f792dc64016800193cb1b0368a9f9.zip |
fixed JASSIST-160
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@672 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/test/test4/InvokeDyn.java')
-rw-r--r-- | src/test/test4/InvokeDyn.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/test/test4/InvokeDyn.java b/src/test/test4/InvokeDyn.java index 5e5f0c01..fbcba64d 100644 --- a/src/test/test4/InvokeDyn.java +++ b/src/test/test4/InvokeDyn.java @@ -4,11 +4,23 @@ import java.lang.invoke.*; public class InvokeDyn { public static int test9(int i, String s) { return 9; } + public int test8(int i, String s) { return 8; } - public static CallSite boot(MethodHandles.Lookup caller, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { + public static CallSite boot(MethodHandles.Lookup caller, String name, MethodType type) + throws NoSuchMethodException, IllegalAccessException + { MethodHandles.Lookup lookup = MethodHandles.lookup(); Class thisClass = lookup.lookupClass(); MethodHandle method = lookup.findStatic(thisClass, "test9", MethodType.methodType(int.class, int.class, String.class)); return new ConstantCallSite(method); } + + public CallSite boot2(MethodHandles.Lookup caller, String name, MethodType type) + throws NoSuchMethodException, IllegalAccessException + { + MethodHandles.Lookup lookup = MethodHandles.lookup(); + Class thisClass = lookup.lookupClass(); + MethodHandle method = lookup.findVirtual(thisClass, "test8", MethodType.methodType(int.class, int.class, String.class)); + return new ConstantCallSite(method.asType(MethodType.methodType(int.class, Object.class, int.class, String.class))); + } } |