最近、すべての ComponentClassTransformWorker を ComponentClassTransformWorker2s に更新したところ、バグが発生しました。したがって、LukesComponentClassTransformWorker2と呼ばれる新しい ComponentClassTransformWorker2 メソッドを作成するには、次のようなものを使用します。
PlasticMethod plasticMethod = plasticClass.introduceMethod("defaultValidate");
MethodAdvice advice = new MethodAdvice(){
@Override
public void advise(MethodInvocation invocation) {
invocation.proceed();
environment.push(MenuContext.class, context);
}
};
plasticMethod.addAdvice(advice);
その後、後のワーカー (私の場合、Tapestry に組み込まれている ParameterWorker) が PlasticClass.getMethods() を使用してこれを検索し、 plasticClass.getMethods() が「導入された」メソッドを返さないため、それが見つかりません。
BridgeClassTransformationは単に内部で PlasticClass.getMethods() を使用するため、この変更により非推奨の ComponentClassTransformationWorker の実装が壊れることもあります。
public List<TransformMethod> matchMethods(Predicate<TransformMethod> predicate)
{
return F.flow(plasticClass.getMethods()).map(toTransformMethod).filter(predicate).toList();
}
これは重大な変更であり、フィールドにも当てはまるように思われるため、私にはバグのように思えます。クラスのメソッド/フィールドの検索には、導入されたメソッド/フィールドも含めるべきではありませんか?