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

Binder API should make ? extends Object binds easier #158

Open
jbee opened this issue Dec 25, 2020 · 0 comments
Open

Binder API should make ? extends Object binds easier #158

jbee opened this issue Dec 25, 2020 · 0 comments

Comments

@jbee
Copy link
Owner

jbee commented Dec 25, 2020

When binding a supplier for ? extends Object (basically it says it can supply any type) the Binder API makes it hard to bind this to a Supplier as no such Supplier can be provided in a type-safe way since it would need to implement:

class GenericSupplier implements Supplier<? extends Object> { ... }

Such type argument is illegal. A way around is to make the implementing class itself have a type parameter:

class GenericSupplier<T> implements Supplier<T> { ... }

Now binding this is still problematic as it requires a extra method to introduce a type variable so that both the required and the provided type can be based on that variable. There should be a more elegant way to do this sort of thing.

Problem can be found in TestExampleConfigPropertyAnnotationBinds or TestExampleAutoStubbingInterfacesBinds.

@jbee jbee added this to the 8.1 milestone Jan 1, 2021
@jbee jbee removed this from the 8.1 JMS ready milestone Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant