-
Notifications
You must be signed in to change notification settings - Fork 354
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
NPE in enum constructors if hamcrest on classpath #770
Comments
Thanks for the report that is ... strange. |
I have managed to narrow it down to adfe9de (probably not too surprising). If |
hcoles
pushed a commit
that referenced
this issue
Dec 31, 2020
Failing test to describe general issue behind coverage bugs - child classes are initialized after their parents, so coverage probe is not initialized when parent refers to child in a static initializer block.
hcoles
pushed a commit
that referenced
this issue
Dec 31, 2020
Failing test to describe general issue behind coverage bugs - child classes are initialized after their parents, so coverage probe is not initialized when parent refers to child in a static initializer block.
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since 1.4.7, if I have hamcrest in the classpath I get a
NullPointerException
thrown in the<init>
method of enums with constructors if I try to load them usingClass.forName
when pitest does the initial test run.If I run the tests using junit directly, the exception is not thrown. If I remove hamcrest from the classpath, the exception is not thrown.
I have tried with hamcrest 1.3 and hamcrest 2.2 and both cause the exception to be thrown.
I have tried with both openjdk 11.0.6 and oracle Java JDK 8 [1.8.0_251]. Both cause the exception to be thrown.
I have attached a minimal example using pitest-ant.
pitest-npe-in-enum-ctor.zip
Full output:
The text was updated successfully, but these errors were encountered: