classpath-patches
[Top][All Lists]
Advanced

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

[cp-patches] Re: [gui] Some (random) AWT and Swing fixlets


From: Thomas Fitzsimmons
Subject: [cp-patches] Re: [gui] Some (random) AWT and Swing fixlets
Date: Sun, 13 Feb 2005 15:53:04 -0500

Hi,

> -   * @return the specified keystroke
> -   * @throws NullPointerException if s is null
> -   * @throws IllegalArgumentException if s cannot be parsed
> +   * @return the specified keystroke, or null when s is null
> +   * or cannot be parsed correctly.

The javadocs disagree with this change.

> +  /**
> +   * Returns the viewSize when set, or the size of the set Component
> view.
> +   * If no viewSize and no Component view is set an empty Dimension
> is
> +   * returned.
> +   */
>    public Dimension getViewSize()
>    {
>      if (isViewSizeSet)
>        return viewSize;
>      else
> -      return getView().getSize();
> +      {
> +       Component view = getView();
> +       if (view != null)
> +         return view.getSize();

According to the javadocs, you should be returning the preferred size
here.

The other changes are fine.

Tom






reply via email to

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