jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berry van Halderen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (JCR-2675) Node.hasProperty() with relative path can throw ClassCastException
Date Thu, 15 Jul 2010 13:29:50 GMT

     [ https://issues.apache.org/jira/browse/JCR-2675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Berry van Halderen updated JCR-2675:
------------------------------------

    Attachment: IssueTest.java

The following unit test shows the problem, although as indicated, the issue has broader consequences.
IssueTest can be placed in jackrabbit-core/src/test/java/org/apache/jackrabbit/core/IssueTest.java
and when run will throw the ClassCastException.


> Node.hasProperty() with relative path can throw ClassCastException
> ------------------------------------------------------------------
>
>                 Key: JCR-2675
>                 URL: https://issues.apache.org/jira/browse/JCR-2675
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.5.7, 1.6.2, 2.0.0, 2.1.0
>            Reporter: Berry van Halderen
>         Attachments: IssueTest.java
>
>
> Calling Node.hasProperty() with a relative path that traverses higher than the root node
will throw a ClassCastException because the ItemId returned by HierarchyManagerImpl.resolvePath()
will be the root node id.  The blind cast in the HierarchyManagerImpl.resolvePropertyPath()
will then throw the ClassCastException.  This issue is not just with hasProperty/resolvePropertyPath,
but any call to resolvePath that goes higher than the root node, will wrongfully get the root
node id returned as result.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message