+2007-05-02 Tom Tromey <tromey@redhat.com>
+
+ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=238755
+ * java/lang/natCharacter.cc (Character::getType): Handle negative
+ code points.
+ (Character::toLowerCase): Likewise.
+ (Character::toUpperCase): Likewise.
+ (Character::digit): Likewise.
+ (Character::getNumericValue): Likewise.
+ (Character::getDirectionality): Likewise.
+ (Character::toTitleCase): Likewise.
+
2007-04-30 Keith Seitz <keiths@redhat.com>
* interpret-run.cc (NEXT_INSN)[DEBUG]: Advance PC before
/* java.lang.Character -- Wrapper class for char, and Unicode subsets
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2007 Free Software Foundation, Inc.
This file is part of GNU Classpath.
java::lang::Character::getType(jint codePoint)
{
jint plane = codePoint >> 16;
- if (plane > 2 && plane != 14)
+ if (plane < 0 || (plane > 2 && plane != 14))
{
if (plane > 14 && ((codePoint & 0xffff) < 0xfffe))
return (jint) PRIVATE_TYPE;
java::lang::Character::toLowerCase(jint codePoint)
{
jint plane = codePoint >> 16;
- if (plane > 2 && plane != 14)
+ if (plane < 0 || (plane > 2 && plane != 14))
return codePoint;
return (lower[plane][readCodePoint(codePoint) >> 7]) + codePoint;
}
java::lang::Character::toUpperCase(jint codePoint)
{
jint plane = codePoint >> 16;
- if (plane > 2 && plane != 14)
+ if (plane < 0 || (plane > 2 && plane != 14))
return codePoint;
return (upper[plane][readCodePoint(codePoint) >> 7]) + codePoint;
}
{
// As of Unicode 4.0.0 no characters outside of plane 0 have titlecase
// mappings that are different from their uppercase mapping.
- if (codePoint < 0x10000)
+ if (codePoint >= 0 && codePoint < 0x10000)
return toTitleCase((jchar)codePoint);
return toUpperCase(codePoint);
}
return (jint) -1;
jint plane = codePoint >> 16;
- if (plane > 2 && plane != 14)
+ if (plane < 0 || (plane > 2 && plane != 14))
return UNASSIGNED_DIGIT;
jchar attr = readCodePoint(codePoint);
java::lang::Character::getNumericValue(jint codePoint)
{
jint plane = codePoint >> 16;
- if (plane > 2 && plane != 14)
+ if (plane < 0 || (plane > 2 && plane != 14))
return UNASSIGNED_NUMERIC_VALUE;
jshort num = numValue[plane][readCodePoint(codePoint) >> 7];
if (num <= -3)
java::lang::Character::getDirectionality(jint codePoint)
{
jint plane = codePoint >> 16;
- if (plane > 2 && plane != 14)
+ if (plane < 0 || (plane > 2 && plane != 14))
{
if (plane > 14 && ((codePoint & 0xffff) < 0xfffe))
return (jint) PRIVATE_DIRECTION;
}
return direction[plane][readCodePoint(codePoint) >> 7];
}
-
-