summaryrefslogtreecommitdiffstats
path: root/src/test/test4/InvokeDyn.java
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2012-10-06 14:47:31 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2012-10-06 14:47:31 +0000
commit3ab8b841312f792dc64016800193cb1b0368a9f9 (patch)
tree981c95a6f1657ea8289be88ef2cc7cc7877fa916 /src/test/test4/InvokeDyn.java
parenteffbfdc89cd7cb85127319b5951871dbefec5ea3 (diff)
downloadjavassist-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.java14
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)));
+ }
}