[icedtea-web] RFC: PR857: Don't set look and feel multiple times

Jiri Vanek jvanek at redhat.com
Sun Mar 2 23:51:45 PST 2014

On 03/01/2014 12:07 AM, Omair Majid wrote:
> Hi,
> The attached patch is a fix for PR857. The idea is quite simple: make
> sure UIManager.setLookAndFeel() is called at most once (and ideally
> exactly once) before any UI is shown.
> There are a few code paths that can cause UIManager.setLookAndFell to be
> invoked multiple times:
> - AboutDialog (only on entry from a class other than Boot)
> - SecurityDialog
> - PolicyEditor (only on entry from ControlPanel)
> CertificateViewer calls JNLPRuntime.initialize() which already calls
> UIManager.setLookAndFeel. So I have removed the direct call from
> CertificateViewer.
> Also, JNLPRuntime.initialize currently calls setLookAndFeel after
> displaying a JavaConsole. This is alos fixed.
> Thoughts?

ouch, that an old one!

However - the original one - http://icedtea.classpath.org/bugzilla/attachment.cgi?id=640&action=diff 
- (the confirmed one)  is quite different, why so?

Also   " Don't set look and feel multiple times" do not sound proper to me, it is still set two 
times. Can't there be only one place to do so? There *should* be. I'm sometimes thinking about one 
clear way where to do all preinit work common for both plugin and javaws....

Although this is copypaste:
+                } catch (Exception e) {
+                    // if it fails, not a problem
+                }
I would rather log the exception.

and althoug this is c&p to,
+        try {
+            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+        } catch (Exception e) {
+            OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e);
+        }
I would ratehr log this exception in debug only (default) =?
-            OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e);
+            OutputController.getLogger().log(e);



More information about the distro-pkg-dev mailing list