From c0b6d9f67793aebfe075739d5a597345518b44f0 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Tue, 24 Mar 2020 14:30:02 +1100 Subject: [PATCH] Issue #4691 - changes from review Signed-off-by: Lachlan Roberts --- .../websocket/javax/common/JavaxWebSocketFrameHandler.java | 2 -- .../javax/common/JavaxWebSocketFrameHandlerFactory.java | 4 ++-- .../websocket/common/JettyWebSocketFrameHandlerFactory.java | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java index 8bb3718724d..1ee1797dc86 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java @@ -373,7 +373,6 @@ public class JavaxWebSocketFrameHandler implements FrameHandler { try { - // TODO: move methodhandle lookup to container? MethodHandles.Lookup lookup = JavaxWebSocketFrameHandlerFactory.getServerMethodHandleLookup(); MethodHandle partialMessageHandler = lookup .findVirtual(MessageHandler.Partial.class, "onMessage", MethodType.methodType(void.class, Object.class, boolean.class)); @@ -431,7 +430,6 @@ public class JavaxWebSocketFrameHandler implements FrameHandler { try { - // TODO: move MethodHandle lookup to container? MethodHandles.Lookup lookup = JavaxWebSocketFrameHandlerFactory.getServerMethodHandleLookup(); MethodHandle wholeMsgMethodHandle = lookup.findVirtual(MessageHandler.Whole.class, "onMessage", MethodType.methodType(void.class, Object.class)); wholeMsgMethodHandle = wholeMsgMethodHandle.bindTo(handler); diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java index 679d653960f..5eeea251808 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java @@ -708,14 +708,14 @@ public abstract class JavaxWebSocketFrameHandlerFactory /** *

* Gives a {@link MethodHandles.Lookup} instance to be used to find methods in server classes. - * For lookups on application classes use {@link #getApplicationMethodHandleLookup(Class)} ()} instead. + * For lookups on application classes use {@link #getApplicationMethodHandleLookup(Class)} instead. *

*

* This uses the caller sensitive {@link MethodHandles#lookup()}, this will allow MethodHandle access * to server classes we need to use and will give access permissions to private methods as well. *

* - * @return + * @return a lookup object to be used to find methods on server classes. */ public static MethodHandles.Lookup getServerMethodHandleLookup() { diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandlerFactory.java b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandlerFactory.java index 51298633c1e..13a22ab6d0f 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandlerFactory.java +++ b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandlerFactory.java @@ -460,14 +460,14 @@ public class JettyWebSocketFrameHandlerFactory extends ContainerLifeCycle /** *

* Gives a {@link MethodHandles.Lookup} instance to be used to find methods in server classes. - * For lookups on application classes use {@link #getApplicationMethodHandleLookup(Class)} ()} instead. + * For lookups on application classes use {@link #getApplicationMethodHandleLookup(Class)} instead. *

*

* This uses the caller sensitive {@link MethodHandles#lookup()}, this will allow MethodHandle access * to server classes we need to use and will give access permissions to private methods as well. *

* - * @return + * @return a lookup object to be used to find methods on server classes. */ public static MethodHandles.Lookup getServerMethodHandleLookup() {