jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edgar Poce (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCR-85) Missing primaryType PropertyState on version history creation
Date Tue, 29 Mar 2005 05:35:16 GMT
Missing primaryType PropertyState on version history creation
-------------------------------------------------------------

         Key: JCR-85
         URL: http://issues.apache.org/jira/browse/JCR-85
     Project: Jackrabbit
        Type: Bug
    Reporter: Edgar Poce


When a version history is created the changelog passed to the persistent manager does not
contain a primaryType PropertyState for each NodeState added.

e.g. run NodeAddMixinTest.testAddSuccessfully() and check the ChangeLog in the PersistenceManager


Code that checks the sanity in the PersistenceManager

    /**
     * Checks sanity
     * 
     * @param changeLog
     */
    private void checkSanity(ChangeLog changeLog) throws ItemStateException
    {
        /*
         * check that every NodeState has its primaryType PropertyState
         */

        QName primaryType = Constants.JCR_PRIMARYTYPE;
        Iterator newNodes = changeLog.addedStates();
        while (newNodes.hasNext())
        {
            ItemState state = (ItemState) newNodes.next();
            if (state.isNode())
            {
                NodeState nodeState = (NodeState) state;
                try
                {
                    if (changeLog.get(new PropertyId(nodeState.getUUID(),
                                                     primaryType)) == null)
                    {
                        String msg = "No primary type for node: "
                                + nodeState.getUUID();
                        log.error(msg);
                        throw new ItemStateException(msg);
                    }
                } catch (NoSuchItemStateException e)
                {
                    String msg = "No primary type for node: "
                            + nodeState.getUUID();
                    log.error(msg);
                    throw new ItemStateException(msg);
                }
            }
        }
    }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message