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

angela edited comment on OAK-3191 at 8/6/15 8:09 PM:
-----------------------------------------------------

[~marett], thanks for spotting this. in case of doubt i would rather adopt the 
same behavior than we had in jackrabbit... in particular since creating a user 
with null/empty id throws illegalargumentexception. but i will take a closer 
look again; in any case i don't recall having made this a deliberate break wrt 
jackrabbit behavior.

btw: changed prio to minor. afaik the API contract doesn't specify how to deal 
with null/empty id and therefore we have IMHO no major misbehavior.


was (Author: anchela):
[~marett], thanks for spotting this. in case of doubt i would rather adopt the 
same behavior than we had in jackrabbit... in particular since creating a user 
with null/empty id throws illegalargumentexception. but i will take a closer 
look again; in any case i don't recall having made this a deliberate break wrt 
jackrabbit behavior.

> Oak UserManager#getAuthorizable handles null and empty string differently 
> than Jackrabbit
> -----------------------------------------------------------------------------------------
>
>                 Key: OAK-3191
>                 URL: https://issues.apache.org/jira/browse/OAK-3191
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.3.2
>            Reporter: Timothee Maret
>            Assignee: angela
>            Priority: Minor
>         Attachments: OAK-3191.patch
>
>
> With Jackrabbit, the following API call
> {code}
> UserManager#getAuthorizable(String auth)
> {code}
> with either {{null}} or {{""}} used to throw
> {code}
> throw new IllegalArgumentException("Invalid authorizable name '" + id + "'");
> {code}
> With Oak UserManager, the same input does not throw an IAE, but instead 
> return a {{null}} value when providing {{""}} and throws a NPE when providing 
> {{null}}.
> From my POV, it would be best to avoid throwing exceptions on those two 
> cases. Indeed, returning a {{null}} value is simpler for the API user and 
> would comply with the API.
> If so, the implementation in case of {{null}} may be changed in order to 
> swallow the {{null}} value and the difference between Jackrabbit and Oak may 
> be documented.



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

Reply via email to