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

illegal reflective access operation #10

Open
cemeyer2 opened this issue Oct 8, 2020 · 3 comments
Open

illegal reflective access operation #10

cemeyer2 opened this issue Oct 8, 2020 · 3 comments

Comments

@cemeyer2
Copy link

cemeyer2 commented Oct 8, 2020

Running a test suite that leverages WithEnvironmentVariables in a docker container based on openjdk:11-jdk, I get the following warning:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.github.stefanbirkner.systemlambda.SystemLambda$WithEnvironmentVariables (file:/root/.gradle/caches/modules-2/files-2.1/com.github.stefanbirkner/system-lambda/1.1.0/488b3059b67701b821355dafd952c0c7110f7ba9/system-lambda-1.1.0.jar) to field java.util.Collections$UnmodifiableMap.m
WARNING: Please consider reporting this to the maintainers of com.github.stefanbirkner.systemlambda.SystemLambda$WithEnvironmentVariables
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

The code executes fine, but the warning is slightly concerning if in fact a future release of the JVM will break this library. Is there something I can do in my code to not cause the illegal access?

Thanks!

@stefanbirkner
Copy link
Owner

Unfortunately not. You're right. The code may break in a future JVM because the environment variables support relies on internal details. AFAIK there es no other way apart from mocking the System class.

@FreedomFaighter
Copy link

#31 has a log of where that issue begins in the tests

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

4 participants