You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disclaimer: this could be no bug.
Firstly, thank you for all the support, time and effort you put into managing the EqualsVerifier library and helping out people in need!
Describe the bug
I stumbled across an issue (possibly) with EqualsVerifier, when attempting to test the methods of a class, which has a property of type RuntimeException in Java 17. This is probably due to the new modular structure of the language. It worked successfully on Java 11. A workaround is to replace the property from RuntimeException to Throwable. I also tried other classes from the java.lang package (for Thread the test succeeds, for Processor it doesn't).
So my question is: is this the expected behavior or should the framework handle these cases? Thanks in advance!
To Reproduce
Run the test and observe the behavior
Code that triggers the behavior
I've attached a minimal project to reproduce the problem as a tar file. reproduce 2.zip
Error message
java.lang.AssertionError: EqualsVerifier found a problem in class com.example.demo.Dummy.
-> Unable to make field private transient java.lang.Class java.lang.StackTraceElement.declaringClassObject accessible: module java.base does not "opens java.lang" to unnamed module @a38d7a3
Expected behavior
Exceptions as class fields should be considered during checks for equals/hashCode imho (unless something more architectural is preventing it)
EqualsVerifier version
3.13.2
Additional Info
OS: macOS Ventura 13.4.1
IDE: Intellij IDEA 2021.2.2
Java 17.0.7
The text was updated successfully, but these errors were encountered:
The problem is that EqualsVerifier does some reflection on all of a class's fields, and this is not allowed for classes from Java's APIs. This is something I can fix in the EqualsVerifier codebase, and I have: version 3.14.3 is now out, and it should solve your problem!
Disclaimer: this could be no bug.
Firstly, thank you for all the support, time and effort you put into managing the EqualsVerifier library and helping out people in need!
Describe the bug
I stumbled across an issue (possibly) with EqualsVerifier, when attempting to test the methods of a class, which has a property of type
RuntimeException
in Java 17. This is probably due to the new modular structure of the language. It worked successfully on Java 11. A workaround is to replace the property from RuntimeException to Throwable. I also tried other classes from thejava.lang
package (for Thread the test succeeds, for Processor it doesn't).So my question is: is this the expected behavior or should the framework handle these cases? Thanks in advance!
To Reproduce
Run the test and observe the behavior
Code that triggers the behavior
I've attached a minimal project to reproduce the problem as a tar file.
reproduce 2.zip
Error message
Expected behavior
Exceptions as class fields should be considered during checks for equals/hashCode imho (unless something more architectural is preventing it)
EqualsVerifier version
3.13.2
Additional Info
OS: macOS Ventura 13.4.1
IDE: Intellij IDEA 2021.2.2
Java 17.0.7
The text was updated successfully, but these errors were encountered: