diff options
author | Mickael Istria | 2016-03-10 12:22:43 +0000 |
---|---|---|
committer | Thomas Watson | 2016-10-07 14:15:35 +0000 |
commit | aef99de034bb7f4bd88b5a0066fcd39d70a24a54 (patch) | |
tree | 554103dbd7615b62b0143766ef0c5c9953b6285a /bundles/org.eclipse.equinox.security | |
parent | 29060df46ea548a78ff37feaf49672f2b372fdf6 (diff) | |
download | rt.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.security')
5 files changed, 20 insertions, 14 deletions
diff --git a/bundles/org.eclipse.equinox.security/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.security/META-INF/MANIFEST.MF index fd24d4935..f924ca65b 100644 --- a/bundles/org.eclipse.equinox.security/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.security/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.equinox.security;singleton:=true -Bundle-Version: 1.2.200.qualifier +Bundle-Version: 1.2.300.qualifier Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-Activator: org.eclipse.equinox.internal.security.auth.AuthPlugin diff --git a/bundles/org.eclipse.equinox.security/pom.xml b/bundles/org.eclipse.equinox.security/pom.xml index 449e6f336..3cfba0be5 100644 --- a/bundles/org.eclipse.equinox.security/pom.xml +++ b/bundles/org.eclipse.equinox.security/pom.xml @@ -19,7 +19,7 @@ </parent> <groupId>org.eclipse.equinox</groupId> <artifactId>org.eclipse.equinox.security</artifactId> - <version>1.2.200-SNAPSHOT</version> + <version>1.2.300-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> <build> diff --git a/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/SecurePreferences.java b/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/SecurePreferences.java index 73822c8ac..4ec318ce6 100644 --- a/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/SecurePreferences.java +++ b/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/SecurePreferences.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 IBM Corporation and others. + * Copyright (c) 2008, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -12,6 +12,7 @@ package org.eclipse.equinox.internal.security.storage; import java.io.IOException; import java.util.*; +import java.util.Map.Entry; import javax.crypto.BadPaddingException; import javax.crypto.IllegalBlockSizeException; import org.eclipse.core.runtime.IPath; @@ -190,10 +191,11 @@ public class SecurePreferences { thisNodePath = parentsPath + PATH_SEPARATOR + name; if (values != null) { - for (Iterator i = values.keySet().iterator(); i.hasNext();) { - String key = (String) i.next(); + for (Iterator it = values.entrySet().iterator(); it.hasNext();) { + Entry entry = (Entry) it.next(); + String key = (String) entry.getKey(); PersistedPath extenalTag = new PersistedPath(thisNodePath, key); - properties.setProperty(extenalTag.toString(), (String) values.get(key)); + properties.setProperty(extenalTag.toString(), (String) entry.getValue()); } } diff --git a/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/SecurePreferencesRoot.java b/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/SecurePreferencesRoot.java index 8f8d8cad2..b47a27a5f 100644 --- a/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/SecurePreferencesRoot.java +++ b/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/SecurePreferencesRoot.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2010 IBM Corporation and others. + * Copyright (c) 2008, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -14,6 +14,7 @@ import java.io.*; import java.net.URL; import java.security.SecureRandom; import java.util.*; +import java.util.Map.Entry; import javax.crypto.BadPaddingException; import javax.crypto.IllegalBlockSizeException; import javax.crypto.spec.PBEKeySpec; @@ -138,9 +139,10 @@ public class SecurePreferencesRoot extends SecurePreferences implements IStorage properties.remove(KEY_FACTORY_KEY); } - for (Iterator i = properties.keySet().iterator(); i.hasNext();) { - Object externalKey = i.next(); - Object value = properties.get(externalKey); + for (Iterator it = properties.entrySet().iterator(); it.hasNext();) { + Entry entry = (Entry) it.next(); + Object externalKey = entry.getKey(); + Object value = entry.getValue(); if (!(externalKey instanceof String)) continue; if (!(value instanceof String)) diff --git a/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/friends/ReEncrypter.java b/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/friends/ReEncrypter.java index 40a16f5b8..75dc16c46 100644 --- a/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/friends/ReEncrypter.java +++ b/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/friends/ReEncrypter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 IBM Corporation and others. + * Copyright (c) 2008, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,6 +11,7 @@ package org.eclipse.equinox.internal.security.storage.friends; import java.util.*; +import java.util.Map.Entry; import org.eclipse.equinox.internal.security.auth.AuthPlugin; import org.eclipse.equinox.internal.security.auth.nls.SecAuthMessages; import org.eclipse.equinox.internal.security.storage.SecurePreferencesContainer; @@ -124,10 +125,11 @@ public class ReEncrypter { TmpElement element = (TmpElement) i.next(); ISecurePreferences node = root.node(element.getPath()); Map values = element.getValues(); - for (Iterator j = values.keySet().iterator(); j.hasNext();) { - String key = (String) j.next(); + for (Iterator it = values.entrySet().iterator(); it.hasNext();) { + Entry entry = (Entry) it.next(); + String key = (String) entry.getKey(); try { - node.put(key, (String) values.get(key), true); + node.put(key, (String) entry.getValue(), true); } catch (StorageException e) { // this value will not be re-coded String msg = NLS.bind(SecAuthMessages.encryptingError, key, node.absolutePath()); |