jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mueller (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OAK-5260) Incorrect handling of subpaths with leading left curly bracket
Date Thu, 15 Dec 2016 13:05:58 GMT

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

Thomas Mueller commented on OAK-5260:
-------------------------------------

The current behavior of the JcrPathParser is quite strange for slightly unusual paths. This
patch partially fixes that, but a lot of weirdness remains. For example, the parser sometimes
returns an empty string (which probably means "current node" but is not documented), or ignores
some elements sometimes, and in other cases returns null (meaning invalid). For example, "."
becomes "" (the current node), "x/." becomes "x", "/" remains "/" (the root node). But "/."
and "/x/.." become "" (the current node). I don't understand that logic, it seems arbitrary.
Other cases are more weird, for example "}{" becomes "" (the current node), but "}" stays
"}", and "/parent/}{/child" is invalid. And "/[." becomes the current node, but "[." doesn't,
and so on.

There is a risk that the attached patch breaks backwards compatibility in some weird cases
(that are most likely anyway not spec compliant). But at least the patch fixes the problem
of completely swallowing parts of the path, and it seems to fix that consistently, correctly,
and fully (according to my tests).

I suggest we apply the patch, but don't try to fix other broken or weird cases. And for Oak
1.7, I will rewrite the parsers, add test cases and documentation, and try to find and fix
compatibility issues.

> Incorrect handling of subpaths with leading left curly bracket
> --------------------------------------------------------------
>
>                 Key: OAK-5260
>                 URL: https://issues.apache.org/jira/browse/OAK-5260
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: jcr
>            Reporter: Bertrand Delacretaz
>            Assignee: Julian Sedding
>             Fix For: 1.6
>
>         Attachments: OAK-5260-jsedding.patch, OAK-5260.patch
>
>
> As per SLING-6383 it looks like the Oak name mapping causes for example getItem("/libs/{sub")
(with a left curly bracket in the path) to return the /libs node if that exists but the supplied
path does not.
> I'll attach a patch with a test that demonstrates this. 
> [~fmeschbe] mentions in that Sling issue that the parsing of the CR 2 section 3.2.5.1
Expanded Form could be involved, treating the left curly bracket in a special way that's not
appropriate here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message