Skip to content

Commit 5d8f341

Browse files
committed
fix warning 'The constructor Locale is deprecated since version 20'
1 parent 3f7070e commit 5d8f341

File tree

1 file changed

+6
-6
lines changed
  • update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator

1 file changed

+6
-6
lines changed

update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/Utils.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,21 +289,21 @@ private static boolean isMatchingLocale(String candidateValues, String locale) {
289289
}
290290
return false;
291291
}
292-
292+
293293
public static Locale getDefaultLocale() {
294294
String nl = getNL();
295295
// sanity test
296296
if (nl == null)
297297
return Locale.getDefault();
298-
298+
299299
// break the string into tokens to get the Locale object
300-
StringTokenizer locales = new StringTokenizer(nl,"_"); //$NON-NLS-1$
300+
StringTokenizer locales = new StringTokenizer(nl, "_"); //$NON-NLS-1$
301301
if (locales.countTokens() == 1)
302-
return new Locale(locales.nextToken(), ""); //$NON-NLS-1$
302+
return Locale.of(locales.nextToken());
303303
else if (locales.countTokens() == 2)
304-
return new Locale(locales.nextToken(), locales.nextToken());
304+
return Locale.of(locales.nextToken(), locales.nextToken());
305305
else if (locales.countTokens() == 3)
306-
return new Locale(locales.nextToken(), locales.nextToken(), locales.nextToken());
306+
return Locale.of(locales.nextToken(), locales.nextToken(), locales.nextToken());
307307
else
308308
return Locale.getDefault();
309309
}

0 commit comments

Comments
 (0)