This would cause an NPE if suffixPatternMatch
is null
.
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because "suffixPatternMatch" is null
at org.springframework.web.servlet.config.annotation.PathMatchConfigurer.setUseSuffixPatternMatch(PathMatchConfigurer.java:156) ~[spring-webmvc-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at com.example.demo.PathMatchingThingyApplication.configurePathMatch(PathMatchingThingyApplication.java:14) ~[main/:na]
at org.springframework.web.servlet.config.annotation.WebMvcConfigurerComposite.configurePathMatch(WebMvcConfigurerComposite.java:53) ~[spring-webmvc-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration.configurePathMatch(DelegatingWebMvcConfiguration.java:58) ~[spring-webmvc-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.getPathMatchConfigurer(WebMvcConfigurationSupport.java:388) ~[spring-webmvc-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.mvcResourceUrlProvider(WebMvcConfigurationSupport.java:614) ~[spring-webmvc-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:130) ~[spring-beans-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
... 34 common frames omitted
While the API doesn't expect nulls, it's worth investigating whether switching to boolean
or adding an Assert
would be possible. Similar case for registeredSuffixPatternMatch
.