[Patch][gui] BasicStroke

Michael Koch konqueror@gmx.de
Mon Feb 14 20:23:00 GMT 2005


Hi list,


I just commited hte attached patch to megre it from classpath HEAD. IT
fixes a NullPointerException in java.awt.BasicStroke.hashCode().


Michael


2005-02-14  Mark Wielaard  <mark@klomp.org>

	* java/awt/BasicStroke.java (hashCode): Check for null dash.

-------------- next part --------------
Index: java/awt/BasicStroke.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/BasicStroke.java,v
retrieving revision 1.4.4.1
diff -u -r1.4.4.1 BasicStroke.java
--- java/awt/BasicStroke.java	8 Feb 2005 05:22:17 -0000	1.4.4.1
+++ java/awt/BasicStroke.java	14 Feb 2005 16:28:10 -0000
@@ -222,9 +222,10 @@
     hash ^= cap;
     hash ^= join;
     hash ^= Float.floatToIntBits(limit);
-    
-    for (int i = 0; i < dash.length; i++)
-      hash ^=  Float.floatToIntBits(dash[i]);
+   
+    if (dash != null)
+      for (int i = 0; i < dash.length; i++)
+	hash ^=  Float.floatToIntBits(dash[i]);
 
     hash ^= Float.floatToIntBits(phase);
 


More information about the Java-patches mailing list