-
Notifications
You must be signed in to change notification settings - Fork 1k
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
@MeterTag
does not work on package private method
#4506
@MeterTag
does not work on package private method
#4506
Conversation
7b63e9a
to
9a370e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR complete with tests.
I've rebased and targeted the pull request at the |
@MeterTag
does not work on package private method
@@ -89,7 +89,7 @@ public AnnotationHandler(BiConsumer<KeyValue, T> keyValueConsumer, | |||
public void addAnnotatedParameters(T objectToModify, ProceedingJoinPoint pjp) { | |||
try { | |||
Method method = ((MethodSignature) pjp.getSignature()).getMethod(); | |||
method = pjp.getTarget().getClass().getMethod(method.getName(), method.getParameterTypes()); | |||
method = pjp.getTarget().getClass().getDeclaredMethod(method.getName(), method.getParameterTypes()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to have broken existing support for methods that are only declared in the parent class, was it intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't think that was intended. Could you open an issue for it? I guess we're missing a test case to cover that scenario since we didn't notice it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done: #4983
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bpernetupgrade Ooops, no it wasn't intended and as @shakuzen says the lack of test coverage is at fault here.
Good found though, I'll see if I can provide a fix for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at #4985
Fixes
NoSuchMethodException
being thrown when using@MeterTag
on package private method.