jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian Reschke (Created) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (JCR-3094) potential null pointer deref in SharedItemStateManager
Date Wed, 05 Oct 2011 16:55:35 GMT
potential null pointer deref in SharedItemStateManager
------------------------------------------------------

                 Key: JCR-3094
                 URL: https://issues.apache.org/jira/browse/JCR-3094
             Project: Jackrabbit Content Repository
          Issue Type: Task
            Reporter: Julian Reschke
            Priority: Minor


Code excerpt from validateModified:

                if (parentId != null && changeLog.has(parentId)) {
                    checkParent(changeLog, modifiedNodeState, parentId);
                }

                // Check whether this node is the root node
                if (parentId == null && oldParentId == null) {
                    // The root node can be ignored

                } else if (!parentId.equals(oldParentId)) {

                    // This node has been moved, check whether the parent has been modified
as well
                    if (changeLog.has(parentId)) {
                        checkParent(changeLog, modifiedNodeState, parentId);
                    } else if (!isShareable(modifiedNodeState)) {
                        String message = "New parent of node " + id + " is not present in
the changelog " + id;
                        log.error(message);
                        throw new ItemStateException(message);
                    }

In the else if case, it is assumed that parentId != null. Previously it was checked. If this
ok then it would be good to rearrange the code so it becomes more obvious why.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message