/hg/icedtea-web: remove control panel's dependency on JNLPRuntim...

Andrew Su asu at redhat.com
Wed Jan 12 07:00:24 PST 2011


Hello Omair,

I was trying to use control panel to set some values, but noticed the look and feel was not how it should be and also I get a few exceptions from CertificatePane.

java.lang.NullPointerException
	at java.io.File.<init>(File.java:239)
	at net.sourceforge.jnlp.security.KeyStores.getKeyStore(KeyStores.java:124)
	at net.sourceforge.jnlp.security.KeyStores.getKeyStore(KeyStores.java:103)
	at net.sourceforge.jnlp.security.viewer.CertificatePane.initializeKeyStore(CertificatePane.java:148)
	at net.sourceforge.jnlp.security.viewer.CertificatePane.repopulateTables(CertificatePane.java:285)
	at net.sourceforge.jnlp.security.viewer.CertificatePane.<init>(CertificatePane.java:140)
	at net.sourceforge.jnlp.controlpanel.ControlPanel.createCertificatesSettingsPanel(ControlPanel.java:276)
	at net.sourceforge.jnlp.controlpanel.ControlPanel.createMainSettingsPanel(ControlPanel.java:220)
	at net.sourceforge.jnlp.controlpanel.ControlPanel.<init>(ControlPanel.java:108)
	at net.sourceforge.jnlp.controlpanel.ControlPanel$5.run(ControlPanel.java:360)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:602)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
java.lang.NullPointerException
	at net.sourceforge.jnlp.security.viewer.CertificatePane.readKeyStore(CertificatePane.java:258)
	at net.sourceforge.jnlp.security.viewer.CertificatePane.repopulateTables(CertificatePane.java:286)
	at net.sourceforge.jnlp.security.viewer.CertificatePane.<init>(CertificatePane.java:140)
	at net.sourceforge.jnlp.controlpanel.ControlPanel.createCertificatesSettingsPanel(ControlPanel.java:276)
	at net.sourceforge.jnlp.controlpanel.ControlPanel.createMainSettingsPanel(ControlPanel.java:220)
	at net.sourceforge.jnlp.controlpanel.ControlPanel.<init>(ControlPanel.java:108)
	at net.sourceforge.jnlp.controlpanel.ControlPanel$5.run(ControlPanel.java:360)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:602)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)


The reason the use of JNLPRuntime was so that CertificatePane didn't do this + it also sets the look and feel.

Regards,
  Andrew


----- Original Message -----
> From: omajid at icedtea.classpath.org
> To: distro-pkg-dev at openjdk.java.net
> Sent: Tuesday, January 4, 2011 2:45:25 PM
> Subject: /hg/icedtea-web: remove control panel's dependency on JNLPRuntim...
> changeset c938ea901f2f in /hg/icedtea-web
> details:
> http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=c938ea901f2f
> author: Omair Majid <omajid at redhat.com>
> date: Tue Jan 04 14:45:10 2011 -0500
> 
> remove control panel's dependency on JNLPRuntime and other minor
> cleanup
> 
> 2011-01-04 Omair Majid <omajid at redhat.com>
> 
> * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java:
> Remove JNLPRuntime import. Remove configBrowserCommand.
> (createMainSettingsPanel): Remove call to loadConfiguration.
> (loadConfiguration): Remove method. Setting the browser command
> should be handled by the appropriate panel. (main): Remove call
> to JNLPRuntime.initialize and just create a new
> DeploymentConfiguration object. Clarify TODO comment.
> 
> 
> diffstat:
> 
> 2 files changed, 19 insertions(+), 22 deletions(-)
> ChangeLog | 10 ++++
> netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java | 31
> ++++----------
> 
> diffs (96 lines):
> 
> diff -r 8e1b7bb5f2fc -r c938ea901f2f ChangeLog
> --- a/ChangeLog Tue Jan 04 13:08:25 2011 -0500
> +++ b/ChangeLog Tue Jan 04 14:45:10 2011 -0500
> @@ -1,3 +1,13 @@ 2011-01-04 Omair Majid <omajid at redhat.
> +2011-01-04 Omair Majid <omajid at redhat.com>
> +
> + * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: Remove
> + JNLPRuntime import. Remove configBrowserCommand.
> + (createMainSettingsPanel): Remove call to loadConfiguration.
> + (loadConfiguration): Remove method. Setting the browser command
> + should be handled by the appropriate panel.
> + (main): Remove call to JNLPRuntime.initialize and just create a new
> + DeploymentConfiguration object. Clarify TODO comment.
> +
> 2011-01-04 Omair Majid <omajid at redhat.com>
> 
> * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
> diff -r 8e1b7bb5f2fc -r c938ea901f2f
> netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java
> --- a/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java Tue Jan
> 04 13:08:25 2011 -0500
> +++ b/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java Tue Jan
> 04 14:45:10 2011 -0500
> @@ -1,5 +1,5 @@
> /* ControlPanel.java -- Display the control panel for modifying
> deployment settings.
> -Copyright (C) 2010 Red Hat
> +Copyright (C) 2011 Red Hat
> 
> This program is free software; you can redistribute it and/or modify
> it under the terms of the GNU General Public License as published by
> @@ -52,7 +52,6 @@ import javax.swing.event.ListSelectionLi
> import javax.swing.event.ListSelectionListener;
> 
> import net.sourceforge.jnlp.config.DeploymentConfiguration;
> -import net.sourceforge.jnlp.runtime.JNLPRuntime;
> import net.sourceforge.jnlp.runtime.Translator;
> import net.sourceforge.jnlp.security.viewer.CertificatePane;
> 
> @@ -91,11 +90,6 @@ public class ControlPanel extends JFrame
> }
> 
> private DeploymentConfiguration config = null;
> -
> - /*
> - * actual configuration options
> - */
> - private String configBrowserCommand = null;
> 
> /**
> * Creates a new instance of the ControlPanel.
> @@ -223,8 +217,6 @@ public class ControlPanel extends JFrame
> */
> private JPanel createMainSettingsPanel() {
> 
> - loadConfiguration();
> -
> SettingsPanel[] panels = new SettingsPanel[] { new
> SettingsPanel(Translator.R("CPTabAbout"), createAboutPanel()),
> new SettingsPanel(Translator.R("CPTabCache"),
> createCacheSettingsPanel()),
> new SettingsPanel(Translator.R("CPTabCertificate"),
> createCertificatesSettingsPanel()),
> @@ -338,16 +330,6 @@ public class ControlPanel extends JFrame
> }
> 
> /**
> - * Get the location of the browser.
> - */
> - private void loadConfiguration() {
> - configBrowserCommand =
> config.getProperty("deployment.browser.path");
> - if (configBrowserCommand == null) {
> - configBrowserCommand = "";
> - }
> - }
> -
> - /**
> * Save the configuration changes.
> */
> private void saveConfiguration() {
> @@ -359,14 +341,19 @@ public class ControlPanel extends JFrame
> }
> 
> public static void main(String[] args) throws Exception {
> - JNLPRuntime.initialize(true);
> - final DeploymentConfiguration config =
> JNLPRuntime.getConfiguration();
> + final DeploymentConfiguration config = new
> DeploymentConfiguration();
> try {
> config.load();
> } catch (ConfigurationException e) {
> - // TODO Auto-generated catch block
> + // FIXME inform user about this and exit properly
> + // the only known condition under which this can happen is when a
> + // required system configuration file is not found
> +
> + // if configuration is not loaded, we will get NullPointerExceptions
> + // everywhere
> e.printStackTrace();
> }
> +
> SwingUtilities.invokeLater(new Runnable() {
> @Override
> public void run() {



More information about the distro-pkg-dev mailing list