-
Notifications
You must be signed in to change notification settings - Fork 25.6k
SQL: Replace String.format() with LoggerMessageFormat.format() #37216
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
Conversation
|
Pinging @elastic/es-search |
|
There are still a few occurrences where the And also here: https://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ProtoUtils.java#L44 for which we would need to add dependency to |
|
run default distro tests |
|
run gradle build tests 1 |
| @Override | ||
| public String toString() { | ||
| return String.format(Locale.ROOT, "{%s=%s}", prefix(), value); | ||
| return LoggerMessageFormat.format(null, "{{}={}}", prefix(), value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use the null prefix -and not use alternative method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@costin I use the one with the prefix and using null because of signature mixup:
String, String calls the one with the prefix and not the String, Object... one...
costin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - I assumed the format appears in more places.
No need to add imports into the other projects.
P.S. format is a great candidate for static importing.
astefan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
run gradle build tests 1 |
|
run default distro tests |
|
run gradle build tests 1 |
|
Backported to |
Fixes: #36532