Ignore the synthetic constructor created by the agent (#111)

* Resolves #8532, ignored the synthetic constructor created by java agent

Co-authored-by: qinjunjie <qinjunjie@jiuqi.com.cn>
This commit is contained in:
AlexQin 2022-02-16 18:09:09 +08:00 committed by GitHub
parent 00cf97e425
commit f0c22f32dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -11,6 +11,7 @@ Release Notes.
* Support Druid Connection pool metrics collecting.
* Support HikariCP Connection pool metrics collecting.
* Support Dbcp2 Connection pool metrics collecting.
* Ignore the synthetic constructor created by the agent in the Spring patch plugin.
#### Documentation

View File

@ -20,7 +20,6 @@ package org.apache.skywalking.apm.plugin.spring.patch;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -72,7 +71,7 @@ public class AutowiredAnnotationProcessorInterceptor implements InstanceMethodsA
Constructor<?>[] rawConstructor = beanClass.getDeclaredConstructors();
List<Constructor<?>> candidateRawConstructors = new ArrayList<Constructor<?>>();
for (Constructor<?> constructor : rawConstructor) {
if (!Modifier.isPrivate(constructor.getModifiers())) {
if (!constructor.isSynthetic()) {
candidateRawConstructors.add(constructor);
}
}