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

Incompatibility between @Spy annotation and java.util.Properties in OpenJDK17 #327

Open
pgrt opened this issue Dec 23, 2022 · 0 comments
Open

Comments

@pgrt
Copy link

pgrt commented Dec 23, 2022

Hello,

I am the Debian maintainer of owner. In Debian unstable with OpenJDK 17.0.5 and mockito 2.23.0, I get

[ERROR] testListPrintStream(org.aeonbits.owner.PropertiesInvocationHandlerTest) Time elapsed: 0.542 s <<< ERROR!
java.lang.NullPointerException: Cannot invoke "java.util.concurrent.ConcurrentHashMap.putAll(java.util.Map)" because "this.map" is null
at org.aeonbits.owner.PropertiesInvocationHandlerTest.before(PropertiesInvocationHandlerTest.java:46)

[ERROR] testListPrintWriter(org.aeonbits.owner.PropertiesInvocationHandlerTest) Time elapsed: 0.002 s <<< ERROR!
java.lang.NullPointerException: Cannot invoke "java.util.concurrent.ConcurrentHashMap.putAll(java.util.Map)" because "this.map" is null
at org.aeonbits.owner.PropertiesInvocationHandlerTest.before(PropertiesInvocationHandlerTest.java:46)

Interestingly, it seems there is an issue with properties in the before method being declared with the @SPY annotation. Indeed, changing slightly the test file to the enclosed one (see lines 31, 32, 46, 47) causes an error on line 46 but not on line 47.
PropertiesInvocationHandlerTest.java.txt

Honestly I cannot explain what causes this, but if you can then I am interested in knowing.

Bye,
Pierre

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

1 participant