提交 cbc7514c 编写于 作者: oldratlee's avatar oldratlee 🔥

avoid javassist method search indeterminacy

- use CtClass.getDeclaredMethod(String, CtClass[])
  instead of CtClass.getDeclaredMethod(String)
- javadoc of CtClass.getDeclaredMethod(String):
  If there are multiple methods with the specified name,
  then this method returns one of them.
上级 8c6e7061
......@@ -44,7 +44,7 @@ public class TtlForkJoinTransformlet implements JavassistTransformlet {
logger.info("add new field " + capturedFieldName + " to class " + className);
final String doExec_methodName = "doExec";
final CtMethod doExecMethod = clazz.getDeclaredMethod(doExec_methodName);
final CtMethod doExecMethod = clazz.getDeclaredMethod(doExec_methodName, new CtClass[0]);
final CtMethod new_doExecMethod = CtNewMethod.copy(doExecMethod, doExec_methodName, clazz, null);
// rename original doExec method, and set to private method(avoid reflect out renamed method unexpectedly)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册