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

angela commented on OAK-3191:
-----------------------------

it's just a high concern not the highest :-)
since your report subject stressed the fact that it's different from Jackrabbit 
2.x, i wanted to address this in the first place. as far as the API is 
concerned: even today's solution complies with the API as it doesn't make any 
statements about 'illegal' ids and how to handle them. nor does the API come 
with annotations. creating a user with empty or null ID however is forbidden 
with {{IllegalArgumentException}}, so one might argue that it's consistent to 
behave the same for {{getAuthorizable}}.

but i can also live with returning {{null}} for both empty and null id.

> 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, 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