jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Goodwin (JIRA)" <j...@apache.org>
Subject [jira] Updated: (JCR-2891) VersionManagerImplRestore internalRestoreFrozen method has identity versus equals bug
Date Tue, 15 Feb 2011 23:52:57 GMT

     [ https://issues.apache.org/jira/browse/JCR-2891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Matt Goodwin updated JCR-2891:
------------------------------

    Status: Patch Available  (was: Open)

Index: VersionManagerImplRestore.java
===================================================================
--- VersionManagerImplRestore.java	(revision 1071104)
+++ VersionManagerImplRestore.java	(working copy)
@@ -554,7 +554,7 @@
                 NodeId nodeId = vh.getVersionableId();
                 if (stateMgr.hasItemState(nodeId)) {
                     restoredChild = state.getNode(nodeId);
-                    if (restoredChild.getParentId() == state.getNodeId()) {
+                    if (restoredChild.getParentId().equals(state.getNodeId())) {
                         // if same parent, ignore
                     } else if (removeExisting) {
                         NodeStateEx parent = restoredChild.getNode(restoredChild.getParentId());


> VersionManagerImplRestore internalRestoreFrozen method has identity versus equals bug
> -------------------------------------------------------------------------------------
>
>                 Key: JCR-2891
>                 URL: https://issues.apache.org/jira/browse/JCR-2891
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.2.2
>         Environment: Exists in 2.2.4 version of code base (as well as 2.3)
>            Reporter: Matt Goodwin
>             Fix For: 2.2.2
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> In method protected void internalRestoreFrozen(NodeStateEx state,
>                                          InternalFrozenNode freeze,
>                                          VersionSelector vsel,
>                                          Set<InternalVersion> restored,
>                                          boolean removeExisting,
>                                          boolean copy)
> in the VersionManagerImplRestore class line 557 the code performs an == instead of calling
the NodeId.equals() method.  We ran into problems with the code that executes below this (trying
to restore a folder node throws an ItemExistsException since same sibling not allowed on folder
nodes)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message