-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
String.format(Locale.ROOT, ...) wrapper #1946
Comments
Interesting topic. I've seen issues with As you mentioned, this issue is seemingly on few people's radar. Raising awareness would be a good thing to do. |
I would like this. Not as |
I suppose there's some overlap with the recently added |
(One thing that I'd overlooked is that there is (probably?) no problem if you use only |
Fwiw, |
String.format
depends on the default locale, leading to problems like #1567. We can fix it by passingLocale.ROOT
to each call, but this is kind of ugly, especially for an API that exists in large part to eliminate ugly string-concatenation code.Where would it go?
Strings.format
: looks likeString.format
, possibly too much soStrings.rootLocaleFormat
: for easy static importRootLocale.format
: gives a place for future such methods. Are there any candidates?And how worried are we about use of the default locale here? Oddly, I'm not sure I've ever heard anyone crusading against
String.format
, even though there are crusaders against many other default-locale APIs. Maybe it's just less frequently noticed there, in part because users often just use%s
? Plus, the output is probably more often used for debugging than it would be for, e.g.,SimpleDateFormat
.The text was updated successfully, but these errors were encountered: