stefan-egli commented on code in PR #1017:
URL: https://github.com/apache/jackrabbit-oak/pull/1017#discussion_r1257863251
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/core/MutableTree.java:
##########
@@ -264,11 +264,14 @@ void setParentAndName(@NotNull MutableTree parent,
@NotNull String name) {
* @param newName new name for this tree
*/
boolean moveTo(@NotNull MutableTree newParent, @NotNull String newName) {
- name = checkNotNull(newName);
- parent = checkNotNull(newParent);
+ checkNotNull(newName);
+ checkNotNull(newParent);
+ MutableTree oldParent = parent;
boolean success = nodeBuilder.moveTo(newParent.nodeBuilder, newName);
if (success) {
- parent.updateChildOrder(false);
+ name = newName;
+ parent = newParent;
Review Comment:
+1 to fixing this one as well - even though it doesn't fix anything, since
the MutableTree (source) is thrown away upon returning from `move` - but it was
wrong so far, so good to fix this anyway.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]