Add empty judgment for constructorInterceptPoint (#732)
This commit is contained in:
parent
2059fd4cb7
commit
cb764a7849
|
|
@ -12,6 +12,7 @@ Release Notes.
|
|||
* Add async-profiler feature for performance analysis
|
||||
* Support db.instance tag,db.collection tag and AggregateOperation span for mongodb plugin(3.x/4.x)
|
||||
* Improve CustomizeConfiguration by avoiding repeatedly resolve file config
|
||||
* Add empty judgment for constructorInterceptPoint
|
||||
|
||||
All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/222?closed=1)
|
||||
|
||||
|
|
|
|||
|
|
@ -112,17 +112,20 @@ public abstract class ClassEnhancePluginDefine extends AbstractClassEnhancePlugi
|
|||
*/
|
||||
if (existedConstructorInterceptPoint) {
|
||||
for (ConstructorInterceptPoint constructorInterceptPoint : constructorInterceptPoints) {
|
||||
String constructorInterceptor = constructorInterceptPoint.getConstructorInterceptor();
|
||||
if (StringUtil.isEmpty(constructorInterceptor)) {
|
||||
throw new EnhanceException("no InstanceConstructorInterceptor define to enhance class " + enhanceOriginClassName);
|
||||
}
|
||||
if (isBootstrapInstrumentation()) {
|
||||
newClassBuilder = newClassBuilder.constructor(constructorInterceptPoint.getConstructorMatcher())
|
||||
.intercept(SuperMethodCall.INSTANCE.andThen(MethodDelegation.withDefaultConfiguration()
|
||||
.to(BootstrapInstrumentBoost
|
||||
.forInternalDelegateClass(constructorInterceptPoint
|
||||
.getConstructorInterceptor()))));
|
||||
.intercept(SuperMethodCall.INSTANCE.andThen(MethodDelegation.withDefaultConfiguration()
|
||||
.to(BootstrapInstrumentBoost
|
||||
.forInternalDelegateClass(constructorInterceptor))));
|
||||
} else {
|
||||
newClassBuilder = newClassBuilder.constructor(constructorInterceptPoint.getConstructorMatcher())
|
||||
.intercept(SuperMethodCall.INSTANCE.andThen(MethodDelegation.withDefaultConfiguration()
|
||||
.to(new ConstructorInter(getPluginName(), constructorInterceptPoint
|
||||
.getConstructorInterceptor(), classLoader), delegateNamingResolver.resolve(constructorInterceptPoint))));
|
||||
.intercept(SuperMethodCall.INSTANCE.andThen(MethodDelegation.withDefaultConfiguration()
|
||||
.to(new ConstructorInter(getPluginName(), constructorInterceptor, classLoader),
|
||||
delegateNamingResolver.resolve(constructorInterceptPoint))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue