diff options
author | Adam Domurad <[email protected]> | 2013-01-04 12:32:15 -0500 |
---|---|---|
committer | Adam Domurad <[email protected]> | 2013-01-04 12:32:15 -0500 |
commit | 64c8b9f0e79e2ad23204ffc28284e28182790dab (patch) | |
tree | 8ef10040b74fd0d50fd597863220d975813124ac /plugin/icedteanp/java/sun/applet | |
parent | d1ca9a30f57331877bf8e87927bf6f46aba12d62 (diff) |
Minor code formatting & cosmetic changes
Diffstat (limited to 'plugin/icedteanp/java/sun/applet')
-rw-r--r-- | plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java | 14 | ||||
-rw-r--r-- | plugin/icedteanp/java/sun/applet/PluginAppletViewer.java | 10 |
2 files changed, 14 insertions, 10 deletions
diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java index 733c644..dc209ff 100644 --- a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java +++ b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java @@ -53,13 +53,16 @@ import java.security.Permissions; import java.security.PrivilegedAction; import java.security.ProtectionDomain; import java.util.ArrayList; +import java.util.Arrays; import java.util.Hashtable; import java.util.List; import java.util.Map; -import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.DefaultLaunchHandler; +import net.sourceforge.jnlp.runtime.JNLPRuntime; +import netscape.javascript.JSObject; import netscape.javascript.JSObjectCreatePermission; +import netscape.javascript.JSUtil; class Signature { private String signature; @@ -489,9 +492,7 @@ public class PluginAppletSecurityContext { final Object fValue = MethodOverloadResolver.getCostAndCastedObject(value, f.getType())[1]; AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext(); - checkPermission(src, - message.startsWith("SetStaticField") ? (Class) o : o.getClass(), - acc); + checkPermission(src, message.startsWith("SetStaticField") ? (Class) o : o.getClass(), acc); Object ret = AccessController.doPrivileged(new PrivilegedAction<Object>() { public Object run() { @@ -514,8 +515,9 @@ public class PluginAppletSecurityContext { Integer arrayID = parseCall(args[1], null, Integer.class); Integer index = parseCall(args[2], null, Integer.class); - Object ret = Array.get(store.getObject(arrayID), index); - Class retClass = store.getObject(arrayID).getClass().getComponentType(); // prevent auto-boxing influence + Object array = store.getObject(arrayID); + Object ret = Array.get(array, index); + Class<?> retClass = array.getClass().getComponentType(); // prevent auto-boxing influence if (ret == null) { write(reference, "GetObjectArrayElement literalreturn null"); diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java index c98899a..3a56133 100644 --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java @@ -1014,9 +1014,10 @@ public class PluginAppletViewer extends XEmbeddedFrame } public static void setMember(long internal, String name, Object value) { - System.err.println("Setting to class " + value.getClass() + ":" + value.getClass().isPrimitive()); - AppletSecurityContextManager.getSecurityContext(0).store(name); - int nameID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(name); + PluginDebug.debug("Setting to class " + value.getClass() + ":" + value.getClass().isPrimitive()); + PluginAppletSecurityContext securityContext = AppletSecurityContextManager.getSecurityContext(0); + securityContext.store(name); + int nameID = securityContext.getIdentifier(name); Long reference = getRequestIdentifier(); // work on a copy of value, as we don't want to be manipulating @@ -1072,7 +1073,8 @@ public class PluginAppletViewer extends XEmbeddedFrame // FIXME: handle long index as well. public static void setSlot(long internal, int index, Object value) { - AppletSecurityContextManager.getSecurityContext(0).store(value); + PluginAppletSecurityContext securityContext = AppletSecurityContextManager.getSecurityContext(0); + securityContext.store(value); Long reference = getRequestIdentifier(); // work on a copy of value, as we don't want to be manipulating |