Skip to content

Commit 795befd

Browse files
committed
Stop using deprecated new Locale
Use Locale.of instead.
1 parent 83a2fc6 commit 795befd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/internal/rpm/ui/editor/actions/SpecfileChangelogFormatter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2007, 2018 Red Hat Inc.
2+
* Copyright (c) 2007, 2024 Red Hat Inc.
33
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
@@ -90,7 +90,7 @@ private String formatTodaysDate() {
9090
cal.setTime(new Date());
9191
// Get default locale
9292
Locale defaultLocale = Locale.getDefault();
93-
Locale.setDefault(new Locale(store.getString(PreferenceConstants.P_CHANGELOG_LOCAL)));
93+
Locale.setDefault(Locale.of(store.getString(PreferenceConstants.P_CHANGELOG_LOCAL)));
9494
String date = SIMPLE_DATE_FORMAT.format(new Date());
9595
Locale.setDefault(defaultLocale);
9696
return date;

Diff for: rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/internal/rpm/ui/editor/preferences/MainPreferencePage.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2007, 2018 Alphonse Van Assche and others.
2+
* Copyright (c) 2007, 2024 Alphonse Van Assche and others.
33
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
@@ -68,7 +68,7 @@ private void createLocalesCombo(Composite parent) {
6868
String lastLocale = getPreferenceStore().getString(PreferenceConstants.P_CHANGELOG_LOCAL);
6969
String[] countries = Locale.getISOCountries();
7070
for (int i = 0; i < countries.length; i++) {
71-
Locale currentLocale = new Locale(countries[i]);
71+
Locale currentLocale = Locale.of(countries[i]);
7272
combo.add(countries[i] + " - " + currentLocale.getDisplayLanguage()); //$NON-NLS-1$
7373
// get index of the Locale store in the preferences
7474
if (countries[i].equals(lastLocale)) {

0 commit comments

Comments
 (0)