Hi,

Andreas found an regression in the AWT demo. setXORMode() would throw
NullPointerExceptions because color could be null. This is the smallest
patch that I could think of to fix this for now.

 2005-11-02  Mark Wielaard  <[EMAIL PROTECTED]>

   * gnu/java/awt/peer/gtk/GdkGraphics.java (initComponentGraphics): Set
   color to BLACK when getForeground() returns null.
   (initComponentGraphicsUnlocked): Likewise.

Committed,

Mark
Index: gnu/java/awt/peer/gtk/GdkGraphics.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GdkGraphics.java,v
retrieving revision 1.48
diff -u -r1.48 GdkGraphics.java
--- gnu/java/awt/peer/gtk/GdkGraphics.java	4 Oct 2005 14:05:57 -0000	1.48
+++ gnu/java/awt/peer/gtk/GdkGraphics.java	3 Nov 2005 00:18:02 -0000
@@ -129,6 +129,8 @@
   {
     initState (component);
     color = component.awtComponent.getForeground ();
+    if (color == null)
+      color = Color.BLACK;
     Dimension d = component.awtComponent.getSize ();
     clip = new Rectangle (0, 0, d.width, d.height);
   }
@@ -138,6 +140,8 @@
   {
     initStateUnlocked (component);
     color = component.awtComponent.getForeground ();
+    if (color == null)
+      color = Color.BLACK;
     Dimension d = component.awtComponent.getSize ();
     clip = new Rectangle (0, 0, d.width, d.height);
   }

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