diff options
author | Alexander Kurtakov | 2015-03-13 08:28:48 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2015-03-13 08:28:48 +0000 |
commit | b9f7831e7bdf04474ffdab87efb437511a67f97b (patch) | |
tree | 90471794c9efb7d7c87ebfbc4bf5505695636a59 /bundles/org.eclipse.swt.tools/JNI Generation | |
parent | 23ec8f209d75093d77d7bdc195ee616d6a03df73 (diff) | |
download | eclipse.platform.swt-b9f7831e7bdf04474ffdab87efb437511a67f97b.tar.gz eclipse.platform.swt-b9f7831e7bdf04474ffdab87efb437511a67f97b.tar.xz eclipse.platform.swt-b9f7831e7bdf04474ffdab87efb437511a67f97b.zip |
Bug 462049 - Fix discouraged invocation of non generified methods
Calling Collections methods of generified classes with Object parameters
raises warnings. As these params are already of the correct type
changing their definition is enough.
Change-Id: I6ad5858f898171ae55819a277d763d1aa4a45a4d
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt.tools/JNI Generation')
2 files changed, 12 insertions, 8 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupConstants.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupConstants.java index d8da4b7229..82003b2188 100644 --- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupConstants.java +++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupConstants.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2007 IBM Corporation and others. + * Copyright (c) 2004, 2015 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 @@ -7,10 +7,12 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Red Hat Inc. - generification *******************************************************************************/ package org.eclipse.swt.tools.internal; -import java.lang.reflect.Modifier; +import java.io.*; +import java.lang.reflect.*; import java.util.*; public class CleanupConstants extends CleanupClass { @@ -49,9 +51,9 @@ public void generate(JNIField[] fields) { public void generate(JNIField field) { String name = field.getName(); - Enumeration<?> keys = files.keys(); + Enumeration<File> keys = files.keys(); while (keys.hasMoreElements()) { - Object key = keys.nextElement(); + File key = keys.nextElement(); String str = files.get(key); if (str.indexOf(name) != -1) { int modifiers = field.getModifiers(); diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupNatives.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupNatives.java index bd06785e58..0809a200bd 100644 --- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupNatives.java +++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupNatives.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2007 IBM Corporation and others. + * Copyright (c) 2004, 2015 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 @@ -7,11 +7,13 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Red Hat Inc. - generification *******************************************************************************/ package org.eclipse.swt.tools.internal; -import java.util.*; +import java.io.*; import java.lang.reflect.*; +import java.util.*; public class CleanupNatives extends CleanupClass { @@ -38,9 +40,9 @@ public void generate(JNIMethod[] methods) { public void generate(JNIMethod method) { String name = method.getName(); - Enumeration<?> keys = files.keys(); + Enumeration<File> keys = files.keys(); while (keys.hasMoreElements()) { - Object key = keys.nextElement(); + File key = keys.nextElement(); String str = files.get(key); if (str.indexOf(name) != -1) { // int modifiers = method.getModifiers(); |