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
Describe the bug
As @NonNullApi used in the package, ValueExpressionResolver is annotated with both input and output @nonnull. But this is not true at runtime, which makes it not friendly to Kotlin.
Environment
v1.11.4
To Reproduce
@ComponentclassMyComponent {
@TimedvoidmyMethod(@MeterTag("slug", expression = "#this"Stringslug) { }
}
@AutowiredprivatemyComponent: MyComponent;
myComponent.myMethod(null);
// Then a null parameter will be sent to the implementation ValueExpressionResolver.
java.lang.NullPointerException: Parameter specified as non-null is null: method SpelValueExpressionResolver.resolve, parameter parameter
at com.flexport.bookings.config.MetricsConfig$SpelValueExpressionResolver.resolve(MetricsConfig.kt)
at io.micrometer.core.aop.MeterTagAnnotationHandler.resolveTagValue(MeterTagAnnotationHandler.java:70)
at io.micrometer.core.aop.MeterTagAnnotationHandler.lambda$new$1(MeterTagAnnotationHandler.java:52)
at io.micrometer.common.annotation.AnnotationHandler.addAnnotatedArguments(AnnotationHandler.java:141)
at io.micrometer.common.annotation.AnnotationHandler.addAnnotatedParameters(AnnotationHandler.java:96)
at io.micrometer.core.aop.TimedAspect.recordBuilder(TimedAspect.java:258)
at io.micrometer.core.aop.TimedAspect.record(TimedAspect.java:241)
at io.micrometer.core.aop.TimedAspect.processWithTimer(TimedAspect.java:234)
at io.micrometer.core.aop.TimedAspect.perform(TimedAspect.java:202)
at io.micrometer.core.aop.TimedAspect.timedMethod(TimedAspect.java:194)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:637)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:627)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:71)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:702)
Expected behavior
ValueExpressionResolver should defined like this:
Describe the bug
As @NonNullApi used in the package, ValueExpressionResolver is annotated with both input and output @nonnull. But this is not true at runtime, which makes it not friendly to Kotlin.
Environment
v1.11.4
To Reproduce
Expected behavior
ValueExpressionResolver should defined like this:
Another option is to ensure micrometer doesn't pass in null to the parameter, because it doesn't make much sense..
The text was updated successfully, but these errors were encountered: