This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [gui] Some (random) AWT and Swing fixlets
- From: Thomas Fitzsimmons <fitzsim at redhat dot com>
- To: Mark Wielaard <mark at klomp dot org>
- Cc: classpath-patches at gnu dot org, libgcj patches <java-patches at gcc dot gnu dot org>
- Date: Sun, 13 Feb 2005 15:53:04 -0500
- Subject: Re: [gui] Some (random) AWT and Swing fixlets
- References: <1108307558.6505.169.camel@localhost.localdomain>
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