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 2016/05/11 16:14:12 UTC

[jira] [Created] (OAK-4363) SyncMBeanImpl: result lacks 'uid' if error messages has been created from ExternalIdentityRef

angela created OAK-4363:
---------------------------

             Summary: SyncMBeanImpl: result lacks 'uid' if error messages has been created from ExternalIdentityRef
                 Key: OAK-4363
                 URL: https://issues.apache.org/jira/browse/OAK-4363
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: auth-external
            Reporter: angela
            Priority: Minor


while writing tests for the SyncMBeanImpl I noticed the following method in the {{Delegatee}} that writes a sync-result for an error based on an {{ExternalIdentityRef}} but sets the 'uid' to empty string:

{code}
private static void append(@Nonnull List<String> list, @Nonnull ExternalIdentityRef idRef, @Nonnull Exception e) {
        String eid = JsonUtil.getJsonString(idRef.getString());
        String msg = JsonUtil.getJsonString(e.toString());
        String jsonStr = String.format("{op:\"ERR\",uid:\"\",eid:%s,msg:%s}", eid, msg);
        list.add(jsonStr);
    }
{code}

so, I was wondering why the 'uid' is not retrieved from the {{ExternalIdentityRef}} object passed to the method. Something like:

{code}
private static void append(@Nonnull List<String> list, @Nonnull ExternalIdentityRef idRef, @Nonnull Exception e) {
        String uid = JsonUtil.getJsonString(idRef.getId());
        String eid = JsonUtil.getJsonString(idRef.getString());
        String msg = JsonUtil.getJsonString(e.toString());
        String jsonStr = String.format("{op:\"ERR\",uid:%s,eid:%s,msg:%s}", uid, eid, msg);
        list.add(jsonStr);
    }

[~tripod], was there a particular reason for setting 'uid' to empty string?
or in other words: what was the drawback of setting the uid as exposed by {{ExternalIdentityRef.getID()}}?



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