From 1eab484ec7b4de98d3d3941e7643047acbbcb804 Mon Sep 17 00:00:00 2001 From: Adam Domurad Date: Tue, 23 Apr 2013 13:27:20 -0400 Subject: Clean-up of dead & outdated parts of NetxPanel --- ChangeLog | 11 ++++++++ netx/net/sourceforge/jnlp/NetxPanel.java | 33 ++++------------------ .../java/sun/applet/PluginAppletPanelFactory.java | 2 +- 3 files changed, 17 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 855642c..4137be5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2013-04-23 Adam Domurad + + * netx/net/sourceforge/jnlp/NetxPanel.java + (exitOnFailure): Remove always-false field. + (NetxPanel): Remove overloaded constructor + (runLoader): Do not swallow LaunchException's. Remove dead + exitOnFailure code-path. Set applet status to APPLET_ERROR on + exception. + * plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java + (createPanel): Update call to NetxPanel constructor. + 2013-04-23 Adam Domurad * tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.html: diff --git a/netx/net/sourceforge/jnlp/NetxPanel.java b/netx/net/sourceforge/jnlp/NetxPanel.java index e9647c8..b8e2388 100644 --- a/netx/net/sourceforge/jnlp/NetxPanel.java +++ b/netx/net/sourceforge/jnlp/NetxPanel.java @@ -46,7 +46,6 @@ import sun.awt.SunToolkit; public class NetxPanel extends AppletViewerPanel implements SplashController { private final PluginParameters parameters; private PluginBridge bridge = null; - private boolean exitOnFailure = true; private AppletInstance appInst = null; private SplashController splashController; private boolean appletAlive; @@ -79,13 +78,6 @@ public class NetxPanel extends AppletViewerPanel implements SplashController { uKeyToTG.put(uniqueKey, tg); } } - } - - // overloaded constructor, called when initialized via plugin - public NetxPanel(URL documentURL, PluginParameters params, - boolean exitOnFailure) { - this(documentURL, params); - this.exitOnFailure = exitOnFailure; this.appletAlive = true; } @@ -117,28 +109,12 @@ public class NetxPanel extends AppletViewerPanel implements SplashController { dispatchAppletEvent(APPLET_LOADING, null); status = APPLET_LOAD; - Launcher l = new Launcher(exitOnFailure); + Launcher l = new Launcher(false); - try { - appInst = (AppletInstance) l.launch(bridge, this); - } catch (LaunchException e) { - // Assume user has indicated he does not trust the - // applet. - if (exitOnFailure) - System.exit(1); - } + // May throw LaunchException: + appInst = (AppletInstance) l.launch(bridge, this); applet = appInst.getApplet(); - //On the other hand, if you create an applet this way, it'll work - //fine. Note that you might to open visibility in sun.applet.AppletPanel - //for this to work (the loader field, and getClassLoader). - //loader = getClassLoader(getCodeBase(), getClassLoaderCacheKey()); - //applet = createApplet(loader); - - // This shows that when using NetX's JNLPClassLoader, keyboard input - // won't make it to the applet, whereas using sun.applet.AppletClassLoader - // works just fine. - if (applet != null) { // Stick it in the frame applet.setStub(this); @@ -149,12 +125,13 @@ public class NetxPanel extends AppletViewerPanel implements SplashController { } } catch (Exception e) { this.appletAlive = false; + status = APPLET_ERROR; e.printStackTrace(); replaceSplash(SplashUtils.getErrorSplashScreen(getWidth(), getHeight(), e)); } finally { // PR1157: This needs to occur even in the case of an exception // so that the applet's event listeners are signaled. - // Once PluginAppletViewer.AppletEventListener is signaled PluginAppletViewer it can properly stop waiting + // Once PluginAppletViewer.AppletEventListener is signaled PluginAppletViewer can properly stop waiting // in PluginAppletViewer.waitForAppletInit dispatchAppletEvent(APPLET_LOADING_COMPLETED, null); } diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java b/plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java index 122313e..961df66 100644 --- a/plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java +++ b/plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java @@ -85,7 +85,7 @@ class PluginAppletPanelFactory { final PluginParameters params) { final NetxPanel panel = AccessController.doPrivileged(new PrivilegedAction() { public NetxPanel run() { - NetxPanel panel = new NetxPanel(doc, params, false); + NetxPanel panel = new NetxPanel(doc, params); NetxPanel.debug("Using NetX panel"); PluginDebug.debug(params.toString()); return panel; -- cgit v1.2.3