This is an automated email from the ASF dual-hosted git repository.

lujiajing pushed a commit to branch feature/reproduce-parent-class-enhance-issue
in repository https://gitbox.apache.org/repos/asf/skywalking-java.git


The following commit(s) were added to 
refs/heads/feature/reproduce-parent-class-enhance-issue by this push:
     new 067ef99b2c fix issue by wrapping it into SWTypeDescriptionWrapper
067ef99b2c is described below

commit 067ef99b2cd640e625efcedf077c4d06cd8e38b3
Author: Megrez Lu <lujiajing1...@gmail.com>
AuthorDate: Thu May 22 09:50:02 2025 +0800

    fix issue by wrapping it into SWTypeDescriptionWrapper
---
 .../net/bytebuddy/agent/builder/SWDescriptionStrategy.java    | 11 ++++++++++-
 pom.xml                                                       |  2 +-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git 
a/apm-sniffer/bytebuddy-patch/src/main/java/net/bytebuddy/agent/builder/SWDescriptionStrategy.java
 
b/apm-sniffer/bytebuddy-patch/src/main/java/net/bytebuddy/agent/builder/SWDescriptionStrategy.java
index 62e8a0606c..c88353ca42 100644
--- 
a/apm-sniffer/bytebuddy-patch/src/main/java/net/bytebuddy/agent/builder/SWDescriptionStrategy.java
+++ 
b/apm-sniffer/bytebuddy-patch/src/main/java/net/bytebuddy/agent/builder/SWDescriptionStrategy.java
@@ -145,6 +145,8 @@ public class SWDescriptionStrategy implements 
AgentBuilder.DescriptionStrategy {
 
         private TypeDescription delegate;
 
+        private Generic superClass;
+
         public SWTypeDescriptionWrapper(TypeDescription delegate, String 
nameTrait, ClassLoader classLoader, String typeName) {
             this.delegate = delegate;
             this.nameTrait = nameTrait;
@@ -325,7 +327,14 @@ public class SWDescriptionStrategy implements 
AgentBuilder.DescriptionStrategy {
 
         @Override
         public Generic getSuperClass() {
-            return delegate.getSuperClass();
+            if (this.superClass == null) {
+                Generic delegateSuperClass = delegate.getSuperClass();
+                if (delegateSuperClass == null) {
+                    return delegateSuperClass;
+                }
+                this.superClass = new 
SWTypeDescriptionWrapper(delegateSuperClass.asErasure(), this.nameTrait, 
this.classLoader, delegateSuperClass.getTypeName()).asGenericType();
+            }
+            return this.superClass;
         }
 
         @Override
diff --git a/pom.xml b/pom.xml
index 1e546b07f4..42adb97927 100755
--- a/pom.xml
+++ b/pom.xml
@@ -86,7 +86,7 @@
         <lombok.version>1.18.30</lombok.version>
 
         <!-- core lib dependency -->
-        <bytebuddy.version>1.14.9</bytebuddy.version>
+        <bytebuddy.version>1.17.5</bytebuddy.version>
         <grpc.version>1.68.1</grpc.version>
         <netty.version>4.1.115.Final</netty.version>
         <gson.version>2.8.9</gson.version>

Reply via email to