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
Methods with generic parameters cannot be loaded #694
Comments
lukehutch
added a commit
that referenced
this issue
Jul 3, 2022
Hi @freya022, Thanks for the bug report and reproducer testcase. I think I fixed the bug, but please check whether it works for you, and please also look at the source code of my change to see if it works as you would expect it to. Thank you! |
Hello, seems like the issue is fixed, I don't have any issue with the source changes. Thanks. |
Thanks for taking a look, released in 4.8.148. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to load a method from a class with
MethodInfo#loadClassAndGetMethod
, but it's failing saying it didn't find the method, exception:The loading is failing because the method has a generic parameter, by debugging the internals i've found the parameter types used to find the method were wrong, if you have a single parameter which type is a generic,
MethodInfo#loadParameterClasses
returns the class the method is declared in, however, it should have returned the erasure of the generic parameter.Here are the verbose logs as well as a reproducible example.
CG-logs.log
ClassGraphBug.zip
The text was updated successfully, but these errors were encountered: