Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-4363

SyncMBeanImpl: result lacks 'uid' if error messages has been created from ExternalIdentityRef

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.5.2, 1.6.0
    • auth-external
    • None

    Description

      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:

      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);
          }
      

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

      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()?

      Attachments

        Issue Links

          Activity

            People

              angela Angela Schreiber
              angela Angela Schreiber
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: