jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg (JIRA)" <j...@apache.org>
Subject [jira] [Created] (JCR-2967) SessionItemStateManager.getIdOfRootTransientNodeState() may cause NPE
Date Mon, 09 May 2011 14:45:03 GMT
SessionItemStateManager.getIdOfRootTransientNodeState() may cause NPE
---------------------------------------------------------------------

                 Key: JCR-2967
                 URL: https://issues.apache.org/jira/browse/JCR-2967
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-core
    Affects Versions: 2.2.5, 2.2.4, 2.2.2, 2.2.1, 2.2.0, 2.1.3, 2.1.2, 2.1.1, 2.1.0, 2.0.3,
2.0.0
            Reporter: Stefan Guggisberg
             Fix For: 2.3.0


regression of JCR-2425

in certain scenarios, calling SessionItemStateManager.getIdOfRootTransientNodeState() may
cause a NPE.

Test case: 

        Repository repository = new TransientRepository(); 
        Session session = repository.login( 
                new SimpleCredentials("admin", "admin".toCharArray())); 
        Session session2 = repository.login( 
                new SimpleCredentials("admin", "admin".toCharArray())); 

        try { 
            while (session.getRootNode().hasNode("test")) { 
                session.getRootNode().getNode("test").remove(); 
            } 
            Node test = session.getRootNode().addNode("test"); 
            session.save(); 
            Node x = test.addNode("x"); 
            session.save(); 

            Node x2 = session2.getRootNode().getNode("test").getNode("x"); 
            x2.remove(); 
            x.addNode("b"); 
            session2.save(); 
            session.save(); // throws NPE 
        } finally { 
            session.logout(); 
            session2.logout(); 
        }

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

Mime
View raw message