@@ -112,17 +112,20 @@ protected DynamicType.Builder<?> enhanceInstance(TypeDescription typeDescription
112
112
*/
113
113
if (existedConstructorInterceptPoint ) {
114
114
for (ConstructorInterceptPoint constructorInterceptPoint : constructorInterceptPoints ) {
115
+ String constructorInterceptor = constructorInterceptPoint .getConstructorInterceptor ();
116
+ if (StringUtil .isEmpty (constructorInterceptor )) {
117
+ throw new EnhanceException ("no InstanceConstructorInterceptor define to enhance class " + enhanceOriginClassName );
118
+ }
115
119
if (isBootstrapInstrumentation ()) {
116
120
newClassBuilder = newClassBuilder .constructor (constructorInterceptPoint .getConstructorMatcher ())
117
- .intercept (SuperMethodCall .INSTANCE .andThen (MethodDelegation .withDefaultConfiguration ()
118
- .to (BootstrapInstrumentBoost
119
- .forInternalDelegateClass (constructorInterceptPoint
120
- .getConstructorInterceptor ()))));
121
+ .intercept (SuperMethodCall .INSTANCE .andThen (MethodDelegation .withDefaultConfiguration ()
122
+ .to (BootstrapInstrumentBoost
123
+ .forInternalDelegateClass (constructorInterceptor ))));
121
124
} else {
122
125
newClassBuilder = newClassBuilder .constructor (constructorInterceptPoint .getConstructorMatcher ())
123
- .intercept (SuperMethodCall .INSTANCE .andThen (MethodDelegation .withDefaultConfiguration ()
124
- .to (new ConstructorInter (getPluginName (), constructorInterceptPoint
125
- . getConstructorInterceptor (), classLoader ), delegateNamingResolver .resolve (constructorInterceptPoint ))));
126
+ .intercept (SuperMethodCall .INSTANCE .andThen (MethodDelegation .withDefaultConfiguration ()
127
+ .to (new ConstructorInter (getPluginName (), constructorInterceptor , classLoader ),
128
+ delegateNamingResolver .resolve (constructorInterceptPoint ))));
126
129
}
127
130
}
128
131
}
0 commit comments