Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-4001

AuditHelper.addAuditLog(...) more readable

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.8.0
    • Component/s: server

      Description

      if (failedTxn) {
          CreateRequest createRequest = new CreateRequest();
          deserialize(request, createRequest);
          path = createRequest.getPath();
          createMode =
                  getCreateMode(createRequest);
      } else {
          createMode = getCreateMode(request);
      }
      

      may modified to 

      CreateRequest createRequest = new CreateRequest();
      deserialize(request, createRequest);
      createMode = getCreateMode(createRequest);
      if (failedTxn) {
          path = createRequest.getPath();
      }
      

      the getCreateMode(request) is this

      private static String getCreateMode(Request request) throws IOException, KeeperException {
          CreateRequest createRequest = new CreateRequest();
          deserialize(request, createRequest);
          return getCreateMode(createRequest);
      }
      

      is this change more readable?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              zengchao zengchao
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1.5h
                1.5h