jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian Reschke (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCR-3111) InternalVersionManagerBase; missing null check after getNode()
Date Thu, 13 Oct 2011 11:23:11 GMT

    [ https://issues.apache.org/jira/browse/JCR-3111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13126490#comment-13126490
] 

Julian Reschke commented on JCR-3111:
-------------------------------------

For instance, in getVersionHistoryOfNode:

    public InternalVersionHistory getVersionHistoryOfNode(NodeId id)
            throws RepositoryException {
        VersioningLock.ReadLock lock = acquireReadLock();
        try {
            String uuid = id.toString();
            Name name = getName(uuid);

            NodeStateEx parent = getParentNode(getHistoryRoot(), uuid, null);
            if (parent != null && parent.hasNode(name)) {
                NodeStateEx history = parent.getNode(name, 1);
                return getVersionHistory(history.getNodeId());
            } else {
                throw new ItemNotFoundException("Version history of node " + id + " not found.");
            }
        } finally {
            lock.release();
        }
    }
                
> InternalVersionManagerBase; missing null check after getNode()
> --------------------------------------------------------------
>
>                 Key: JCR-3111
>                 URL: https://issues.apache.org/jira/browse/JCR-3111
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, versioning
>            Reporter: Julian Reschke
>
> There are at least two instances where we check for a node with hasNode(), and then call
getNode() without checking for null.

--
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