Replaces the original node's label with new one provided in
aLabel argument. Throws IllegalArgumentException if
node's kind is invalid. Valid node's kinds are:
BREAK, CLASS, CONTINUE, IDENTIFIER, LABELED_STATEMENT,
MEMBER_SELECT, METHOD, TYPE_PARAMETER, VARIABLE, MEMBER_REFERENCE (since 0.112).
Consider you want to change name of method fooMet to
fooMethod:
public void fooMet() throws java.io.IOException {
...
}
You can get it e.g. with this code:
MethodTree footMet = contains footMet tree;
MethodTree fooMethod = make.setLabel(fooMet, "fooMethod");
workingCopy.rewrite(node, njuMethod);
This code will result to:
public void fooMethod() throws java.io.IOException {
...
}