Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra format argument to String.format call in SessionPool #3054

Open
cushon opened this issue Apr 20, 2024 · 0 comments
Open

Extra format argument to String.format call in SessionPool #3054

cushon opened this issue Apr 20, 2024 · 0 comments
Assignees
Labels
api: spanner Issues related to the googleapis/java-spanner API.

Comments

@cushon
Copy link

cushon commented Apr 20, 2024

This code is passing an argument to String.format that is ignored, because the string doesn't have any format specifiers:

logger.log(
Level.WARNING,
String.format(
"Failed to create multiplexed session. "
+ "Pending replacing stale multiplexed session",
t));

The intent may have been:

 logger.log( 
     Level.WARNING, 
     "Failed to create multiplexed session. " 
         + "Pending replacing stale multiplexed session", 
     t); 

This bug was caught by https://errorprone.info/bugpattern/FormatString

@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants