This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]