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
NullPointerException
if passing an anonymous class to ReflectionsHint#registerType
#29774
Comments
Well for some reason it seems like adding |
It is not needed, and causes a null pointer exception. See spring-projects/spring-framework#29774
It is not needed, and causes a null pointer exception. See spring-projects/spring-framework#29774
It is not needed, and causes a null pointer exception. See spring-projects/spring-framework#29774
NullPointerException
if passing an anonymous class to ReflectionsHint#registerType
For this one, I think I would assert that the class passed to @Artur- That will not change the fact you need to avoid passing such class to |
Before this commit, anonymous classes could throw an unexpected NullPointerException in ReflectionsHint#registerType and lambdas entries could be created in the related generated reflect-config.json. This commit refines how anonymous classes are handled by explicitly checking for null class and canonical name in ReflectionTypeReference#of, while skipping such class in ReflectionHints#registerType in order to keep a lenient behavior. Closes spring-projectsgh-29774
Before this commit, anonymous classes could throw an unexpected NullPointerException in ReflectionsHint#registerType and lambdas entries could be created in the related generated reflect-config.json. This commit refines how anonymous classes are handled by explicitly checking for null class and canonical name in ReflectionTypeReference#of, while skipping such class in ReflectionHints#registerType in order to keep a lenient behavior. Closes spring-projectsgh-29774
@Artur- I implemented a solution that should fix the We have a planned release tomorrow, so when the build is finished, would be great if you could test Spring Framework |
I tried 6.0.6-SNAPSHOT but run into something that is already in 6.0.5
Need to figure that one out first.. |
Ok, Spring Boot vs Spring Framework conflict. With Spring Boot 3.0.3 + Spring Framework 6.0.6-SNAPSHOT everything works as expected, thanks! |
Before this commit, anonymous classes could throw an unexpected NullPointerException in ReflectionsHint#registerType and lambdas entries could be created in the related generated reflect-config.json. This commit refines how anonymous classes are handled by explicitly checking for null class and canonical name in ReflectionTypeReference#of, while skipping such class in ReflectionHints#registerType in order to keep a lenient behavior. Closes spring-projectsgh-29774
If you (accidentally in this case) pass an anonymous class to
registerType
it fails withThis happened to us when trying to use
and so it happens that
Converter
containsSeems like the
org.reflections
library returnsConverter$2
as one of the sub types, which then fails when passed toregisterType
.The text was updated successfully, but these errors were encountered: