-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Fix method reflection bug #5030
Fix method reflection bug #5030
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #5030 +/- ##
============================================
+ Coverage 49.27% 49.62% +0.35%
- Complexity 1889 1904 +15
============================================
Files 372 372
Lines 11538 11559 +21
Branches 1123 1127 +4
============================================
+ Hits 5685 5736 +51
+ Misses 5513 5483 -30
Partials 340 340 ☔ View full report in Codecov by Sentry. |
Method method = ReflectUtils.findDeclaredMethod(clazz, methodName, parameterTypes); | ||
return method; | ||
} catch (NoSuchMethodException e) { | ||
return null; |
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.
Is it necessary for the caller to implement handling mechanisms for null value scenarios?
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.
Sorry for my late response, this method is trying to get the method which cause this method called.
So, when this method returns null, that would be a very strange situation.
Maybe just add a patch to end the audit logic rapidly when method returns null.
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.
LGTM
What's the purpose of this PR
Fix bug when aop finding method with same name by reflect.
Which issue(s) this PR fixes:
Fixes #5029
Brief changelog
enhance ApolloAuditSpanAspect::findMethod and its unit test method.
Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean test
to make sure this pull request doesn't break anything.CHANGES
log.