
获得徽章 9
赞了这篇文章
赞了这篇文章
赞了这篇文章
赞了这篇文章
赞了这篇文章
赞了这篇文章
赞了这篇沸点
赞了这篇文章
赞了这篇文章
赞了这篇沸点
ByteBuddy如果想做个类让人继承,构造方法不能做成空方法,要显式调用super才行".defineConstructor()
.withParameters(int.class)
.intercept(StubMethod.INSTANCE);"错误,
.defineConstructor(Visibility.PUBLIC)
.withParameters(int.class)
.intercept(MethodCall.invoke(Object.class.getConstructor()).onSuper());正确
.withParameters(int.class)
.intercept(StubMethod.INSTANCE);"错误,
.defineConstructor(Visibility.PUBLIC)
.withParameters(int.class)
.intercept(MethodCall.invoke(Object.class.getConstructor()).onSuper());正确
展开
评论
1