Here’s what needs to be changed
modifyMethod(String.format(MyClass.myMethod1(),arg1, arg2, arg3...));
Modify it to:
modifyMethod(MyClass,new Object[]{arg1, arg2, arg3...});
My solution:
Search template:
modifyMethod(String.format($MyClass$.myMethod1(),$Parameter$));
(where Count for $Parameter$ = [1, Unlimited])
Replace template: modifyMethod($MyClass$,new Object[]{$Parameter$});
(where Count for $Parameter$ = [1, Unlimited])
But there’s a problem that the commas inside the curly braces are gone.
for example,
modifyMethod(String.format(MyClass.myMethod1(),arg1, arg2, arg3));
modifyMethod(MyClass,new Object[]{arg1arg2arg3});
How should I fix this or if there is a better solution?
New contributor
user26867149 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.