Skip to content

Conversation

@sel-fish
Copy link
Contributor

Missing String.format.

try {
LOG.info("Attempting to delete candidate container: %s",
containerPath);
LOG.info(String.format("Attempting to delete candidate container: %s",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this a log message you could use
LOG.info("Attempting to delete candidate container: {}", container Path);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to use the same logging style as the other code.

            LOG.error(String.format("Could not delete container: %s" ,
                    containerPath), e);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for @eribeiro
We already use that form at various places in the codebase, so feel free to use the better one. Existing String.formats should be refactored in the long term, but that probably will happen in small refactorings like this.

Copy link
Contributor

@anmolnar anmolnar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @sel-fish
It seems like a very nice catch.

try {
LOG.info("Attempting to delete candidate container: %s",
containerPath);
LOG.info(String.format("Attempting to delete candidate container: %s",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for @eribeiro
We already use that form at various places in the codebase, so feel free to use the better one. Existing String.formats should be refactored in the long term, but that probably will happen in small refactorings like this.

Copy link
Contributor

@anmolnar anmolnar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 lgtm

@eribeiro
Copy link
Contributor

+1 lgtm

@asfgit asfgit closed this in 8cfca3a Mar 26, 2018
asfgit pushed a commit that referenced this pull request Mar 26, 2018
Missing `String.format`.

Author: sel-fish <fqlgy@hotmail.com>

Reviewers: Edward Ribeiro <edward.ribeiro@gmail.com>, Andor Molnár <andor@cloudera.com>, Michael Han <hanm@apache.org>, maoling <maoling199210191@sina.com>

Closes #492 from sel-fish/ZOOKEEPER-3001

(cherry picked from commit 8cfca3a)
Signed-off-by: Michael Han <hanm@apache.org>
lvfangmin pushed a commit to lvfangmin/zookeeper that referenced this pull request Jun 17, 2018
Missing `String.format`.

Author: sel-fish <fqlgy@hotmail.com>

Reviewers: Edward Ribeiro <edward.ribeiro@gmail.com>, Andor Molnár <andor@cloudera.com>, Michael Han <hanm@apache.org>, maoling <maoling199210191@sina.com>

Closes apache#492 from sel-fish/ZOOKEEPER-3001
@sel-fish sel-fish deleted the ZOOKEEPER-3001 branch April 25, 2019 11:04
RokLenarcic pushed a commit to RokLenarcic/zookeeper that referenced this pull request Sep 3, 2022
Missing `String.format`.

Author: sel-fish <fqlgy@hotmail.com>

Reviewers: Edward Ribeiro <edward.ribeiro@gmail.com>, Andor Molnár <andor@cloudera.com>, Michael Han <hanm@apache.org>, maoling <maoling199210191@sina.com>

Closes apache#492 from sel-fish/ZOOKEEPER-3001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants