ICU-21067 Maybe fix synchronization lint in MeasureUnit.java
diff --git a/icu4j/main/classes/core/src/com/ibm/icu/util/MeasureUnit.java b/icu4j/main/classes/core/src/com/ibm/icu/util/MeasureUnit.java
index cdc8666..2bce398 100644
--- a/icu4j/main/classes/core/src/com/ibm/icu/util/MeasureUnit.java
+++ b/icu4j/main/classes/core/src/com/ibm/icu/util/MeasureUnit.java
@@ -704,7 +704,7 @@ public String toString() {
*
* @stable ICU 53
*/
- public synchronized static Set<String> getAvailableTypes() {
+ public static Set<String> getAvailableTypes() {
populateCache();
return Collections.unmodifiableSet(cache.keySet());
}
@@ -715,7 +715,7 @@ public synchronized static Set<String> getAvailableTypes() {
* @return the available units for type. Returned set is unmodifiable.
* @stable ICU 53
*/
- public synchronized static Set<MeasureUnit> getAvailable(String type) {
+ public static Set<MeasureUnit> getAvailable(String type) {
populateCache();
Map<String, MeasureUnit> units = cache.get(type);
// Train users not to modify returned set from the start giving us more
@@ -867,11 +867,9 @@ public void put(UResource.Key key, UResource.Value value, boolean noFallback) {
* Adding of others is deferred until later to avoid circular static init
* dependencies with classes Currency and TimeUnit.
*
- * <p>Synchronization: this function must be called from static synchronized methods only.
- *
* @internal
*/
- static private void populateCache() {
+ static synchronized private void populateCache() {
if (cacheIsPopulated) {
return;
}