[rfc][icedtea-web]: Hide unsupported security options in itw-settings

Deepak Bhole dbhole at redhat.com
Tue Jan 4 02:35:58 PST 2011


* Deepak Bhole <dbhole at redhat.com> [2011-01-04 11:04]:
> * Andrew Su <asu at redhat.com> [2011-01-04 10:51]:
> > Hello,
> > 
> > This is a simple patch for hiding the values. getProperty() in DeploymentConfigurations.java was changed such that null is returned instead of a NullPointerException being thrown in the case that the value is not set. This patch  adds a check to see if the value is null and proceed to next item.
> > 
> 
> 
> If getProperty returns null, s will be null and Boolean.parseBoolean(s)
> will throw an exception, so existing code will still work.
> 
> Is this patch to do it the 'right way' or to fix some sort of error you
> are encountering?
> 

Sorry, ignore that. parseBoolean returns false if string is null.

Patch looks fine to me in that case. OK for head (and 1.0 if it is
affected).

Deepak

> Cheers,
> Deepak
> 
> > Comments?
> > 
> > --Andrew
> 
> > diff -r c7922247b6d2 netx/net/sourceforge/jnlp/controlpanel/SecuritySettingsPanel.java
> > --- a/netx/net/sourceforge/jnlp/controlpanel/SecuritySettingsPanel.java	Thu Dec 23 16:55:17 2010 -0500
> > +++ b/netx/net/sourceforge/jnlp/controlpanel/SecuritySettingsPanel.java	Tue Jan 04 10:47:54 2011 -0500
> > @@ -114,16 +114,16 @@
> >  
> >          // Only display the ones with properties that are valid or existent.
> >          for (int i = 0; i < properties.length; i++) {
> > -            try {
> > -                String s = config.getProperty(properties[i]);
> > -                securityGeneralOptions[i].setSelected(Boolean.parseBoolean(s));
> > -                securityGeneralOptions[i].setActionCommand(properties[i]);
> > -                securityGeneralOptions[i].addActionListener(this);
> > -                c.gridy = i + 1;
> > -                topPanel.add(securityGeneralOptions[i], c);
> > -            } catch (Exception e) {
> > +            String s = config.getProperty(properties[i]);
> > +            if (s == null) {
> >                  securityGeneralOptions[i] = null;
> > +                continue;
> >              }
> > +            securityGeneralOptions[i].setSelected(Boolean.parseBoolean(s));
> > +            securityGeneralOptions[i].setActionCommand(properties[i]);
> > +            securityGeneralOptions[i].addActionListener(this);
> > +            c.gridy = i + 1;
> > +            topPanel.add(securityGeneralOptions[i], c);
> >          }
> >  
> >          Component filler = Box.createRigidArea(new Dimension(1, 1));
> 



More information about the distro-pkg-dev mailing list