mbaedke commented on code in PR #1146:
URL: https://github.com/apache/jackrabbit-oak/pull/1146#discussion_r1363366658


##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java:
##########
@@ -285,8 +287,32 @@ private void restoreFrozen(@NotNull NodeBuilder frozen,
                                @NotNull NodeBuilder dest,
                                @NotNull VersionSelector selector)
             throws RepositoryException, CommitFailedException {
-        // 15.7.2 Restoring Type and Identifier
-        restoreFrozenTypeAndUUID(frozen, dest);
+        //OAK-9459: if the NodeState is not empty, retrieve OPVs before 
restoring types to avoid constraint violations
+        boolean frozenTypeRestored = false;
+        if (!dest.hasProperty(JCR_PRIMARYTYPE)) {
+            // empty NodeState
+            // 15.7.2 Restoring Type and Identifier
+            restoreFrozenTypeAndUUID(frozen, dest);
+            frozenTypeRestored = true;
+        }
+        HashMap<PropertyState, Integer> opvs = new HashMap<>();

Review Comment:
   It's completely irrelevant here, but as you wish.



-- 
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-unsubscr...@jackrabbit.apache.org

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

Reply via email to