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
We had some implementation classes annotated with @timed annotation. After migrating to 1.9.0 from 1.8.5 we're having NPE in TimedAspect class. It happens because of the part of the code from io.micrometer.core.aop.TimedAspect#timedClass method:
Method being called through the interface reference, and the @timed annotation is actually on the implementation class itself. Therefore, declaringClass resolved into interface class, and timed variable is null. Then we get NPE down the stack.
Am I correct in assuming that we should have here some additional logic like in the io.micrometer.core.aop.TimedAspect#timedMethod metod? This is how it looks like:
Additionally, seems like we're missing shouldSkip predicate check in io.micrometer.core.aop.TimedAspect#timedClass, although we have it in the io.micrometer.core.aop.TimedAspect#timedMethod:
if (shouldSkip.test(pjp)) {
return pjp.proceed();
}
Environment
Micrometer version [1.9.0] (works on [1.8.5])
Micrometer registry [Prometheus]
OS: [Windows/Linux]
Additional context
It appears that it's related to this recently merged PR
Also little bit related to this issue
The text was updated successfully, but these errors were encountered:
Thank you for the detailed report and sorry for the issues. It sounds like you've got the right idea with the fixes. Would you be interested in contributing pull requests? Ideally two separate pull requests for the two separate issues.
Describe the bug
We had some implementation classes annotated with @timed annotation. After migrating to 1.9.0 from 1.8.5 we're having NPE in TimedAspect class. It happens because of the part of the code from
io.micrometer.core.aop.TimedAspect#timedClass
method:Method being called through the interface reference, and the @timed annotation is actually on the implementation class itself. Therefore,
declaringClass
resolved into interface class, andtimed
variable isnull
. Then we get NPE down the stack.Am I correct in assuming that we should have here some additional logic like in the
io.micrometer.core.aop.TimedAspect#timedMethod
metod? This is how it looks like:Additionally, seems like we're missing
shouldSkip
predicate check inio.micrometer.core.aop.TimedAspect#timedClass
, although we have it in theio.micrometer.core.aop.TimedAspect#timedMethod
:Environment
Micrometer version [1.9.0] (works on [1.8.5])
Micrometer registry [Prometheus]
OS: [Windows/Linux]
Additional context
It appears that it's related to this recently merged PR
Also little bit related to this issue
The text was updated successfully, but these errors were encountered: