diff options
author | Dani Megert | 2013-10-03 13:44:18 +0000 |
---|---|---|
committer | Dani Megert | 2013-10-03 13:44:18 +0000 |
commit | 43b0dc87e902de5a9bfbb0b494e57132fd990253 (patch) | |
tree | 7f7a32c5f81287d8e0a749ee7111c701ab7158a1 /org.eclipse.jdt.debug.ui/ui | |
parent | 30113d5721b51ea93fc368b7fb17a73a63bab79c (diff) | |
download | eclipse.jdt.debug-43b0dc87e902de5a9bfbb0b494e57132fd990253.tar.gz eclipse.jdt.debug-43b0dc87e902de5a9bfbb0b494e57132fd990253.tar.xz eclipse.jdt.debug-43b0dc87e902de5a9bfbb0b494e57132fd990253.zip |
Fixed unchecked cast warningsI20131015-0800I20131009-0430I20131008-2330
Diffstat (limited to 'org.eclipse.jdt.debug.ui/ui')
-rw-r--r-- | org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletParametersTab.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletParametersTab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletParametersTab.java index 774c4f7e2..065d51599 100644 --- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletParametersTab.java +++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletParametersTab.java @@ -49,7 +49,7 @@ import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.PlatformUI; - + /** * This tab appears for java applet launch configurations and allows the user to edit * applet-specific attributes such as width, height, name & applet parameters. @@ -198,7 +198,7 @@ public class AppletParametersTab extends JavaLaunchTab { } String key = (String) element; - Map<String, String> params = (Map<String, String>) fViewer.getInput(); + Map<String, String> params = getViewerInput(); Object object = params.get(key); if (object != null) { return object.toString(); @@ -268,7 +268,7 @@ public class AppletParametersTab extends JavaLaunchTab { private void handleParametersEditButtonSelected() { IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection(); String key = (String) selection.getFirstElement(); - Map<String, String> params = (Map<String, String>) fViewer.getInput(); + Map<String, String> params = getViewerInput(); String value = params.get(key); NameValuePairDialog dialog = @@ -285,7 +285,7 @@ public class AppletParametersTab extends JavaLaunchTab { Object[] keys = selection.toArray(); for (int i = 0; i < keys.length; i++) { String key = (String) keys[i]; - Map<String, String> params = (Map<String, String>) fViewer.getInput(); + Map<String, String> params = getViewerInput(); params.remove(key); } fViewer.refresh(); @@ -324,13 +324,18 @@ public class AppletParametersTab extends JavaLaunchTab { return; } String[] nameValuePair = dialog.getNameValuePair(); - Map<String, String> params = (Map<String, String>) fViewer.getInput(); + Map<String, String> params = getViewerInput(); params.remove(key); params.put(nameValuePair[0], nameValuePair[1]); fViewer.refresh(); updateLaunchConfigurationDialog(); } - + + @SuppressWarnings("unchecked") + private Map<String, String> getViewerInput() { + return (Map<String, String>) fViewer.getInput(); + } + /** * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy) */ @@ -344,7 +349,7 @@ public class AppletParametersTab extends JavaLaunchTab { } catch (NumberFormatException e) { } configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_NAME, fNameText.getText()); - configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_PARAMETERS, (Map<String, String>) fViewer.getInput()); + configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_PARAMETERS, getViewerInput()); } /** |