You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/11/13 05:56:00 UTC

[jira] [Updated] (ZOOKEEPER-4001) AuditHelper.addAuditLog(...) more readable

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

ASF GitHub Bot updated ZOOKEEPER-4001:
--------------------------------------
    Labels: pull-request-available  (was: )

> AuditHelper.addAuditLog(...) more readable
> ------------------------------------------
>
>                 Key: ZOOKEEPER-4001
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4001
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: server
>            Reporter: zengchao
>            Priority: Trivial
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {code:java}
> if (failedTxn) {
>     CreateRequest createRequest = new CreateRequest();
>     deserialize(request, createRequest);
>     path = createRequest.getPath();
>     createMode =
>             getCreateMode(createRequest);
> } else {
>     createMode = getCreateMode(request);
> }
> {code}
> may modified to 
> {code:java}
> CreateRequest createRequest = new CreateRequest();
> deserialize(request, createRequest);
> createMode = getCreateMode(createRequest);
> if (failedTxn) {
>     path = createRequest.getPath();
> }
> {code}
> the getCreateMode(request) is this
> {code:java}
> private static String getCreateMode(Request request) throws IOException, KeeperException {
>     CreateRequest createRequest = new CreateRequest();
>     deserialize(request, createRequest);
>     return getCreateMode(createRequest);
> }
> {code}
> is this change more readable?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)