Regress from 1.5.5 to 1.5.6 and still present in 1.7.1: Cannot inject List<Consumer<T>>
kepakiano opened this issue · comments
kepakiano commented
I'd like to inject a List<Consumer<Integer>>
into a test like so:
@Property
void foo(@ForAll @Size(min = 1) List<Consumer<Integer>> integerConsumers){
}
This worked in 1.5.5, broke in 1.5.6 and is still broken in 1.7.1.
StackTrace I'm getting:
java.lang.NullPointerException: Cannot invoke "Object.hashCode()" because "constant" is null
at net.jqwik.engine.properties.arbitraries.randomized.AbstractFunctionGenerator.lambda$constantFunction$0(AbstractFunctionGenerator.java:46)
at jdk.proxy1/jdk.proxy1.$Proxy11.hashCode(Unknown Source)
at java.base/java.util.HashMap.hash(HashMap.java:338)
at java.base/java.util.HashMap.put(HashMap.java:610)
I'm using a Java 17 runtime.
If making injecting a List<Consumer<Integer>>
impossible was a deliberate decision for 1.5.6, please feel free to ignore this issue :)
Thank you for this amazing library!
Johannes Link commented
@kepakiano Thanks for the catch. Does look like a bug at first glance. Will check.
Johannes Link commented
Fix released in 1.7.2-SNAPSHOT
Johannes Link commented
1.7.2 has been released
kepakiano commented
Thank you! We were able to upgrade to the latest version with this fix :)