Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

com.strobel.reflection.Type.containsGenericParameter returns incorrect result for generic types #38

Closed
BladeWise opened this issue Jan 31, 2022 · 2 comments

Comments

@BladeWise
Copy link

The function

public boolean containsGenericParameter(final Type<?> genericParameter) {

returns an incorrect result for generic types, expecially if compared to
public boolean containsGenericParameters() {

Specifically, containsGenericParameter does not take into account closed generics


just generic type definitions, while containsGenericParameters performs the check on both.

Removing the line


fixes the inconsistency.

@mstrobel
Copy link
Owner

mstrobel commented Feb 8, 2022

Just so I understand, the issue is that containsGenericParameter does not evaluate to true for a bound generic type instantiation containing a generic parameter as a type argument?

@mstrobel
Copy link
Owner

mstrobel commented Feb 8, 2022

Just so I understand, the issue is that containsGenericParameter does not evaluate to true for a bound generic type instantiation containing a generic parameter as a type argument?

Never mind the above question--it was pretty obvious when I actually looked at the code. Thanks!

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

No branches or pull requests

2 participants