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

AuditHelper.addAuditLog(...) more readable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • None
    • 3.8.0
    • 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

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