aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeanderson Candido2014-03-01 00:49:19 (EST)
committerLars Vogel2014-03-02 17:12:33 (EST)
commitc88f1112a3569cf9232a90fac548c58af269a5a2 (patch)
treebeb09aa23d4f67b4c7e0ed851a46ce1d98901637
parentb0173b10befc7bddd922522268c97cf070643dc8 (diff)
downloadeclipse.platform.ui-c88f1112a3569cf9232a90fac548c58af269a5a2.zip
eclipse.platform.ui-c88f1112a3569cf9232a90fac548c58af269a5a2.tar.gz
eclipse.platform.ui-c88f1112a3569cf9232a90fac548c58af269a5a2.tar.bz2
Bug 428355 - [New Contributors] Fix warnings in platform projectsI20140303-1130I20140303-0800I20140302-2000refs/changes/85/22285/7
Original code was performing unsafe explicit cast, causing an warning due to the possibility of throwing ClassCastException. Change-Id: Ia805e0536fbcbfdd91529ca30d0f11707906d22f Signed-off-by: Jeanderson Candido <jeandersonbc@gmail.com>
-rw-r--r--bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceStore.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceStore.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceStore.java
index cf6e91d..0e4221b 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceStore.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceStore.java
@@ -18,13 +18,12 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Enumeration;
import java.util.Properties;
+import java.util.Set;
import org.eclipse.core.commands.common.EventManager;
-import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.util.SafeRunnable;
@@ -393,12 +392,8 @@ public class PreferenceStore extends EventManager implements
* @return an array of preference names
*/
public String[] preferenceNames() {
- ArrayList<String> list = new ArrayList<String>();
- Enumeration<String> it = (Enumeration<String>) properties.propertyNames();
- while (it.hasMoreElements()) {
- list.add(it.nextElement());
- }
- return list.toArray(new String[list.size()]);
+ Set<String> set = properties.stringPropertyNames();
+ return set.toArray(new String[set.size()]);
}
@Override