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

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

Actually, NodeStateEx.getNode(name, ...) *only* returns null if the child node 
entry is not found:

        ChildNodeEntry entry = nodeState.getChildNodeEntry(name, index);
        if (entry == null) {
            return null;
        }

...otherwise it throws. So if the NPE happens in getVersionHistoryOfNode (and 
it has...), this indicates that some strange is happening which can't even be 
explained by inconsistent storage. 

So a better approach seems to be to simply add null checks, and add better 
diagnostics for now. Maybe this will help understanding what's going on next 
time it happens.
                
> 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
>            Assignee: Julian Reschke
>         Attachments: JCR-3111.patch
>
>
> 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

        

Reply via email to