-
Notifications
You must be signed in to change notification settings - Fork 599
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 to Ensure All Rules Satisfy not isInterface #695
Conversation
@wengyingjian I think the current
Is my understanding right? |
I think original request is all things should be not an interface. First or last are not accurate. It should use and with all other condition or before all other checks run. |
Yes, because I didn't find a place that required modifying the bytecode for interfaces, I think all matching rules should be non-interface based. If that's the case, adding and (not isInterface) in the for loop is indeed a safer approach. Additionally, I've noticed that some custom IndirectMatch instances include not interface, while some do not. |
In theory, there is no point to intrument an interface, especially we require to add new field to the target. |
...r/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/PluginFinder.java
Outdated
Show resolved
Hide resolved
…/apm/agent/core/plugin/PluginFinder.java
I think those are not necessary, but as the bug you are fixing, they may be added as it is. |
I think the logic error is, that the |
Fix
Add a unit test to verify that the fix works.
Explain briefly why the bug exists and how to fix it.
According to the code principles of
net.bytebuddy.matcher.ElementMatcher.Junction
:In the current code, the running effect can only ensure that the first
NamedMatch
satisfiesnot isInterface
:(((NamedMatch) and (not(isInterface))) or IndirectMatch) or...IndirectMatch.
After moving
not isInterface
to the end, the running effect can ensure that all rules satisfynot isInterface
:(((NamedMatch) or (IndirectMatch)) or...IndirectMatch) and not(isInterface).
If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.
Update the
CHANGES
log.