Skip to content

Commit 6229b22

Browse files
xzyJavaX熊哲源
andauthored
update witness class in springmvc-annotation-5.x-plugin (#571)
Co-authored-by: 熊哲源 <xiongzheyuan@shouqianba.com>
1 parent b9075ce commit 6229b22

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Release Notes.
1111
* Implement new naming policies for names of auxiliary type, interceptor delegate field, renamed origin method, method
1212
access name, method cache value field. All names are under `sw$` name trait. They are predictable and unchanged after
1313
re-transform.
14+
* Fix witness class in springmvc-annotation-5.x-plugin to avoid falling into v3 use cases.
1415

1516
```
1617
* SWAuxiliaryTypeNamingStrategy

apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/define/AbstractSpring5Instrumentation.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
2121

2222
public abstract class AbstractSpring5Instrumentation extends ClassInstanceMethodsEnhancePluginDefine {
23-
public static final String WITNESS_CLASSES = "org.springframework.beans.annotation.AnnotationBeanUtils";
23+
public static final String WITNESS_CLASSES_LOW_VERSION = "org.springframework.beans.annotation.AnnotationBeanUtils";
24+
public static final String WITNESS_CLASSES_HIGH_VERSION = "org.springframework.core.ReactiveAdapterRegistry";
2425

2526
@Override
2627
protected final String[] witnessClasses() {
27-
return new String[] {WITNESS_CLASSES};
28+
return new String[] {WITNESS_CLASSES_LOW_VERSION, WITNESS_CLASSES_HIGH_VERSION};
2829
}
2930
}

apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/define/reactive/AbstractSpring5ReactiveInstrumentation.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
2121

2222
public abstract class AbstractSpring5ReactiveInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
23-
public static final String WITNESS_CLASSES = "org.springframework.beans.annotation.AnnotationBeanUtils";
23+
public static final String WITNESS_CLASSES_LOW_VERSION = "org.springframework.beans.annotation.AnnotationBeanUtils";
24+
public static final String WITNESS_CLASSES_HIGH_VERSION = "org.springframework.core.ReactiveAdapterRegistry";
2425

2526
@Override
2627
protected final String[] witnessClasses() {
27-
return new String[] {WITNESS_CLASSES};
28+
return new String[] {WITNESS_CLASSES_LOW_VERSION, WITNESS_CLASSES_HIGH_VERSION};
2829
}
2930
}

apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/define/reactive/AbstractSpring5ReactiveInstrumentationV2.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.v2.ClassInstanceMethodsEnhancePluginDefineV2;
2121

2222
public abstract class AbstractSpring5ReactiveInstrumentationV2 extends ClassInstanceMethodsEnhancePluginDefineV2 {
23-
public static final String WITNESS_CLASSES = "org.springframework.beans.annotation.AnnotationBeanUtils";
23+
public static final String WITNESS_CLASSES_LOW_VERSION = "org.springframework.beans.annotation.AnnotationBeanUtils";
24+
public static final String WITNESS_CLASSES_HIGH_VERSION = "org.springframework.core.ReactiveAdapterRegistry";
2425

2526
@Override
2627
protected final String[] witnessClasses() {
27-
return new String[] {WITNESS_CLASSES};
28+
return new String[] {WITNESS_CLASSES_LOW_VERSION, WITNESS_CLASSES_HIGH_VERSION};
2829
}
2930
}

0 commit comments

Comments
 (0)