@@ -112,17 +112,20 @@ protected DynamicType.Builder<?> enhanceInstance(TypeDescription typeDescription
112112 */
113113 if (existedConstructorInterceptPoint ) {
114114 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+ }
115119 if (isBootstrapInstrumentation ()) {
116120 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 ))));
121124 } else {
122125 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 ))));
126129 }
127130 }
128131 }
0 commit comments