Fix method reflection bug#5030
Merged
nobodyiam merged 7 commits intoapolloconfig:masterfrom Dec 4, 2023
Merged
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. |
nobodyiam
reviewed
Dec 3, 2023
| Method method = ReflectUtils.findDeclaredMethod(clazz, methodName, parameterTypes); | ||
| return method; | ||
| } catch (NoSuchMethodException e) { | ||
| return null; |
Member
There was a problem hiding this comment.
Is it necessary for the caller to implement handling mechanisms for null value scenarios?
Member
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 testto make sure this pull request doesn't break anything.CHANGESlog.