use of LambdaReceiver_anotherpkg.LambdaReceiver_A in project jdk8u_jdk by JetBrains.
the class LambdaReceiver method main.
public static void main(String[] args) throws Throwable {
l = MethodHandles.lookup();
h = l.findVirtual(LambdaReceiver_A.class, "f", mt(int.class));
MethodType X = mt(int.class, LambdaReceiver.class);
MethodType A = mt(int.class, LambdaReceiver_A.class);
MethodType mti = mt(IA.class);
CallSite cs = LambdaMetafactory.metafactory(l, "m", mti, A, h, X);
IA p = (IA) cs.dynamicInvoker().invoke();
LambdaReceiver_A lra = new LambdaReceiver_A();
try {
p.m(lra);
} catch (ClassCastException cce) {
return;
}
throw new AssertionError("CCE expected");
}
use of LambdaReceiver_anotherpkg.LambdaReceiver_A in project jdk8u_jdk by JetBrains.
the class LambdaReceiverBridge method main.
public static void main(String[] args) throws Throwable {
l = MethodHandles.lookup();
h = l.findVirtual(LambdaReceiver_A.class, "f", mt(int.class));
MethodType X = mt(int.class, LambdaReceiverBridge.class);
MethodType A = mt(int.class, LambdaReceiver_A.class);
MethodType mti = mt(IA.class);
CallSite cs = LambdaMetafactory.altMetafactory(l, "m", mti, X, h, X, LambdaMetafactory.FLAG_BRIDGES, 1, A);
IA p = (IA) cs.dynamicInvoker().invoke();
LambdaReceiver_A lra = new LambdaReceiver_A();
try {
p.m(lra);
} catch (ClassCastException cce) {
return;
}
throw new AssertionError("CCE expected");
}
Aggregations