You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "mreutegg (via GitHub)" <gi...@apache.org> on 2023/07/05 13:17:10 UTC

[GitHub] [jackrabbit-oak] mreutegg opened a new pull request, #1017: OAK-10340: Child order not updated on source after move

mreutegg opened a new pull request, #1017:
URL: https://github.com/apache/jackrabbit-oak/pull/1017

   (no comment)


-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [jackrabbit-oak] mreutegg commented on a diff in pull request #1017: OAK-10340: Child order not updated on source after move

Posted by "mreutegg (via GitHub)" <gi...@apache.org>.
mreutegg commented on code in PR #1017:
URL: https://github.com/apache/jackrabbit-oak/pull/1017#discussion_r1257949982


##########
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:
   Done with https://github.com/apache/jackrabbit-oak/pull/1017/commits/f23db0f19ea64d82f7fb771467ba75626f63aaf7



-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [jackrabbit-oak] mreutegg commented on a diff in pull request #1017: OAK-10340: Child order not updated on source after move

Posted by "mreutegg (via GitHub)" <gi...@apache.org>.
mreutegg commented on code in PR #1017:
URL: https://github.com/apache/jackrabbit-oak/pull/1017#discussion_r1257905392


##########
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:
   Right. I forgot to mention this. I'll add a note to the JIRA issue.



-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [jackrabbit-oak] mreutegg commented on a diff in pull request #1017: OAK-10340: Child order not updated on source after move

Posted by "mreutegg (via GitHub)" <gi...@apache.org>.
mreutegg commented on code in PR #1017:
URL: https://github.com/apache/jackrabbit-oak/pull/1017#discussion_r1257926411


##########
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:
   And I'm going to add a test for this.



-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [jackrabbit-oak] stefan-egli commented on a diff in pull request #1017: OAK-10340: Child order not updated on source after move

Posted by "stefan-egli (via GitHub)" <gi...@apache.org>.
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [jackrabbit-oak] mreutegg merged pull request #1017: OAK-10340: Child order not updated on source after move

Posted by "mreutegg (via GitHub)" <gi...@apache.org>.
mreutegg merged PR #1017:
URL: https://github.com/apache/jackrabbit-oak/pull/1017


-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org