mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 06:25:30 +00:00
ICU-929 fix charAt() bug
X-SVN-Rev: 7348
This commit is contained in:
parent
b8d527f6ac
commit
ac085286cd
2 changed files with 16 additions and 8 deletions
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/text/UnicodeSet.java,v $
|
||||
* $Date: 2001/12/03 21:33:59 $
|
||||
* $Revision: 1.53 $
|
||||
* $Date: 2001/12/13 23:00:49 $
|
||||
* $Revision: 1.54 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
|
@ -204,7 +204,7 @@ import com.ibm.util.Utility;
|
|||
* Unicode property
|
||||
* </table>
|
||||
* @author Alan Liu
|
||||
* @version $RCSfile: UnicodeSet.java,v $ $Revision: 1.53 $ $Date: 2001/12/03 21:33:59 $
|
||||
* @version $RCSfile: UnicodeSet.java,v $ $Revision: 1.54 $ $Date: 2001/12/13 23:00:49 $
|
||||
*/
|
||||
public class UnicodeSet extends UnicodeFilter {
|
||||
|
||||
|
@ -702,7 +702,11 @@ public class UnicodeSet extends UnicodeFilter {
|
|||
*/
|
||||
public int charAt(int index) {
|
||||
if (index >= 0) {
|
||||
for (int i=0; i < len;) {
|
||||
// len2 is the largest even integer <= len, that is, it is len
|
||||
// for even values and len-1 for odd values. With odd values
|
||||
// the last entry is UNICODESET_HIGH.
|
||||
int len2 = len & ~1;
|
||||
for (int i=0; i < len2;) {
|
||||
int start = list[i++];
|
||||
int count = list[i++] - start;
|
||||
if (index < count) {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UnicodeSet.java,v $
|
||||
* $Date: 2001/12/03 21:33:59 $
|
||||
* $Revision: 1.53 $
|
||||
* $Date: 2001/12/13 23:00:49 $
|
||||
* $Revision: 1.54 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
|
@ -204,7 +204,7 @@ import com.ibm.util.Utility;
|
|||
* Unicode property
|
||||
* </table>
|
||||
* @author Alan Liu
|
||||
* @version $RCSfile: UnicodeSet.java,v $ $Revision: 1.53 $ $Date: 2001/12/03 21:33:59 $
|
||||
* @version $RCSfile: UnicodeSet.java,v $ $Revision: 1.54 $ $Date: 2001/12/13 23:00:49 $
|
||||
*/
|
||||
public class UnicodeSet extends UnicodeFilter {
|
||||
|
||||
|
@ -702,7 +702,11 @@ public class UnicodeSet extends UnicodeFilter {
|
|||
*/
|
||||
public int charAt(int index) {
|
||||
if (index >= 0) {
|
||||
for (int i=0; i < len;) {
|
||||
// len2 is the largest even integer <= len, that is, it is len
|
||||
// for even values and len-1 for odd values. With odd values
|
||||
// the last entry is UNICODESET_HIGH.
|
||||
int len2 = len & ~1;
|
||||
for (int i=0; i < len2;) {
|
||||
int start = list[i++];
|
||||
int count = list[i++] - start;
|
||||
if (index < count) {
|
||||
|
|
Loading…
Add table
Reference in a new issue