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

Regress from 1.5.5 to 1.5.6 and still present in 1.7.1: Cannot inject List<Consumer<T>> #446

Closed
kepakiano opened this issue Jan 2, 2023 · 4 comments
Labels

Comments

@kepakiano
Copy link

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!

@jlink
Copy link
Collaborator

jlink commented Jan 2, 2023

@kepakiano Thanks for the catch. Does look like a bug at first glance. Will check.

jlink added a commit that referenced this issue Jan 3, 2023
jlink added a commit that referenced this issue Jan 3, 2023
@jlink jlink added the bug label Jan 3, 2023
@jlink
Copy link
Collaborator

jlink commented Jan 3, 2023

Fix released in 1.7.2-SNAPSHOT

@jlink jlink closed this as completed Jan 3, 2023
@jlink
Copy link
Collaborator

jlink commented Jan 9, 2023

1.7.2 has been released

@kepakiano
Copy link
Author

Thank you! We were able to upgrade to the latest version with this fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants