This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [PATCH] Remove NullPointerExceptions in FileDialog
- From: Michael Koch <konqueror at gmx dot de>
- To: Fernando Nasser <fnasser at redhat dot com>
- Cc: GCJ Patches <java-patches at gcc dot gnu dot org>
- Date: Tue, 16 Dec 2003 21:23:07 +0100
- Subject: Re: [PATCH] Remove NullPointerExceptions in FileDialog
- References: <3FDF676F.3040404@redhat.com>
On Tue, Dec 16, 2003 at 03:13:35PM -0500, Fernando Nasser wrote:
> We return null but don't test for it.
>
> 2003-12-16 Fernando Nasser <fnasser@redhat.com>
>
> * gnu/java/awt/peer/gtk/GtkContainerPeer.java (handleEvent):
> Check for
> null Graphics pointer returned by FileDialogPeer.
> Index: gnu/java/awt/peer/gtk/GtkContainerPeer.java
> ===================================================================
> RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java,v
> retrieving revision 1.4
> diff -c -p -r1.4 GtkContainerPeer.java
> *** gnu/java/awt/peer/gtk/GtkContainerPeer.java 2 Oct 2003 18:34:56 -0000 1.4
> --- gnu/java/awt/peer/gtk/GtkContainerPeer.java 16 Dec 2003 20:10:39 -0000
> *************** public class GtkContainerPeer extends Gt
> *** 107,112 ****
> --- 107,117 ----
> try
> {
> Graphics g = getGraphics ();
> +
> + // Some peers like GtkFileDialogPeer are repainted by Gtk itself
> + if (null == g)
I think its more common to write "g == null".
> + break;
> +
> g.setClip (((PaintEvent)event).getUpdateRect());
>
> if (id == PaintEvent.PAINT)
Michael