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

Tobias Bocanegra commented on OAK-1624:
---------------------------------------

bq. proposed fix
A whitespace "in" the name is valid. eg: "jcr:con\tent"

bq. IMO the path mapper is the wrong place for validation like this. Instead a 
better place to guard against such names would be in the NameValidator class.

IIUC, the NameValidator is only used on commit. But IMO all 'reading' methods 
should also throw a IllegalNameException (e.g. {{session.nodeExists("/content 
")}} )

> Item names with trailing spaces should not be allowed
> -----------------------------------------------------
>
>                 Key: OAK-1624
>                 URL: https://issues.apache.org/jira/browse/OAK-1624
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core, jcr
>            Reporter: Tobias Bocanegra
>            Priority: Blocker
>             Fix For: 0.20
>
>         Attachments: OAK-1624.patch
>
>
> the following should fail:
> {code}
>         Node hello = session.getRootNode().addNode("hello");
>         session.save();
>         Node illegal = hello.addNode("test "); <-- here
>         session.save();
>         assertEquals("/hello/test ", illegal.getPath()); <-- and here
>         Node other = session.getNode("/hello/test "); <-- and here
>         assertTrue(other.isSame(illegal));
>         assertTrue(session.nodeExists("/hello/test ")); <-- and here
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to