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
+1 -1
View File
@@ -40,7 +40,7 @@ kyori-ansi = "net.kyori:ansi:1.1.1"
guava = "com.google.guava:guava:33.6.0-jre" guava = "com.google.guava:guava:33.6.0-jre"
gson = "com.google.code.gson:gson:2.14.0" gson = "com.google.code.gson:gson:2.14.0"
guice = "com.google.inject:guice:7.0.0" guice = "com.google.inject:guice:7.0.0"
lmbda = "org.lanternpowered:lmbda:2.0.0" lmbda = "org.lanternpowered:lmbda:3.0.0"
log4j-api = { module = "org.apache.logging.log4j:log4j-api", version.ref = "log4j" } log4j-api = { module = "org.apache.logging.log4j:log4j-api", version.ref = "log4j" }
log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" } log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" }
log4j-slf4j-impl = { module = "org.apache.logging.log4j:log4j-slf4j2-impl", version.ref = "log4j" } log4j-slf4j-impl = { module = "org.apache.logging.log4j:log4j-slf4j2-impl", version.ref = "log4j" }
@@ -60,9 +60,7 @@ final class CustomHandlerAdapter<F> {
UntargetedEventHandler buildUntargetedHandler(final Method method) UntargetedEventHandler buildUntargetedHandler(final Method method)
throws IllegalAccessException { throws IllegalAccessException {
final MethodHandle methodHandle = methodHandlesLookup.unreflect(method); final MethodHandle methodHandle = methodHandlesLookup.unreflect(method);
final MethodHandles.Lookup defineLookup = MethodHandles.privateLookupIn( final LambdaType<F> lambdaType = functionType.defineClassesWith(methodHandlesLookup);
method.getDeclaringClass(), methodHandlesLookup);
final LambdaType<F> lambdaType = functionType.defineClassesWith(defineLookup);
final F invokeFunction = LambdaFactory.create(lambdaType, methodHandle); final F invokeFunction = LambdaFactory.create(lambdaType, methodHandle);
final BiFunction<Object, Object, EventTask> handlerFunction = final BiFunction<Object, Object, EventTask> handlerFunction =
handlerBuilder.apply(invokeFunction); handlerBuilder.apply(invokeFunction);
@@ -243,7 +243,7 @@ public class VelocityEventManager implements EventManager {
} else { } else {
type = untargetedVoidHandlerType; type = untargetedVoidHandlerType;
} }
return LambdaFactory.create(type.defineClassesWith(lookup), methodHandle); return LambdaFactory.create(type.defineClassesWith(methodHandlesLookup), methodHandle);
} }
static final class MethodHandlerInfo { static final class MethodHandlerInfo {