How to replace or wrap a method argument by a new argument of same type using ASM Java bytecode library?

huangapple 未分类评论49阅读模式
英文:

How to replace or wrap a method argument by a new argument of same type using ASM Java bytecode library?

问题

在我的项目中,有一个要求是用同样类型的新参数替换或包装方法参数。

例如,

public ArrayList doSubmit(java.lang.Runnable runnableObj){
 runnableObj = wrapObject(runnableObj);
 ........
}

我必须用另一个同样是 java.lang.Runnable 类型的对象替换 runnableObj

英文:

There is a requirement in my project to replace or wrap a method argument by a new argument of same type.

For example,

public ArrayList doSubmit(java.lang.Runnable runnableObj){
 runnableObj = wrapObject(runnableObj);
 ........
}

I have to replace the runnableObj by another object which is also java.lang.Runnable

huangapple
  • 本文由 发表于 2020年5月29日 19:20:48
  • 转载请务必保留本文链接:https://java.coder-hub.com/62084758.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定