[Kaffe] bugs found and fixed in Character.java

Archie Cobbs archie at whistle.com
Tue Jan 26 19:49:53 PST 1999


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();
>     }
> }

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