fix #69
This commit is contained in:
parent
a9c14f85e8
commit
29fa490b4c
|
|
@ -65,6 +65,11 @@ public abstract class ClassEnhancePluginDefine extends AbstractClassEnhancePlugi
|
|||
/**
|
||||
* 2. enhance constructors
|
||||
*/
|
||||
newClassBuilder = newClassBuilder.constructor(ElementMatchers.<MethodDescription>any())
|
||||
.intercept(SuperMethodCall.INSTANCE.andThen(
|
||||
MethodDelegation.to(new DefaultClassConstructorInterceptor())
|
||||
.appendParameterBinder(FieldProxy.Binder.install(FieldGetter.class, FieldSetter.class))));
|
||||
|
||||
if (existedConstructorInterceptPoint) {
|
||||
for (ConstructorInterceptPoint constructorInterceptPoint : constructorInterceptPoints) {
|
||||
newClassBuilder = newClassBuilder.constructor(constructorInterceptPoint.getConstructorMatcher())
|
||||
|
|
@ -72,13 +77,6 @@ public abstract class ClassEnhancePluginDefine extends AbstractClassEnhancePlugi
|
|||
MethodDelegation.to(new ClassConstructorInterceptor(constructorInterceptPoint.getConstructorInterceptor()))
|
||||
.appendParameterBinder(FieldProxy.Binder.install(FieldGetter.class, FieldSetter.class))));
|
||||
}
|
||||
} else {
|
||||
for (ConstructorInterceptPoint constructorInterceptPoint : constructorInterceptPoints) {
|
||||
newClassBuilder = newClassBuilder.constructor(ElementMatchers.<MethodDescription>any())
|
||||
.intercept(SuperMethodCall.INSTANCE.andThen(
|
||||
MethodDelegation.to(new DefaultClassConstructorInterceptor(constructorInterceptPoint.getConstructorInterceptor()))
|
||||
.appendParameterBinder(FieldProxy.Binder.install(FieldGetter.class, FieldSetter.class))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -15,12 +15,6 @@ public class DefaultClassConstructorInterceptor {
|
|||
private static ILog logger = LogManager
|
||||
.getLogger(ClassConstructorInterceptor.class);
|
||||
|
||||
private String instanceMethodsAroundInterceptorClassName;
|
||||
|
||||
public DefaultClassConstructorInterceptor(String instanceMethodsAroundInterceptorClassName) {
|
||||
this.instanceMethodsAroundInterceptorClassName = instanceMethodsAroundInterceptorClassName;
|
||||
}
|
||||
|
||||
@RuntimeType
|
||||
public void intercept(
|
||||
@This Object obj,
|
||||
|
|
|
|||
Loading…
Reference in New Issue