Hi,

On Thu, 2005-08-18 at 11:46 -0400, Lillian Angel wrote:
> 2005-08-18  Lillian Angel  <[EMAIL PROTECTED]>
> 
>         * javax/swing/tree/DefaultTreeCellRenderer.java
>         (paint): Added check for null border.

> +      Insets insets = new Insets(0, 0, 0, 0);
> +      Border border = UIManager.getLookAndFeelDefaults().getBorder
> +            ("Tree.selectionBorder");
> +      if (border != null) 
> +        insets = border.getBorderInsets(this);

Just a little performance note. This would be a little more efficient:

      Border border = UIManager.getLookAndFeelDefaults().getBorder
            ("Tree.selectionBorder");
      Insets inset;
      if (border != null) 
        insets = border.getBorderInsets(this);
      else
        insets = new Insets(0, 0, 0, 0);

That way you don't always create a new Insets object that might
immediately turn into garbage.

Cheers,

Mark

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to