aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHendrik Still2013-07-24 08:40:34 (EDT)
committerGerrit Code Review @ Eclipse.org2013-07-31 09:03:48 (EDT)
commit47c1b8d194989182bf5da24fa51c3a65350782ee (patch)
treedf9cd08c30b93dbaf7acfb68f70dec801696973f
parent13205bd57a0909261cf0b2fd19cd631fe9531999 (diff)
downloadeclipse.platform.ui-47c1b8d194989182bf5da24fa51c3a65350782ee.zip
eclipse.platform.ui-47c1b8d194989182bf5da24fa51c3a65350782ee.tar.gz
eclipse.platform.ui-47c1b8d194989182bf5da24fa51c3a65350782ee.tar.bz2
Bug 413628 - Fix compiler warnings in org.eclipse.jface.fieldassistrefs/changes/12/14812/3
caused by moving JFace to Java 1.5 Change-Id: I0021bc940f04fa8cf9380072f4343a4bd429bf17 Signed-off-by: Hendrik Still <hendrik.still@gammas.de>
-rw-r--r--bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java18
-rw-r--r--bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/FieldAssistColors.java22
-rw-r--r--bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/FieldDecorationRegistry.java6
-rw-r--r--bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/SimpleContentProposalProvider.java4
4 files changed, 24 insertions, 26 deletions
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java
index 0474e62..9fea8e3 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java
@@ -15,7 +15,12 @@ import java.util.ArrayList;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.ListenerList;
-
+import org.eclipse.jface.bindings.keys.KeyStroke;
+import org.eclipse.jface.dialogs.PopupDialog;
+import org.eclipse.jface.preference.JFacePreferences;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.util.Util;
+import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
@@ -39,13 +44,6 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.jface.bindings.keys.KeyStroke;
-import org.eclipse.jface.dialogs.PopupDialog;
-import org.eclipse.jface.preference.JFacePreferences;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.util.Util;
-import org.eclipse.jface.viewers.ILabelProvider;
-
/**
* ContentProposalAdapter can be used to attach content proposal behavior to a
* control. This behavior includes obtaining proposals, opening a popup dialog,
@@ -1053,7 +1051,7 @@ public class ContentProposalAdapter {
// Check each string for a match. Use the string displayed to the
// user, not the proposal content.
- ArrayList list = new ArrayList();
+ ArrayList<IContentProposal> list = new ArrayList<IContentProposal>();
for (int i = 0; i < proposals.length; i++) {
String string = getString(proposals[i]);
if (string.length() >= filterString.length()
@@ -1063,7 +1061,7 @@ public class ContentProposalAdapter {
}
}
- return (IContentProposal[]) list.toArray(new IContentProposal[list
+ return list.toArray(new IContentProposal[list
.size()]);
}
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/FieldAssistColors.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/FieldAssistColors.java
index 7fcd603..33346eb 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/FieldAssistColors.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/FieldAssistColors.java
@@ -48,13 +48,13 @@ public class FieldAssistColors {
* Keys are background colors, values are the color with the alpha value
* applied
*/
- private static Map requiredFieldColorMap = new HashMap();
+ private static Map<Color, Color> requiredFieldColorMap = new HashMap<Color, Color>();
/*
* Keys are colors we have created, values are the displays on which they
* were created.
*/
- private static Map displays = new HashMap();
+ private static Map<Color, Display> displays = new HashMap<Color, Display>();
/**
* Compute the RGB of the color that should be used for the background of a
@@ -156,7 +156,7 @@ public class FieldAssistColors {
* Dispose any colors that were allocated for the given display.
*/
private static void disposeColors(Display display) {
- List toBeRemoved = new ArrayList(1);
+ List<Color> toBeRemoved = new ArrayList<Color>(1);
if (DEBUG) {
System.out.println("Display map is " + displays.toString()); //$NON-NLS-1$
@@ -165,19 +165,19 @@ public class FieldAssistColors {
}
// Look for any stored colors that were created on this display
- for (Iterator i = displays.keySet().iterator(); i.hasNext();) {
- Color color = (Color) i.next();
- if (((Display) displays.get(color)).equals(display)) {
+ for (Iterator<Color> i = displays.keySet().iterator(); i.hasNext();) {
+ Color color = i.next();
+ if (displays.get(color).equals(display)) {
// The color is on this display. Mark it for removal.
toBeRemoved.add(color);
// Now look for any references to it in the required field color
// map
- List toBeRemovedFromRequiredMap = new ArrayList(1);
- for (Iterator iter = requiredFieldColorMap.keySet().iterator(); iter
+ List<Color> toBeRemovedFromRequiredMap = new ArrayList<Color>(1);
+ for (Iterator<Color> iter = requiredFieldColorMap.keySet().iterator(); iter
.hasNext();) {
- Color bgColor = (Color) iter.next();
- if (((Color) requiredFieldColorMap.get(bgColor))
+ Color bgColor = iter.next();
+ if (requiredFieldColorMap.get(bgColor)
.equals(color)) {
// mark it for removal from the required field color map
toBeRemovedFromRequiredMap.add(bgColor);
@@ -194,7 +194,7 @@ public class FieldAssistColors {
// Remove references in the display map now that we are
// done iterating
for (int i = 0; i < toBeRemoved.size(); i++) {
- Color color = (Color) toBeRemoved.get(i);
+ Color color = toBeRemoved.get(i);
// Removing from the display map must be done before disposing the
// color or else the comparison between this color and the one
// in the map will fail.
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/FieldDecorationRegistry.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/FieldDecorationRegistry.java
index b70a6d9..b040bd1 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/FieldDecorationRegistry.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/FieldDecorationRegistry.java
@@ -222,7 +222,7 @@ public class FieldDecorationRegistry {
private int maxDecorationWidth = 0;
private int maxDecorationHeight = 0;
- private HashMap /* <String id, FieldDecoration> */decorations = new HashMap();
+ private HashMap<String, Entry> decorations = new HashMap<String, Entry>();
/**
* Get the default FieldDecorationRegistry.
@@ -393,12 +393,12 @@ public class FieldDecorationRegistry {
* called in response to adding, removing, or replacing a decoration.
*/
private void recomputeMaximums() {
- Iterator entries = decorations.values().iterator();
+ Iterator<Entry> entries = decorations.values().iterator();
maxDecorationHeight = 0;
maxDecorationWidth = 0;
while (entries.hasNext()) {
- Image image = ((Entry)entries.next()).getDecoration().getImage();
+ Image image = entries.next().getDecoration().getImage();
if (image != null) {
maxDecorationHeight = Math.max(maxDecorationHeight, image.getBounds().height);
maxDecorationWidth = Math.max(maxDecorationWidth, image.getBounds().width);
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/SimpleContentProposalProvider.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/SimpleContentProposalProvider.java
index 075d5e5..36e6ac8 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/SimpleContentProposalProvider.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/SimpleContentProposalProvider.java
@@ -66,7 +66,7 @@ public class SimpleContentProposalProvider implements IContentProposalProvider {
*/
public IContentProposal[] getProposals(String contents, int position) {
if (filterProposals) {
- ArrayList list = new ArrayList();
+ ArrayList<ContentProposal> list = new ArrayList<ContentProposal>();
for (int i = 0; i < proposals.length; i++) {
if (proposals[i].length() >= contents.length()
&& proposals[i].substring(0, contents.length())
@@ -74,7 +74,7 @@ public class SimpleContentProposalProvider implements IContentProposalProvider {
list.add(new ContentProposal(proposals[i]));
}
}
- return (IContentProposal[]) list.toArray(new IContentProposal[list
+ return list.toArray(new IContentProposal[list
.size()]);
}
if (contentProposals == null) {