gumtree
gumtree copied to clipboard
Suggestion for enhanching the edit script
Hi! I have a suggestion for an improvement in the edit script.
Consider these two files: left
import java.util.LinkedList;
import java.util.Queue;
class TreeTraversal {
class TreeNode {
public int val;
public TreeNode left;
public TreeNode right;
public TreeNode(int val) {
this.val = val;
}
}
}
right
import java.util.LinkedList;
import java.util.Queue;
class TreeTraversal {
class TreeNode {
public int val;
public TreeNode left;
public TreeNode right;
public TreeNode(int val) {
this.val = val;
left = right = null;
}
public TreeNode(int val, TreeNode left, TreeNode right) {
this.val = val;
this.left = left;
this.right = right;
}
}
}
Its diff is shown as:
I think the move operation of this.val = val;
is not necessary. It should be kept as-is for the first constructor. Can this be improved by fixing the ChawatheScriptGenerator
?
Hi!
Thanks for the case.
It's awkward that's it's matching with the statement from the second constructor. I will investigate why.
Cheers.
Tried it with the latest version, but cannot reproduce it. Please reopen if it's still there.