Netflix-Skunkworks / rewrite

Distributed code search and refactoring for Java
Apache License 2.0
290 stars 30 forks source link

Update wiki on changing method targets #16

Open gunnarmorling opened 7 years ago

gunnarmorling commented 7 years ago

The wiki has this example:

Tr.CompilationUnit cu = parser.parse(asList(a, b)).get(1);
String diff = cu.refactor()
    .changeMethodTarget(cu.findMethodCalls("A1 foo()"), "a2")
    .diff();

changeMethodTarget() expects a NamedVar instead of String as second parameter, though. How do I obtain a NamedVar instance for a simple field name?

I hope you don't mind opening me all these issues, but I thought I'd report whatever I notice while exploring this project a bit ;)