diff options
author | Adam Domurad <[email protected]> | 2012-05-25 11:44:13 -0400 |
---|---|---|
committer | Adam Domurad <[email protected]> | 2012-05-25 11:44:13 -0400 |
commit | 1705caf0db175cb9537313e5c1d9df14186f5bea (patch) | |
tree | 53e206445b682f387d27f3ba762eb70899caefa3 /plugin/icedteanp | |
parent | ef79a2eab042f66aa10a2356d9a6f80f5b8d544f (diff) |
Changed for-loops over iterators and indices to for-each loops if they
were sufficient and clearer.
Diffstat (limited to 'plugin/icedteanp')
4 files changed, 20 insertions, 21 deletions
diff --git a/plugin/icedteanp/java/netscape/javascript/JSObject.java b/plugin/icedteanp/java/netscape/javascript/JSObject.java index a2f200f..0de500f 100644 --- a/plugin/icedteanp/java/netscape/javascript/JSObject.java +++ b/plugin/icedteanp/java/netscape/javascript/JSObject.java @@ -130,9 +130,9 @@ public final class JSObject { 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")) { + for (StackTraceElement element : stack) { + if (element.getClassName().equals("netscape.javascript.JSObject") && + element.getMethodName().equals("getWindow")) { mayProceed = true; } } @@ -209,8 +209,9 @@ public final class JSObject { args = new Object[0]; PluginDebug.debug("JSObject.call ", methodName); - for (int i = 0; i < args.length; i++) - PluginDebug.debug(" ", args[i]); + for (Object arg : args) { + PluginDebug.debug(" ", arg); + } PluginDebug.debug(""); return PluginAppletViewer.call(internal, methodName, args); } diff --git a/plugin/icedteanp/java/sun/applet/JavaConsole.java b/plugin/icedteanp/java/sun/applet/JavaConsole.java index e3af966..9074e1b 100644 --- a/plugin/icedteanp/java/sun/applet/JavaConsole.java +++ b/plugin/icedteanp/java/sun/applet/JavaConsole.java @@ -308,8 +308,8 @@ public class JavaConsole { boolean toShowConsole = false; - for (int i = 0; i < args.length; i++) { - if (args[i] == "--show-console") { + for (String arg : args) { + if ("--show-console".equals(arg)) { toShowConsole = true; } } diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java index 402fa99..733c644 100644 --- a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java +++ b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java @@ -1295,9 +1295,7 @@ public class PluginAppletSecurityContext { Permissions grantedPermissions = new Permissions(); - for (int i = 0; i < nsPrivilegeList.length; i++) { - String privilege = nsPrivilegeList[i]; - + for (String privilege : nsPrivilegeList) { if (privilege.equals("UniversalBrowserRead")) { BrowserReadPermission bp = new BrowserReadPermission(); grantedPermissions.add(bp); diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java index 6f4f2eb..35997bb 100644 --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java @@ -237,27 +237,27 @@ class PluginAppletPanelFactory { // ","-separated list. No error-checking will be done on the list. String[] events = eventList.split(","); - for (int i = 0; i < events.length; i++) { - PluginDebug.debug("Adding event to queue: ", events[i]); - if (events[i].equals("dispose")) + for (String event : events) { + PluginDebug.debug("Adding event to queue: ", event); + if ("dispose".equals(event)) panel.sendEvent(AppletPanel.APPLET_DISPOSE); - else if (events[i].equals("load")) + else if ("load".equals(event)) panel.sendEvent(AppletPanel.APPLET_LOAD); - else if (events[i].equals("init")) + else if ("init".equals(event)) panel.sendEvent(AppletPanel.APPLET_INIT); - else if (events[i].equals("start")) + else if ("start".equals(event)) panel.sendEvent(AppletPanel.APPLET_START); - else if (events[i].equals("stop")) + else if ("stop".equals(event)) panel.sendEvent(AppletPanel.APPLET_STOP); - else if (events[i].equals("destroy")) + else if ("destroy".equals(event)) panel.sendEvent(AppletPanel.APPLET_DESTROY); - else if (events[i].equals("quit")) + else if ("quit".equals(event)) panel.sendEvent(AppletPanel.APPLET_QUIT); - else if (events[i].equals("error")) + else if ("error".equals(event)) panel.sendEvent(AppletPanel.APPLET_ERROR); else // non-fatal error if we get an unrecognized event - PluginDebug.debug("Unrecognized event name: ", events[i]); + PluginDebug.debug("Unrecognized event name: ", event); } while (!panel.emptyEventQueue()) |