# HG changeset patch # User Saad Mohammad # Date 1341863142 14400 # Node ID 13ca1c870b92f68fdb13a7bf6d5d296f2a2498e1 # Parent 0e3c3f0aeb1f95d09392ce12a9a42ba6c40696d7 Minor cleanup that removes avoidable code from loop. diff -r 0e3c3f0aeb1f -r 13ca1c870b92 ChangeLog --- 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 + + * 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 * plugin/icedteanp/IcedTeaPluginUtils.cc: Change calls from g_free diff -r 0e3c3f0aeb1f -r 13ca1c870b92 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java --- 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) {