changeset 464:13ca1c870b92

Minor cleanup that removes avoidable code from loop.
author Saad Mohammad <smohammad@redhat.com>
date Mon, 09 Jul 2012 15:45:42 -0400
parents 0e3c3f0aeb1f
children 270a09e38dfb
files ChangeLog netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
diffstat 2 files changed, 17 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jul 09 14:50:22 2012 -0400
+++ b/ChangeLog	Mon Jul 09 15:45:42 2012 -0400
@@ -1,3 +1,8 @@
+2012-07-09  Saad Mohammad  <smohammad@redhat.com>
+
+	* netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (initializeExtensions):
+	Checks and assigns the main-class name prior to the for loop.
+
 2012-07-09  Martin Olsson  <martin@minimum.se>
 
 	* plugin/icedteanp/IcedTeaPluginUtils.cc: Change calls from g_free
--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Mon Jul 09 14:50:22 2012 -0400
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Mon Jul 09 15:45:42 2012 -0400
@@ -433,23 +433,22 @@
 
         loaderList.add(this);
 
+        if (mainClass == null) {
+            Object obj = file.getLaunchInfo();
+
+            if (obj instanceof ApplicationDesc) {
+                ApplicationDesc ad = (ApplicationDesc) file.getLaunchInfo();
+                mainClass = ad.getMainClass();
+            } else if (obj instanceof AppletDesc) {
+                AppletDesc ad = (AppletDesc) file.getLaunchInfo();
+                mainClass = ad.getMainClass();
+            }
+        }
+
         //if (ext != null) {
         for (int i = 0; i < ext.length; i++) {
             try {
                 String uniqueKey = this.getJNLPFile().getUniqueKey();
-
-                if (mainClass == null) {
-                    Object obj = file.getLaunchInfo();
-
-                    if (obj instanceof ApplicationDesc) {
-                        ApplicationDesc ad = (ApplicationDesc) file.getLaunchInfo();
-                        mainClass = ad.getMainClass();
-                    } else if (obj instanceof AppletDesc) {
-                        AppletDesc ad = (AppletDesc) file.getLaunchInfo();
-                        mainClass = ad.getMainClass();
-                    }
-                }
-
                 JNLPClassLoader loader = getInstance(ext[i].getLocation(), uniqueKey, ext[i].getVersion(), updatePolicy, mainClass);
                 loaderList.add(loader);
             } catch (Exception ex) {