Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use MethodHandles.lookup() consistently in WebSocket code #4691

Closed
sbordet opened this issue Mar 22, 2020 · 1 comment
Closed

Use MethodHandles.lookup() consistently in WebSocket code #4691

sbordet opened this issue Mar 22, 2020 · 1 comment
Assignees

Comments

@sbordet
Copy link
Contributor

sbordet commented Mar 22, 2020

Jetty version
10.0.x

Description
Usage of MethodHandles.lookup() and all its variants needs to be done consistently in WebSocket classes.

Particular care must be taken when method handles are looked up in application classes - usage of MethodHandles.publicLookup().in(...) is probably best in that case as we want to separate the various lookups for every webapp with a different class loader.

For implementation usages of method handles, it must be explicitly stated so.

I would like to see 2 utility methods (even duplicated between the javax and the jetty implementation) that clearly state what is the lookup used for, and why one API is used over another (e.g. MethodHandles.lookup() vs MethodHandles.publicLookup().in(...)).

sbordet added a commit that referenced this issue Mar 22, 2020
* Using MethodHandles.publicLookup().in(...) instead of privateLookupIn(...).
* Moved test WebSocket EndPoint classes into the proper package, otherwise
  they would not be accessible because the test package is not exported.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
lachlan-roberts added a commit that referenced this issue Mar 23, 2020
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Mar 23, 2020
…thodhandles_lookup

Issue #4691 - Use MethodHandles.lookup() consistently in WebSocket code.
lachlan-roberts added a commit that referenced this issue Mar 23, 2020
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Mar 24, 2020
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Mar 24, 2020
…thodhandles_lookup

Issue #4691 - use static methods with javadoc to get MethodHandle lookups
@lachlan-roberts
Copy link
Contributor

fixed in PR #4694

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants