changeset 305:9f5ea9198a66

PR778: Jar download and server certificate verification deadlock
author Deepak Bhole <dbhole@redhat.com>
date Thu, 27 Oct 2011 18:24:46 -0400
parents 64211e906133
children 89b7a28ccafb 614de01ec4e4
files ChangeLog NEWS netx/net/sourceforge/jnlp/GuiLaunchHandler.java
diffstat 3 files changed, 41 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Oct 25 10:02:45 2011 -0400
+++ b/ChangeLog	Thu Oct 27 18:24:46 2011 -0400
@@ -1,3 +1,11 @@
+2011-10-27  Deepak Bhole <dbhole@redhat.com>
+
+	PR778: Jar download and server certificate verification deadlock
+	* ChangeLog: Removed extra whitespace from previous entries
+	* NEWS: Updated
+	* netx/net/sourceforge/jnlp/GuiLaunchHandler.java (launchInitialized):
+	Moved as much code as possible out of the invokeLater block. 
+
 2011-10-25  Omair Majid  <omajid@redhat.com>
 
 	PR804: javaws launcher incorrectly handles file names with spaces
@@ -6,7 +14,7 @@
 	filenames with spaces correctly.
 
 2011-10-24  Jiri Vanek <jvanek@redhat.com>  
- 
+
 	Added reproducer for - PR788: Elluminate Live! is not working
 	* tests/jnlp_tests/signed/MissingJar/resources/MissingJar.jnlp
 	* tests/jnlp_tests/signed/MissingJar/resources/MissingJar2.jnlp
@@ -19,7 +27,7 @@
 	testing file of reproducer, launchiing above four jnlp files, each in individual test
 
 2011-10-17  Jiri Vanek <jvanek@redhat.com>   
-    
+
 	PR564: NetX depends on sun.misc.BASE64Encoder
 	* configure.ac: removed IT564 comment, removed check for sun.misc.BASE64Encoder
 	* netx/net/sourceforge/jnlp/security/CertificateUtils.java : sun.misc.BASE64Encoder;
--- a/NEWS	Tue Oct 25 10:02:45 2011 -0400
+++ b/NEWS	Thu Oct 27 18:24:46 2011 -0400
@@ -26,6 +26,7 @@
   - PR771: IcedTea-Web certificate verification code does not use the right API
   - PR742: IcedTea-Web checks certs only upto 1 level deep before declaring them untrusted.
   - PR769: IcedTea-Web does not work with some ssl sites with OpenJDK7
+  - PR778: Jar download and server certificate verification deadlock
   - PR789: typo in jrunscript.sh
   - PR794: IcedTea-Web does not work if a Web Start app jar has a Class-Path element in the manifest
   - RH734081: Javaws cannot use proxy settings from Firefox
--- a/netx/net/sourceforge/jnlp/GuiLaunchHandler.java	Tue Oct 25 10:02:45 2011 -0400
+++ b/netx/net/sourceforge/jnlp/GuiLaunchHandler.java	Thu Oct 27 18:24:46 2011 -0400
@@ -37,6 +37,7 @@
 
 package net.sourceforge.jnlp;
 
+import java.lang.reflect.InvocationTargetException;
 import java.net.URL;
 
 import javax.swing.SwingUtilities;
@@ -95,20 +96,40 @@
 
     @Override
     public void launchInitialized(final JNLPFile file) {
+        
+        int preferredWidth = 500;
+        int preferredHeight = 400;
+
+        final URL splashImageURL = file.getInformation().getIconLocation(
+                IconDesc.SPLASH, preferredWidth, preferredHeight);
+
+        if (splashImageURL != null) {
+            final ResourceTracker resourceTracker = new ResourceTracker(true);
+            resourceTracker.addResource(splashImageURL, file.getFileVersion(), null, policy);
+            synchronized(mutex) {
+                try {
+                    SwingUtilities.invokeAndWait(new Runnable() {
+                        @Override
+                        public void run() {
+                            splashScreen = new JNLPSplashScreen(resourceTracker, null, null);
+                        }
+                    });
+                } catch (InterruptedException ie) {
+                    // Wait till splash screen is created
+                    while (splashScreen == null);
+                } catch (InvocationTargetException ite) {
+                    ite.printStackTrace();
+                }
+
+                splashScreen.setSplashImageURL(splashImageURL);
+            }
+        }
+        
         SwingUtilities.invokeLater(new Runnable() {
             @Override
             public void run() {
-                final int preferredWidth = 500;
-                final int preferredHeight = 400;
-
-                URL splashImageURL = file.getInformation().getIconLocation(
-                        IconDesc.SPLASH, preferredWidth, preferredHeight);
                 if (splashImageURL != null) {
-                    ResourceTracker resourceTracker = new ResourceTracker(true);
-                    resourceTracker.addResource(splashImageURL, file.getFileVersion(), null, policy);
                     synchronized(mutex) {
-                        splashScreen = new JNLPSplashScreen(resourceTracker, null, null);
-                        splashScreen.setSplashImageURL(splashImageURL);
                         if (splashScreen.isSplashScreenValid()) {
                             splashScreen.setVisible(true);
                         }