Skip to content

GH-3765 Resolve Lookup ctor lazily via reflection #3781

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

Merged
merged 1 commit into from
Apr 11, 2022

Conversation

artembilan
Copy link
Member

Fixes #3765

The DefaultMethodInvokingMethodInterceptor has several strategies
for default method invocations in the messaging gateway.
One of them is based on the Lookup constructor which causes
a WARNING: An illegal reflective access operation has occurred.
This can be done lazily when there is no MethodHandles.privateLookupIn
in Java version used for the project.

  • Fix OPEN enum value for the Constructor<Lookup> to be resolved in
    a lazy manner via Supplier and boolean flag

Cherry-pick to 5.5.x

Fixes spring-projects#3765

The `DefaultMethodInvokingMethodInterceptor` has several strategies
for `default` method invocations in the messaging gateway.
One of them is based on the `Lookup` constructor which causes
a `WARNING: An illegal reflective access operation has occurred`.
This can be done lazily when there is no `MethodHandles.privateLookupIn`
in Java version used for the project.

* Fix `OPEN` enum value for the `Constructor<Lookup>` to be resolved in
a lazy manner via `Supplier` and `boolean` flag

**Cherry-pick to `5.5.x`**
@garyrussell garyrussell merged commit cd84f16 into spring-projects:main Apr 11, 2022
@garyrussell
Copy link
Contributor

...and cherry-picked.

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

Successfully merging this pull request may close these issues.

WARNING: An illegal reflective access operation has occurred
2 participants