/hg/icedtea-web: Fix warnings produced by NetX and the plugin (b...
andrew at icedtea.classpath.org
andrew at icedtea.classpath.org
Thu Dec 2 16:30:53 PST 2010
changeset 3dd021123e21 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=3dd021123e21
author: Andrew John Hughes <ahughes at redhat.com>
date: Fri Dec 03 00:30:45 2010 +0000
Fix warnings produced by NetX and the plugin (both Java and C++).
2010-12-01 Andrew John Hughes <ahughes at redhat.com>
* 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<V>)): 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: (c
reatePanel(PluginStreamHandler,int,long,URL,Hashtable<String,String>
)): 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<String,String>)): 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.
diffstat:
19 files changed, 1888 insertions(+), 1797 deletions(-)
ChangeLog | 86
netx/net/sourceforge/jnlp/cache/CacheUtil.java | 2
netx/net/sourceforge/jnlp/cache/ResourceTracker.java | 2
netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java | 1
netx/net/sourceforge/jnlp/runtime/Boot.java | 2
netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 10
netx/net/sourceforge/jnlp/security/PasswordAuthenticationDialog.java | 7
netx/net/sourceforge/jnlp/tools/JarSigner.java | 2
netx/net/sourceforge/nanoxml/XMLElement.java | 1
plugin/icedteanp/IcedTeaPluginRequestProcessor.cc | 10
plugin/icedteanp/java/netscape/javascript/JSException.java | 29
plugin/icedteanp/java/netscape/javascript/JSObject.java | 54
plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java | 45
plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java | 214 -
plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java | 2000 +++++-----
plugin/icedteanp/java/sun/applet/PluginAppletViewer.java | 971 ++--
plugin/icedteanp/java/sun/applet/PluginMain.java | 174
plugin/icedteanp/java/sun/applet/PluginObjectStore.java | 28
plugin/icedteanp/java/sun/applet/PluginProxySelector.java | 47
diffs (truncated from 5919 to 500 lines):
diff -r 6c8e9229bded -r 3dd021123e21 ChangeLog
--- a/ChangeLog Thu Dec 02 10:22:44 2010 -0500
+++ b/ChangeLog Fri Dec 03 00:30:45 2010 +0000
@@ -1,3 +1,89 @@ 2010-12-02 Omair Majid <omajid at redhat.
+2010-12-01 Andrew John Hughes <ahughes at redhat.com>
+
+ * 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<V>)): 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<String,String>)):
+ 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<String,String>)): 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.
+
2010-12-02 Omair Majid <omajid at redhat.com>
* Makefile.am (EXTRA_DIST): Add itweb-settings.desktop.in.
diff -r 6c8e9229bded -r 3dd021123e21 netx/net/sourceforge/jnlp/cache/CacheUtil.java
--- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java Thu Dec 02 10:22:44 2010 -0500
+++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java Fri Dec 03 00:30:45 2010 +0000
@@ -80,7 +80,7 @@ public class CacheUtil {
rt.addResource(location, version, policy);
try {
File f = rt.getCacheFile(location);
- return f.toURL();
+ return f.toURI().toURL();
}
catch (MalformedURLException ex) {
return location;
diff -r 6c8e9229bded -r 3dd021123e21 netx/net/sourceforge/jnlp/cache/ResourceTracker.java
--- a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java Thu Dec 02 10:22:44 2010 -0500
+++ b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java Fri Dec 03 00:30:45 2010 +0000
@@ -331,7 +331,7 @@ public class ResourceTracker {
try {
File f = getCacheFile(location);
if (f != null)
- return f.toURL();
+ return f.toURI().toURL();
}
catch (MalformedURLException ex) {
if (JNLPRuntime.isDebug())
diff -r 6c8e9229bded -r 3dd021123e21 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java
--- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Thu Dec 02 10:22:44 2010 -0500
+++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri Dec 03 00:30:45 2010 +0000
@@ -267,6 +267,7 @@ public class ApplicationInstance {
/**
* Stop the application and destroy its resources.
*/
+ @SuppressWarnings("deprecation")
public void destroy() {
if (stopped)
return;
diff -r 6c8e9229bded -r 3dd021123e21 netx/net/sourceforge/jnlp/runtime/Boot.java
--- a/netx/net/sourceforge/jnlp/runtime/Boot.java Thu Dec 02 10:22:44 2010 -0500
+++ b/netx/net/sourceforge/jnlp/runtime/Boot.java Fri Dec 03 00:30:45 2010 +0000
@@ -258,7 +258,7 @@ public final class Boot implements Privi
try {
if (new File(location).exists())
- url = new File(location).toURL(); // Why use file.getCanonicalFile?
+ url = new File(location).toURI().toURL(); // Why use file.getCanonicalFile?
else
url = new URL(ServiceUtil.getBasicService().getCodeBase(), location);
} catch (Exception e) {
diff -r 6c8e9229bded -r 3dd021123e21 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Thu Dec 02 10:22:44 2010 -0500
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Fri Dec 03 00:30:45 2010 +0000
@@ -463,13 +463,13 @@ public class JNLPClassLoader extends URL
for (JARDesc jarDesc: file.getResources().getJARs()) {
try {
File cachedFile = tracker.getCacheFile(jarDesc.getLocation());
-
+
if (cachedFile == null) {
- System.err.println("JAR " + jarDesc.getLocation() + " not found. Continuing.");
- continue; // JAR not found. Keep going.
+ System.err.println("JAR " + jarDesc.getLocation() + " not found. Continuing.");
+ continue; // JAR not found. Keep going.
}
- URL location = cachedFile.toURL();
+ URL location = cachedFile.toURI().toURL();
SecurityDesc jarSecurity = file.getSecurity();
if (file instanceof PluginBridge) {
@@ -651,7 +651,7 @@ public class JNLPClassLoader extends URL
try {
URL location = jar.getLocation(); // non-cacheable, use source location
if (localFile != null) {
- location = localFile.toURL(); // cached file
+ location = localFile.toURI().toURL(); // cached file
// This is really not the best way.. but we need some way for
// PluginAppletViewer::getCachedImageRef() to check if the image
diff -r 6c8e9229bded -r 3dd021123e21 netx/net/sourceforge/jnlp/security/PasswordAuthenticationDialog.java
--- a/netx/net/sourceforge/jnlp/security/PasswordAuthenticationDialog.java Thu Dec 02 10:22:44 2010 -0500
+++ b/netx/net/sourceforge/jnlp/security/PasswordAuthenticationDialog.java Fri Dec 03 00:30:45 2010 +0000
@@ -184,7 +184,7 @@ public class PasswordAuthenticationDialo
/**
* Present a dialog to the user asking them for authentication information
- *
+ *
* @param hostThe host for with authentication is needed
* @param port The port being accessed
* @param prompt The prompt (realm) as presented by the server
@@ -198,7 +198,8 @@ public class PasswordAuthenticationDialo
// This frame is reusable. So reset everything first.
userCancelled = true;
- jlInfo.setText("<html>The " + type + " server at " + host + " is requesting authentication. It says \"" + prompt + "\"</html>");
+ jlInfo.setText("<html>The " + type + " server at " + host +
+ " is requesting authentication. It says \"" + prompt + "\"</html>");
try {
SwingUtilities.invokeAndWait( new Runnable() {
@@ -225,7 +226,7 @@ public class PasswordAuthenticationDialo
}
if (!userCancelled) {
- auth = new PasswordAuthentication(jtfUserName.getText(), jpfPassword.getText().toCharArray());
+ auth = new PasswordAuthentication(jtfUserName.getText(), jpfPassword.getPassword());
}
} catch (Exception e) {
e.printStackTrace();
diff -r 6c8e9229bded -r 3dd021123e21 netx/net/sourceforge/jnlp/tools/JarSigner.java
--- a/netx/net/sourceforge/jnlp/tools/JarSigner.java Thu Dec 02 10:22:44 2010 -0500
+++ b/netx/net/sourceforge/jnlp/tools/JarSigner.java Fri Dec 03 00:30:45 2010 +0000
@@ -82,8 +82,6 @@ public class JarSigner implements CertVe
*/
PrivateKey privateKey;
KeyStore store;
-
- IdentityScope scope;
String keystore; // key store file
boolean nullStream = false; // null keystore input stream (NONE)
diff -r 6c8e9229bded -r 3dd021123e21 netx/net/sourceforge/nanoxml/XMLElement.java
--- a/netx/net/sourceforge/nanoxml/XMLElement.java Thu Dec 02 10:22:44 2010 -0500
+++ b/netx/net/sourceforge/nanoxml/XMLElement.java Fri Dec 03 00:30:45 2010 +0000
@@ -674,6 +674,7 @@ public class XMLElement
case '\t':
case '\n':
result.append(ch);
+ break;
case '\r':
break;
default:
diff -r 6c8e9229bded -r 3dd021123e21 plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
--- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc Thu Dec 02 10:22:44 2010 -0500
+++ b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc Fri Dec 03 00:30:45 2010 +0000
@@ -473,7 +473,7 @@ PluginRequestProcessor::setMember(std::v
// the result we want is in result_string (assuming there was no error)
if (java_result->error_occurred)
{
- printf("Unable to get member name for setMember. Error occurred: %s\n", java_result->error_msg);
+ printf("Unable to get member name for setMember. Error occurred: %s\n", java_result->error_msg->c_str());
//goto cleanup;
}
@@ -571,7 +571,7 @@ PluginRequestProcessor::sendMember(std::
// the result we want is in result_string (assuming there was no error)
if (java_result->error_occurred)
{
- printf("Unable to process getMember request. Error occurred: %s\n", java_result->error_msg);
+ printf("Unable to process getMember request. Error occurred: %s\n", java_result->error_msg->c_str());
//goto cleanup;
}
@@ -611,7 +611,7 @@ PluginRequestProcessor::sendMember(std::
// the result we want is in result_string (assuming there was no error)
if (java_result->error_occurred)
{
- printf("Unable to process getMember request. Error occurred: %s\n", java_result->error_msg);
+ printf("Unable to process getMember request. Error occurred: %s\n", java_result->error_msg->c_str());
//goto cleanup;
}
@@ -628,7 +628,7 @@ PluginRequestProcessor::sendMember(std::
// the result we want is in result_string (assuming there was no error)
if (java_result->error_occurred)
{
- printf("Unable to process getMember request. Error occurred: %s\n", java_result->error_msg);
+ printf("Unable to process getMember request. Error occurred: %s\n", java_result->error_msg->c_str());
//goto cleanup;
}
@@ -646,7 +646,7 @@ PluginRequestProcessor::sendMember(std::
// the result we want is in result_string (assuming there was no error)
if (java_result->error_occurred)
{
- printf("Unable to process getMember request. Error occurred: %s\n", java_result->error_msg);
+ printf("Unable to process getMember request. Error occurred: %s\n", java_result->error_msg->c_str());
//goto cleanup;
}
diff -r 6c8e9229bded -r 3dd021123e21 plugin/icedteanp/java/netscape/javascript/JSException.java
--- a/plugin/icedteanp/java/netscape/javascript/JSException.java Thu Dec 02 10:22:44 2010 -0500
+++ b/plugin/icedteanp/java/netscape/javascript/JSException.java Fri Dec 03 00:30:45 2010 +0000
@@ -68,13 +68,14 @@ class JSException extends RuntimeExcepti
*
* @deprecated Not for public use in future versions.
*/
+ @Deprecated
public JSException() {
- super();
+ super();
filename = "unknown";
lineno = 0;
source = "";
tokenIndex = 0;
- wrappedExceptionType = EXCEPTION_TYPE_EMPTY;
+ wrappedExceptionType = EXCEPTION_TYPE_EMPTY;
}
/**
@@ -84,26 +85,27 @@ class JSException extends RuntimeExcepti
*
* @deprecated Not for public use in future versions.
*/
+ @Deprecated
public JSException(String s) {
- super(s);
+ super(s);
filename = "unknown";
lineno = 0;
source = "";
tokenIndex = 0;
- wrappedExceptionType = EXCEPTION_TYPE_EMPTY;
+ wrappedExceptionType = EXCEPTION_TYPE_EMPTY;
}
/**
* Constructs a JSException with a wrapped JavaScript exception object.
- * This constructor needs to be public so that Java users can throw
+ * This constructor needs to be public so that Java users can throw
* exceptions to JS cleanly.
*/
public JSException(int wrappedExceptionType, Object wrappedException) {
- super();
- this.wrappedExceptionType = wrappedExceptionType;
- this.wrappedException = wrappedException;
+ super();
+ this.wrappedExceptionType = wrappedExceptionType;
+ this.wrappedException = wrappedException;
}
-
+
/**
* Constructs a JSException with a detail message and all the
* other info that usually comes with a JavaScript error.
@@ -111,14 +113,15 @@ class JSException extends RuntimeExcepti
*
* @deprecated Not for public use in future versions.
*/
+ @Deprecated
public JSException(String s, String filename, int lineno,
String source, int tokenIndex) {
- super(s);
+ super(s);
this.filename = filename;
this.lineno = lineno;
this.source = source;
this.tokenIndex = tokenIndex;
- wrappedExceptionType = EXCEPTION_TYPE_EMPTY;
+ wrappedExceptionType = EXCEPTION_TYPE_EMPTY;
}
/**
@@ -126,14 +129,14 @@ class JSException extends RuntimeExcepti
* type of the wrappedException Object.
*/
public int getWrappedExceptionType() {
- return wrappedExceptionType;
+ return wrappedExceptionType;
}
/**
* Instance method getWrappedException.
*/
public Object getWrappedException() {
- return wrappedException;
+ return wrappedException;
}
}
diff -r 6c8e9229bded -r 3dd021123e21 plugin/icedteanp/java/netscape/javascript/JSObject.java
--- a/plugin/icedteanp/java/netscape/javascript/JSObject.java Thu Dec 02 10:22:44 2010 -0500
+++ b/plugin/icedteanp/java/netscape/javascript/JSObject.java Fri Dec 03 00:30:45 2010 +0000
@@ -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.<i>name</i>" 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[<i>index</i>]" 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.<i>name</i> = <i>value</i>" 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[<i>index</i>] = <i>value</i>" 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.<i>methodName</i>(<i>args</i>[0], <i>args</i>[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)
{
More information about the distro-pkg-dev
mailing list