[Kaffe] bugs found and fixed in Character.java

Moses DeJong dejong at cs.umn.edu
Tue Jan 26 19:56:04 PST 1999


On Tue, 26 Jan 1999, Archie Cobbs wrote:

> Moses DeJong writes:
> > There were a number of bugs in the java.lang.Character class.
> > Here is a patch that fixes most of them (Unicode still does
> > not work but at least chars lower than 160 work with my patch).
> > 
> >  [ ... ]
> > 
> > If you want proof that these are the right changes you may want to
> > run this example class. Try running it under the JDK and save the
> > results to jout then run it under kaffe and save the results to
> > kout. At that point do a "diff -c jout kout" to see that there
> > an no differences after my patch has been applied. If you do this
> > same test without my patch you will see a TON of differences (bugs).
> > 
> > public class CharTest3 {
> >     public static void main(String[] argv) {
> > 	char c;
> > 	int i;
> > 	for (i = 0; i < 160 ; i++) {
> > 	    c = (char) i;
> > 	    test(c);
> > 	}
> >     }
> > 
> >     public static void test(char c) {
> > 	if (Character.isLetterOrDigit(c)) {
> > 	System.out.println("testing charcter '" + c + "'");
> > 	}
> > 
> > 	System.out.println("unicode value is " + ((int) c) );	
> > 
> > 	System.out.println("isDigit() is " +
> > 			   Character.isDigit(c));   
> > 	System.out.println("isLetter() is " +
> > 			   Character.isLetter(c));
> > 	System.out.println("isLetterOrDigit() is " +
> > 			   Character.isLetterOrDigit(c));
> > 
> > 	System.out.println("isSpaceChar() is " +
> > 			   Character.isSpaceChar(c));
> > 	System.out.println("isWhitespace() is " +
> > 			   Character.isWhitespace(c));
> > 
> > 	System.out.println("isJavaIdentifierStart() is " +
> > 			   Character.isJavaIdentifierStart(c));
> > 
> > 
> > 	System.out.println("isJavaIdentifierPart() is " +
> > 			   Character.isJavaIdentifierPart(c));
> > 	System.out.println("isJavaIdentifierStart() is " +
> > 			   Character.isJavaIdentifierStart(c));
> > 	System.out.println("isIdentifierIgnorable() is " +
> > 			   Character.isIdentifierIgnorable(c));
> > 	System.out.println("isUnicodeIdentifierStart() is " +
> > 			   Character.isUnicodeIdentifierStart(c));
> > 	System.out.println("isUnicodeIdentifierPart() is " +
> > 			   Character.isUnicodeIdentifierPart(c));
> > 	
> > 	System.out.println();
> >     }
> > }

I tested the current CVS tree and it works correctly. The only catch
is you have to do a "sh rebuildLib" in the libraries/javalib dir
before you can use it as the Kaffe.jar file in the CVS has the old
class file in it.
 
later
mo

> Mo-
> Can you try your test again? These should be fixed now.
> I don't have JDK handy.
> 
> Thanks,
> -Archie
> 
> ___________________________________________________________________________
> Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com
> 



More information about the kaffe mailing list