Patch: FYI: CollationElementIterator buglet

Tom Tromey tromey@redhat.com
Thu Nov 15 19:42:00 GMT 2001


I'm checking this in.
This fixes a simple bug in CollationElementIterator.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* java/text/CollationElementIterator.java (secondaryOrder): Cast
	result to `short'.
	(tertiaryOrder): Likewise.

Index: java/text/CollationElementIterator.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/text/CollationElementIterator.java,v
retrieving revision 1.4
diff -u -r1.4 CollationElementIterator.java
--- java/text/CollationElementIterator.java 2000/03/07 19:55:27 1.4
+++ java/text/CollationElementIterator.java 2001/12/18 17:15:50
@@ -1,6 +1,6 @@
 // CollationElementIterator.java - Iterate over decomposed characters.
 
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2001  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -45,13 +45,13 @@
   public static final short secondaryOrder (int order)
   {
     // From the JDK 1.2 spec.
-    return (order >>> 8) & 255;
+    return (short) ((order >>> 8) & 255);
   }
 
   public static final short tertiaryOrder (int order)
   {
     // From the JDK 1.2 spec.
-    return order & 255;
+    return (short) (order & 255);
   }
 
   // Non-public constructor.



More information about the Java-patches mailing list