You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "angela (JIRA)" <ji...@apache.org> on 2015/08/11 10:58:46 UTC

[jira] [Resolved] (OAK-3191) Oak UserManager#getAuthorizable handles null and empty string differently than Jackrabbit

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

angela resolved OAK-3191.
-------------------------
       Resolution: Fixed
    Fix Version/s: 1.3.4

[~marett], i applied the second patch at r1695231 avoiding runtime exceptions (but consequently making oak behave differently than jackrabbit 2.x). the fix not only applies to retrieving authorizables by ID but also for lookup by principal.

additionally, i mentioned the different behavior in the 'differences wrt jackrabbit 2.x' section in the documentation.

Timothee, thanks a lot for reporting and the initial patch.

> 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
>             Fix For: 1.3.4
>
>         Attachments: OAK-3191.patch, OAK-3191.patch, OAK-3191_2.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)