aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp/util/Reflect.java
diff options
context:
space:
mode:
authorJiri Vanek <[email protected]>2013-12-13 10:47:07 +0100
committerJiri Vanek <[email protected]>2013-12-13 10:47:07 +0100
commit25f307d98cb0ba4698318c6a1a4e738ee81f6e55 (patch)
treee869f4d7ea537ba2d4508f71edbafdccecd0f375 /netx/net/sourceforge/jnlp/util/Reflect.java
parent6256aac59275df0edd0feb4950272aa33573be9f (diff)
itw itself warning cleanup: fixed rawtypes and unchecks, added braces and Override
After this clean up only "internal proprietary API and may be removed in a future release" warnings remain fro make check. Please keep itw in this way :) remaining issues: icedtea-web/netx/net/sourceforge/jnlp/cache/ResourceTracker.java:357: warning: [deprecation] toURL() in File has been deprecated icedtea-web/netx/net/sourceforge/jnlp/cache/CacheUtil.java:128: warning: [deprecation] toURL() in File has been deprecated icedtea-web/netx/net/sourceforge/jnlp/runtime/Boot.java:261: warning: [deprecation] toURL() in File has been deprecated There have been a lot of work around cach x file x url escaping, and as main difference between file.tourl and file.touri.tourl is escapin, I rather left it. icedtea-web/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java:804: warning: [deprecation] Ref in sun.misc has been deprecated icedtea-web/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java:121: warning: [deprecation] Ref in sun.misc has been deprecated What can be done? icedtea-web/netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java:205: warning: [fallthrough] possible fall-through into case icedtea-web/netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java:211: warning: [fallthrough] possible fall-through into case This have to be fixed
Diffstat (limited to 'netx/net/sourceforge/jnlp/util/Reflect.java')
-rw-r--r--netx/net/sourceforge/jnlp/util/Reflect.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/netx/net/sourceforge/jnlp/util/Reflect.java b/netx/net/sourceforge/jnlp/util/Reflect.java
index 6673974..065c843 100644
--- a/netx/net/sourceforge/jnlp/util/Reflect.java
+++ b/netx/net/sourceforge/jnlp/util/Reflect.java
@@ -16,8 +16,9 @@
package net.sourceforge.jnlp.util;
+import java.lang.reflect.Method;
import net.sourceforge.jnlp.util.logging.OutputController;
-import java.lang.reflect.*;
+
/**
* Provides simply, convenient methods to invoke methods by
@@ -75,11 +76,12 @@ public class Reflect {
*/
public Object invokeStatic(String className, String method, Object args[]) {
try {
- Class c = Class.forName(className, true, Reflect.class.getClassLoader());
+ Class<?> c = Class.forName(className, true, Reflect.class.getClassLoader());
Method m = getMethod(c, method, args);
- if (m.isAccessible() != accessible)
+ if (m.isAccessible() != accessible) {
m.setAccessible(accessible);
+ }
return m.invoke(null, args);
} catch (Exception ex) { // eat
@@ -103,8 +105,9 @@ public class Reflect {
public Object invoke(Object object, String method, Object args[]) {
try {
Method m = getMethod(object.getClass(), method, args);
- if (m.isAccessible() != accessible)
+ if (m.isAccessible() != accessible) {
m.setAccessible(accessible);
+ }
return m.invoke(object, args);
} catch (Exception ex) { // eat
@@ -117,17 +120,18 @@ public class Reflect {
* Return the Method matching the specified name and number of
* arguments.
*/
- public Method getMethod(Class type, String method, Object args[]) {
+ public Method getMethod(Class<?> type, String method, Object args[]) {
try {
- for (Class c = type; c != null; c = c.getSuperclass()) {
+ for (Class<?> c = type; c != null; c = c.getSuperclass()) {
Method methods[] = c.getMethods();
for (int i = 0; i < methods.length; i++) {
if (methods[i].getName().equals(method)) {
Class parameters[] = methods[i].getParameterTypes();
- if (parameters.length == args.length)
+ if (parameters.length == args.length) {
return methods[i];
+ }
}
}
}