Bump lmbda to 3.0.0, defining generated handlers with the proxy's lookup instead of the plugin's

Reapplies the lmbda 3.0.0 bump reverted in f918d0d6.
This commit is contained in:
Wouter Gritter
2026-08-14 12:53:49 +02:00
parent f918d0d649
commit 4772ca3022
3 changed files with 3 additions and 5 deletions
@@ -60,9 +60,7 @@ final class CustomHandlerAdapter<F> {
UntargetedEventHandler buildUntargetedHandler(final Method method)
throws IllegalAccessException {
final MethodHandle methodHandle = methodHandlesLookup.unreflect(method);
final MethodHandles.Lookup defineLookup = MethodHandles.privateLookupIn(
method.getDeclaringClass(), methodHandlesLookup);
final LambdaType<F> lambdaType = functionType.defineClassesWith(defineLookup);
final LambdaType<F> lambdaType = functionType.defineClassesWith(methodHandlesLookup);
final F invokeFunction = LambdaFactory.create(lambdaType, methodHandle);
final BiFunction<Object, Object, EventTask> handlerFunction =
handlerBuilder.apply(invokeFunction);
@@ -243,7 +243,7 @@ public class VelocityEventManager implements EventManager {
} else {
type = untargetedVoidHandlerType;
}
return LambdaFactory.create(type.defineClassesWith(lookup), methodHandle);
return LambdaFactory.create(type.defineClassesWith(methodHandlesLookup), methodHandle);
}
static final class MethodHandlerInfo {