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
IllegalStateException using sealed class #564
Comments
I haven't had time yet to play around with sealed classes and how they interact with EqualsVerifier. I agree that it shouldn't break on them. |
Sure thing thanks for the quick response:
|
Thanks for the quick reply! Unfortunately, none of the workarounds I had in mind seem to work, so I'll have to come up with something else. Given that this is a big thing and I'm currently on holiday, it might take a while. |
No problem at all, thanks for maintaining this library. I'll take a look myself as well to see if I can contribute 👍 |
Just a "me too". 😄 I use |
Thanks for the kind words! I'll give it a bump on my todo list :) |
Just released 3.8.2 which fixes this particular issue. I'll take a closer look at sealed classes later! |
Thanks! Could the same check be performed to prevent the same error, but when trying to test the "parent"?
|
Oh, oops, could have thought to try that out myself! How urgent is this for you? I'm in the midst of a complete re-write of the build files, so I can leverage multi-release jar files to handle sealed class files more elegantly. The reflection code I used before is awful. |
I just released version 3.8.3, which contains a temporary solution: sealed classes are now just skipped. In a future version, I will see if I can make EqualsVerifier go through the permitted classes so it (indirectly) has some instances of the sealed class to work with. |
I've just released EqualsVerifier 3.14, which reverts the temporary solution mentioned in the previous comment, and adds proper support for sealed types. Note that EqualsVerifier might now fail on your existing tests with sealed types, because a bunch of checks are now no longer skipped 😅 |
Describe the bug
Trying to use a new java 17 feature called sealed classes along with equalsverifier results in an exception due to the inability to extend a class.
Code that triggers the behavior
Error message
Expected behavior
Not sure if there is a workaround for this, ideally it shouldn't break on sealed classes.
Version
3.8.1
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: