[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/24017] New: WordBreakIterator incorrect behaviour
From: |
abalkiss at redhat dot com |
Subject: |
[Bug classpath/24017] New: WordBreakIterator incorrect behaviour |
Date: |
22 Sep 2005 17:20:00 -0000 |
The call to following(int) is not properly saving state, so future calls to
next() give incorrect results. Run the two test cases below.
The two test cases show that wb.following(6) saves some internal state in the
BreakIterator that affects that call to wb.next(). Note:
BreakIterator.getWordInstance() gives us gnu.java.text.WordBreakIterator
***TESTCASE1***
Expected output: "current: 10"
Actual output: "current: 5"
import java.text.BreakIterator;
public class Test
{
public static void main(String[] a)
{
BreakIterator wb = BreakIterator.getWordInstance();
wb.setText("hello how are you this is a long line of text");
wb.following(6);
int current = wb.next();
System.out.println ("current: "+current);
}
}
***TESTCASE2***
Expected output: "current: 5"
Actual output: "current: 5"
import java.text.BreakIterator;
public class Test
{
public static void main(String[] a)
{
BreakIterator wb = BreakIterator.getWordInstance();
wb.setText("hello how are you this is a long line of text");
int current = wb.next();
System.out.println ("current: "+current);
}
}
--
Summary: WordBreakIterator incorrect behaviour
Product: classpath
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: classpath
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: abalkiss at redhat dot com
CC: bug-classpath at gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24017
- [Bug classpath/24017] New: WordBreakIterator incorrect behaviour,
abalkiss at redhat dot com <=