classpath-patches
[Top][All Lists]
Advanced

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

[cp-patches] FYI: Use BLACK when foreground color is null


From: Mark Wielaard
Subject: [cp-patches] FYI: Use BLACK when foreground color is null
Date: Thu, 03 Nov 2005 01:21:09 +0100

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  <address@hidden>

   * 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


reply via email to

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