Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael Istria2016-03-10 12:22:43 +0000
committerThomas Watson2016-10-07 14:15:35 +0000
commitaef99de034bb7f4bd88b5a0066fcd39d70a24a54 (patch)
tree554103dbd7615b62b0143766ef0c5c9953b6285a /bundles/org.eclipse.equinox.preferences
parent29060df46ea548a78ff37feaf49672f2b372fdf6 (diff)
downloadrt.equinox.bundles-aef99de034bb7f4bd88b5a0066fcd39d70a24a54.tar.gz
rt.equinox.bundles-aef99de034bb7f4bd88b5a0066fcd39d70a24a54.tar.xz
rt.equinox.bundles-aef99de034bb7f4bd88b5a0066fcd39d70a24a54.zip
Bug 489330 - Technical debt issues : iteration on keySet
Change-Id: I629151b5d8f0bce9ce85a6af548e84aa46e98b6e Signed-off-by: Mickael Istria <mistria@redhat.com> Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.preferences')
-rw-r--r--bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/PreferencesService.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/PreferencesService.java b/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/PreferencesService.java
index 05442fb3..8e89785c 100644
--- a/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/PreferencesService.java
+++ b/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/PreferencesService.java
@@ -15,6 +15,7 @@ package org.eclipse.core.internal.preferences;
import java.io.*;
import java.lang.ref.WeakReference;
import java.util.*;
+import java.util.Map.Entry;
import org.eclipse.core.internal.runtime.RuntimeLog;
import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.preferences.*;
@@ -236,9 +237,9 @@ public class PreferencesService implements IPreferencesService {
private Properties convertFromLegacy(Properties properties) {
Properties result = new Properties();
String prefix = IPath.SEPARATOR + InstanceScope.SCOPE + IPath.SEPARATOR;
- for (Iterator<?> i = properties.keySet().iterator(); i.hasNext();) {
- String key = (String) i.next();
- String value = properties.getProperty(key);
+ for (Entry<?, ?> entry : properties.entrySet()) {
+ String key = (String) entry.getKey();
+ String value = (String) entry.getValue();
if (value != null) {
int index = key.indexOf(IPath.SEPARATOR);
if (index == -1) {
@@ -260,9 +261,9 @@ public class PreferencesService implements IPreferencesService {
*/
private IExportedPreferences convertFromProperties(Properties properties) {
IExportedPreferences result = ExportedPreferences.newRoot();
- for (Iterator<?> i = properties.keySet().iterator(); i.hasNext();) {
- String path = (String) i.next();
- String value = properties.getProperty(path);
+ for (Entry<?, ?> entry : properties.entrySet()) {
+ String path = (String) entry.getKey();
+ String value = (String) entry.getValue();
if (path.charAt(0) == EXPORT_ROOT_PREFIX) {
ExportedPreferences current = (ExportedPreferences) result.node(path.substring(1));
current.setExportRoot();

Back to the top