classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] RFC: BasicTabbedPaneUI paint null Icon?


From: Roman Kennke
Subject: Re: [cp-patches] RFC: BasicTabbedPaneUI paint null Icon?
Date: Sat, 26 Nov 2005 00:19:46 +0100

Am Freitag, den 25.11.2005, 14:58 +0100 schrieb Mark Wielaard:
> Hi,
> 
> On Tue, 2005-11-22 at 01:03 +0100, Mark Wielaard wrote:
> > This one is a little strange. Apparently the plastic laf overrides
> > getIconForTab(int) and returns null in certain cases. But then it still
> > calls paintIcon on it. I cannot find too much documentation on this, but
> > this seems the correct thing to do:
> > 
> > 2005-11-21  Mark Wielaard  <address@hidden>
> > 
> >     * javax/swing/plaf/basic/BasicTabbedPaneUI.java (paintIcon): Only
> >     paint icon when not null.
> > 
> > Comments?
> 
> Several people on irc said that they found it strange, but saw no
> problem with it since it fixes a real current problem.

I think this is quite common in the laf classes. They have to deal with
possible null value because the methods are intended to be overridden in
most cases and the implementation therefore cannot guarantee that some
field or method does not return null. I have also seen this in various
other UI classes as well.

/Roman

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

[Prev in Thread] Current Thread [Next in Thread]