Closed
Description
Error-prone has UnsafeLocaleUsage, detecting the use of the Locale constructors and Locale.toString.
https://errorprone.info/bugpattern/UnsafeLocaleUsage
All good...
But JDK 19 deprecated the constructors and added the static methods Locale.of:
static Locale Locale.of(String language)static Locale Locale.of(String language, String country)static Locale Locale.of(String language, String country, String variant)
The methods have the exact same problems as the constructors.
So it would be nice if error-prone would also detect them.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Update `UnsafeLocaleUsage` with detection for `Locale.of`
Update `UnsafeLocaleUsage` with detection for `Locale.of`
Update `UnsafeLocaleUsage` with detection for `Locale.of`
Marcono1234 commentedon Nov 4, 2025
Was this resolved by #5297 and should be closed now?
(it seems the PR was not automatically linked to the issue because the PR wasn't exactly using the GitHub keyword)
cushon commentedon Nov 4, 2025
5216a43