From 8ddaf6d039146a442d35a7a31bfd48b061d456ff Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Fri, 3 Dec 2010 00:30:45 +0000 Subject: Fix warnings produced by NetX and the plugin (both Java and C++). 2010-12-01 Andrew John Hughes * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (getCachedResource(URL,Version,UpdatePolicy)): Use toURI().toURL() to avoid broken escaping. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (getCacheURL(URL)): Likewise. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: (destroy()): Suppress deprecated warning from use of thread.stop(). Only use when interrupt() has already been tried. * netx/net/sourceforge/jnlp/runtime/Boot.java: (getFile()): Use toURI.toURL() to avoid broken escaping. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (initializeResources()): Likewise. * netx/net/sourceforge/jnlp/security/PasswordAuthenticationDialog.java: (askUser(String,int,String,String)): Use getPassword() to retrieve a character array directly. Fix overrunning line. * netx/net/sourceforge/jnlp/tools/JarSigner.java: Remove unused IdentityScope variable, scope. * netx/net/sourceforge/nanoxml/XMLElement.java: (scanWhitespace(StringBuffer)): Don't fallthrough. * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Fix warnings where std::string is used in printf rather than char* by invoking c_str on these strings. * plugin/icedteanp/java/netscape/javascript/JSException.java: (JSException()): Mark with @Deprecated annotation. (JSException(String)): Likewise. (JSException(String,String,int,String,int)): Likewise. * plugin/icedteanp/java/netscape/javascript/JSObject.java: (JSObject(String)): Remove redundant cast. (getWindow(Applet)): Likewise. * plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java: (contexts): Initialise properly with generic typing. * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java: (getMatchingMethod(Object[]): Add missing generic type to Class instances. (getMatchingConstructor(Object[])): Likewise. (getCostAndCastedObject(Object,Class)): Likewise. (getMatchingMethods(Class,String,int)): Likewise. (getMatchingConstructors(Class,int)): Likewise. (getNum(String,Class)): Likewise. * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java: (parseCall(String,ClassLoader,Class)): Use c.cast rather than (V). (handleMessage(int,String,AccessControlContext,String)): Add missing generic type to Class instances. Remove redundant casts. (prepopulateField(int,String)): Add missing generic type to Class instance. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (createPanel(PluginStreamHandler,int,long,URL,Hashtable)): Add missing generic types on Hashtable and PrivilegedAction. (initEventQueue(AppletPanel)): Add missing generic type to PrivilegedAction. (splitSeparator(String,String)): Use an ArrayList rather than Vector to avoid locking and use generic types. (requests): Initialise properly with generic typing. (applets): Likewise. (appletStateChanged(AppletEvent)): Use setSize and getPreferredSize. (handleMessage(int,String)): Remove redundant casts. (audioClips): Add generic types. (getAudioClip): Remove redundant cast. (imageRefs): Add generic types. (getCachedImageRef(URL)): Remove redundant cast. (appletPanels): Add generic types. (getApplets()): Likewise. (getStream(String)): Mark with @Override. (getStreamKeys()): Likewise. (systemParam): Add generic types. (printTag(PrintStream,Hashtable)): Likewise. Remove redundant casts. (updateAtts()): Use getSize() and getInsets(). Use Integer.valueOf(). (appletReload()): Add generic types to PrivilegedAction. (scanIdentifier(int[],Reader)): Use StringBuilder to avoid unnecessary locking. (skipComment(int[],Reader)): Likewise. (scanTag(int[],Reader)): Likewise. Add generic types. (parse(int,long,String,String,Reader,URL)): Use PrivilegedExceptionAction to avoid catching and rethrowing the exception manually. Add generic types. (parse(int,long,String,String,Reader,URL,PrintStream,PluginAppletPanelFactory)): Add generic types. Remove unnecessary casts. Fix overlong lines. * plugin/icedteanp/java/sun/applet/PluginMain.java: (init()): Add generic types. Remove unnecessary cast. * plugin/icedteanp/java/sun/applet/PluginObjectStore.java: (objects): Initialise properly with generic typing. (counts): Likewise. (identifiers): Likewise. * plugin/icedteanp/java/sun/applet/PluginProxySelector.java: (get(Object)): Suppress unchecked warning arising from cast to K. --- .../java/netscape/javascript/JSObject.java | 54 +++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'plugin/icedteanp/java/netscape/javascript/JSObject.java') diff --git a/plugin/icedteanp/java/netscape/javascript/JSObject.java b/plugin/icedteanp/java/netscape/javascript/JSObject.java index 74158c2..31cd973 100644 --- a/plugin/icedteanp/java/netscape/javascript/JSObject.java +++ b/plugin/icedteanp/java/netscape/javascript/JSObject.java @@ -40,7 +40,7 @@ /* more doc todo: * threads * gc - * + * * */ @@ -114,26 +114,26 @@ public final class JSObject { * it is illegal to construct a JSObject manually */ public JSObject(String jsobj_addr) { - this((long) Long.parseLong(jsobj_addr)); + this(Long.parseLong(jsobj_addr)); } public JSObject(long jsobj_addr) { - + // See if the caller has permission - + try { AccessController.getContext().checkPermission(new JSObjectCreatePermission()); } catch (AccessControlException ace) { - - // If not, only caller with JSObject.getWindow on the stack may + + // If not, only caller with JSObject.getWindow on the stack may // make this call unprivileged. - + // Although this check is inefficient, it should happen only once // during applet init, so we look the other way StackTraceElement[] stack = Thread.currentThread().getStackTrace(); boolean mayProceed = false; - + for (int i=0; i < stack.length; i++) { if (stack[i].getClassName().equals("netscape.javascript.JSObject") && stack[i].getMethodName().equals("getWindow")) { @@ -149,10 +149,10 @@ public final class JSObject { } /** - * Retrieves a named member of a JavaScript object. + * Retrieves a named member of a JavaScript object. * Equivalent to "this.name" in JavaScript. */ - public Object getMember(String name) + public Object getMember(String name) { PluginDebug.debug ("JSObject.getMember " + name); @@ -166,8 +166,8 @@ public final class JSObject { * Retrieves an indexed member of a JavaScript object. * Equivalent to "this[index]" in JavaScript. */ - // public Object getMember(int index) { return getSlot(index); } - public Object getSlot(int index) + // public Object getMember(int index) { return getSlot(index); } + public Object getSlot(int index) { PluginDebug.debug ("JSObject.getSlot " + index); @@ -176,10 +176,10 @@ public final class JSObject { /** - * Sets a named member of a JavaScript object. + * Sets a named member of a JavaScript object. * Equivalent to "this.name = value" in JavaScript. */ - public void setMember(String name, Object value) + public void setMember(String name, Object value) { PluginDebug.debug ("JSObject.setMember " + name + " " + value); @@ -187,13 +187,13 @@ public final class JSObject { } /** - * Sets an indexed member of a JavaScript object. + * Sets an indexed member of a JavaScript object. * Equivalent to "this[index] = value" in JavaScript. */ - // public void setMember(int index, Object value) { + // public void setMember(int index, Object value) { // setSlot(index, value); // } - public void setSlot(int index, Object value) + public void setSlot(int index, Object value) { PluginDebug.debug ("JSObject.setSlot " + index + " " + value); @@ -206,7 +206,7 @@ public final class JSObject { /** * Removes a named member of a JavaScript object. */ - public void removeMember(String name) + public void removeMember(String name) { PluginDebug.debug ("JSObject.removeMember " + name); @@ -218,12 +218,12 @@ public final class JSObject { * Calls a JavaScript method. * Equivalent to "this.methodName(args[0], args[1], ...)" in JavaScript. */ - public Object call(String methodName, Object args[]) + public Object call(String methodName, Object args[]) { - if (args == null) - args = new Object[0]; + if (args == null) + args = new Object[0]; - PluginDebug.debug ("JSObject.call " + methodName); + PluginDebug.debug ("JSObject.call " + methodName); for (int i = 0; i < args.length; i++) PluginDebug.debug (" " + args[i]); PluginDebug.debug(""); @@ -232,11 +232,11 @@ public final class JSObject { /** - * Evaluates a JavaScript expression. The expression is a string + * Evaluates a JavaScript expression. The expression is a string * of JavaScript source code which will be evaluated in the context * given by "this". */ - public Object eval(String s) + public Object eval(String s) { PluginDebug.debug("JSObject.eval " + s); return PluginAppletViewer.eval(internal, s); @@ -261,7 +261,7 @@ public final class JSObject { /** * get a JSObject for the window containing the given applet */ - public static JSObject getWindow(Applet applet) + public static JSObject getWindow(Applet applet) { PluginDebug.debug("JSObject.getWindow"); // FIXME: handle long case as well. @@ -269,7 +269,7 @@ public final class JSObject { internal = ((PluginAppletViewer) applet.getAppletContext()).getWindow(); PluginDebug.debug ("GOT IT: " + internal); - return new JSObject((long) internal); + return new JSObject(internal); } @@ -277,7 +277,7 @@ public final class JSObject { * Finalization decrements the reference count on the corresponding * JavaScript object. */ - protected void finalize() + protected void finalize() { PluginDebug.debug("JSObject.finalize "); PluginAppletViewer.JavaScriptFinalize(internal); -- cgit v1.2.3