From ab81e7c0349a4d2c569ac065a4a9f79f1e97d35c Mon Sep 17 00:00:00 2001 From: wyj Date: Fri, 31 May 2024 14:34:36 +0800 Subject: [PATCH 1/3] Fix isInterface invalid issue --- .../apache/skywalking/apm/agent/core/plugin/PluginFinder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/PluginFinder.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/PluginFinder.java index 4ef608dccc..1b90a005e9 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/PluginFinder.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/PluginFinder.java @@ -95,13 +95,13 @@ public boolean matches(NamedElement target) { return nameMatchDefine.containsKey(target.getActualName()); } }; - judge = judge.and(not(isInterface())); for (AbstractClassEnhancePluginDefine define : signatureMatchDefine) { ClassMatch match = define.enhanceClass(); if (match instanceof IndirectMatch) { judge = judge.or(((IndirectMatch) match).buildJunction()); } } + judge = judge.and(not(isInterface())); return new ProtectiveShieldMatcher(judge); } From b7c2d739d0dad93f1d68da09d4db1c47be8a3dfa Mon Sep 17 00:00:00 2001 From: wyj Date: Fri, 31 May 2024 14:50:12 +0800 Subject: [PATCH 2/3] add changelog --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 321c775094..0be603455f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,7 @@ Release Notes. * Support for showing batch command details and ignoring PING commands in Redisson plugin. * Fix peer value of Master-Slave mode in Redisson plugin. * Support for tracing the callbacks of asynchronous methods in elasticsearch-6.x-plugin/elasticsearch-7.x-plugin. +* Fixed the invalid issue in the isInterface method in PluginFinder. All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/213?closed=1) From ea21d219dde0b8625b3650a588c5c4f85080592c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=99=9F=20Wu=20Sheng?= Date: Mon, 3 Jun 2024 10:22:41 +0800 Subject: [PATCH 3/3] Update apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/PluginFinder.java --- .../apache/skywalking/apm/agent/core/plugin/PluginFinder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/PluginFinder.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/PluginFinder.java index 1b90a005e9..5a7404e729 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/PluginFinder.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/PluginFinder.java @@ -101,7 +101,8 @@ public boolean matches(NamedElement target) { judge = judge.or(((IndirectMatch) match).buildJunction()); } } - judge = judge.and(not(isInterface())); + // Filter out all matchers returns to exclude pure interface types. + judge = not(isInterface()).and(judge); return new ProtectiveShieldMatcher(judge); }