diff options
| author | Carsten Hammer | 2020-11-15 09:39:05 +0000 |
|---|---|---|
| committer | Fabrice Tiercelin | 2021-01-12 07:10:14 +0000 |
| commit | 71c57cdeedcac3266f60e455d05d89bc1b5be564 (patch) | |
| tree | efaa645c3fcfb373b51a11e753ca26cd6adfaf23 | |
| parent | c75b86bad50b9237b9426763639f30027373f28d (diff) | |
| download | eclipse.jdt.ui-71c57cdeedcac3266f60e455d05d89bc1b5be564.tar.gz eclipse.jdt.ui-71c57cdeedcac3266f60e455d05d89bc1b5be564.tar.xz eclipse.jdt.ui-71c57cdeedcac3266f60e455d05d89bc1b5be564.zip | |
Bug 570221 - Don't use subtype when supertype is fine
At the same time don't use Java type Hashtable without a very good
reason as this type is since java 1.2 no longer recommended.
Change-Id: I8cdb2da7c0892f75f6bbad8a5146dd12fd4990ac
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
2 files changed, 7 insertions, 8 deletions
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/CleanUpRefactoringWizard.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/CleanUpRefactoringWizard.java index 4b15d94ecc..3211bbe143 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/CleanUpRefactoringWizard.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/CleanUpRefactoringWizard.java @@ -20,7 +20,7 @@ import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Arrays; -import java.util.Hashtable; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -96,7 +96,7 @@ public class CleanUpRefactoringWizard extends RefactoringWizard { private static class ProjectProfileLableProvider extends LabelProvider implements ITableLabelProvider { - private Hashtable<String, Profile> fProfileIdsTable; + private Map<String, Profile> fProfileIdsTable; @Override public Image getColumnImage(Object element, int columnIndex) { @@ -126,8 +126,8 @@ public class CleanUpRefactoringWizard extends RefactoringWizard { return null; } - private Hashtable<String, Profile> loadProfiles() { - Hashtable<String, Profile> profileIdsTable= new Hashtable<>(); + private Map<String, Profile> loadProfiles() { + Map<String, Profile> profileIdsTable= new HashMap<>(); for (Profile profile : CleanUpPreferenceUtil.loadProfiles(InstanceScope.INSTANCE)) { profileIdsTable.put(profile.getID(), profile); } @@ -135,7 +135,7 @@ public class CleanUpRefactoringWizard extends RefactoringWizard { return profileIdsTable; } - private String getProjectProfileName(final IJavaProject project, Hashtable<String, Profile> profileIdsTable, String workbenchProfileId) { + private String getProjectProfileName(final IJavaProject project, Map<String, Profile> profileIdsTable, String workbenchProfileId) { ProjectScope projectScope= new ProjectScope(project.getProject()); IEclipsePreferences node= projectScope.getNode(JavaUI.ID_PLUGIN); String id= node.get(CleanUpConstants.CLEANUP_PROFILE, null); @@ -360,7 +360,7 @@ public class CleanUpRefactoringWizard extends RefactoringWizard { configure.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - Hashtable<String, String> workingValues= new Hashtable<>(fCustomSettings); + Map<String, String> workingValues= new HashMap<>(fCustomSettings); CleanUpSelectionDialog dialog= new WizardCleanUpSelectionDialog(getShell(), workingValues); if (dialog.open() == Window.OK) { fCustomSettings= workingValues; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/CleanUpSaveParticipantPreferenceConfiguration.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/CleanUpSaveParticipantPreferenceConfiguration.java index 8994870ad1..58b8ccef16 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/CleanUpSaveParticipantPreferenceConfiguration.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/CleanUpSaveParticipantPreferenceConfiguration.java @@ -14,7 +14,6 @@ package org.eclipse.jdt.internal.ui.fix; import java.util.HashMap; -import java.util.Hashtable; import java.util.Map; import org.eclipse.swt.SWT; @@ -203,7 +202,7 @@ public class CleanUpSaveParticipantPreferenceConfiguration extends AbstractSaveP fConfigureButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - Hashtable<String, String> workingValues= new Hashtable<>(fSettings); + Map<String, String> workingValues= new HashMap<>(fSettings); SaveActionSelectionDialog dialog= new SaveActionSelectionDialog(parent.getShell(), workingValues); if (dialog.open() == Window.OK) { fSettings= workingValues; |
