Jackrabbit Content Repository
  1. Jackrabbit Content Repository
  2. JCR-2648

PropertyImpl.getNode() and NamePropertyTest use different exception than documented in the JCR API JavaDoc



      The Property.getNode() method's JavaDoc [1] lists 3 types of exceptions: ValueFormatException, ItemNotFoundException, and RepositoryException, and that ItemNotFoundException is to be thrown when the target node could not be found. However, the NamePropertyTest.testGetProperty() method is checking for a PathNotFoundException rather than the documented ItemNotFoundException (see [2], line 189). Jackrabbit's implementation in PropertyImpl (see [3] line 539) delegates to Session.getNode(absolutePath) or Property.getParent().getNode(relativePath), and these methods are documented as throwing PathNotFoundException (see [4] and [5]).

      Therefore, the unit test and PropertyImpl.getNode() implementation appear to be in disagreement with the JCR 2.0 API JavaDoc.

      [1] http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Property.html#getNode()
      [2] http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NamePropertyTest.java?revision=772352&view=markup
      [3] http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java?revision=948827&view=markup
      [4] http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Session.html#getNode(java.lang.String)
      [5] http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Node.html#getNode(java.lang.String)


        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        2d 21h 16m 1 Stefan Guggisberg 07/Jun/10 15:32
        Resolved Resolved Closed Closed
        472d 22h 50m 1 Jukka Zitting 23/Sep/11 14:23
        Jukka Zitting made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Stefan Guggisberg made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.2.0 [ 12314844 ]
        Resolution Fixed [ 1 ]
        Stefan Guggisberg added a comment -

        fixed in svn r952269

        thanks for reporting this issue!

        Stefan Guggisberg added a comment - fixed in svn r952269 thanks for reporting this issue!
        Stefan Guggisberg made changes -
        Field Original Value New Value
        Assignee Stefan Guggisberg [ stefan@jira ]
        Randall Hauch created issue -


          • Assignee:
            Stefan Guggisberg
            Randall Hauch
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: