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

Generic bound lists #144

Open
dantheperson opened this issue Jun 7, 2024 · 4 comments
Open

Generic bound lists #144

dantheperson opened this issue Jun 7, 2024 · 4 comments

Comments

@dantheperson
Copy link

dantheperson commented Jun 7, 2024

I have a controller endpoint that takes a Dto which extends a parentDto and bind the generic list to a concrete type.

class ParentDto<T extends Foo>{ List<T> items}
class ChildDto<ConcreteSubclassOfFoo> {}

this gives the dreaded java.lang.RuntimeException: Type T (+TypeVariableImpl) is not supported yet.

I'm a bit stumped as to how this one should be resolved. The old plugin we are trying to migrate away from did work with this, so it should be possible.

I've created a PR with a Unit test to reproduce.

As an aside, as a temporary workaround I've changed it resolve to Object.class in this case. Perhaps this is a good default behaviour, log a warning and resolve to Object. Better to complete with 95% detail than to not complete at all?

@kbuntrock
Copy link
Owner

Thank you very much @dantheperson ! Genericity resolving is the most complicated thing in this project and I'm looking for the day where 100% of cases will be handled!

I'll have a look how kongchen handled it.

And I have to think about the warning / Object resolving. It's true that this error is quite ... definitive ...

Thanks again ! 🙏

@kbuntrock
Copy link
Owner

@dantheperson I know it's been a long time ... Can I abuse of your time a little more and ask you to try the current 0.0.22-SNAPSHOT (it require a local "install", like "mvn clean install -DskipTests" for example).

I should have fixed your issue.

@dantheperson
Copy link
Author

that's on the dev branch? I'll give it a go in the next day or two.

@kbuntrock
Copy link
Owner

that's on the dev branch? I'll give it a go in the next day or two.

Yes it is on dev. Thank you very much. 🙏

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

No branches or pull requests

2 participants