You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The shouldSkipMembers method uses type.getCanonicalName(), which may return null for anonymous, local and other types leading to NPE when calling startsWith.
The above happened when reading Java8 compiled code of com.mongodb.connection.ServerType.
Retrieving constructor arguments and registering them for binding failed because a synthetic constructor uses an anonymous class (com.mongodb.connection.ServerType$1).
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because the return value of "java.lang.Class.getCanonicalName()" is null
at org.springframework.aot.hint.BindingReflectionHintsRegistrar.shouldSkipMembers(BindingReflectionHintsRegistrar.java:74)
at org.springframework.aot.hint.BindingReflectionHintsRegistrar.lambda$registerReflectionHints$0(BindingReflectionHintsRegistrar.java:87)
at org.springframework.aot.hint.ReflectionHints.registerType(ReflectionHints.java:86)
at org.springframework.aot.hint.ReflectionHints.registerType(ReflectionHints.java:109)
at org.springframework.aot.hint.BindingReflectionHintsRegistrar.registerReflectionHints(BindingReflectionHintsRegistrar.java:86)
at org.springframework.aot.hint.BindingReflectionHintsRegistrar.registerReflectionHints(BindingReflectionHintsRegistrar.java:65)
bclozel
changed the title
Potential NPE in BindingReflectionHintsRegistrar#shouldSkipMembers(...)
NullPointerException in BindingReflectionHintsRegistrar for anonymous classes
Dec 7, 2022
The
shouldSkipMembers
method usestype.getCanonicalName()
, which may returnnull
for anonymous, local and other types leading to NPE when callingstartsWith
.The above happened when reading Java8 compiled code of
com.mongodb.connection.ServerType
.Retrieving constructor arguments and registering them for binding failed because a synthetic constructor uses an anonymous class (
com.mongodb.connection.ServerType$1
).related: spring-projects/spring-data-mongodb#4248
The text was updated successfully, but these errors were encountered: