aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu/java/text/BaseBreakIterator.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2004-10-25 16:56:00 +0000
committerTom Tromey <tromey@gcc.gnu.org>2004-10-25 16:56:00 +0000
commit6fc058da980d2f4bbb0036936eef7b11df743565 (patch)
treea98c39bf5aded670d2cead5a42435254efc9d25a /libjava/gnu/java/text/BaseBreakIterator.java
parent5cfffc4e1671d6842360b3d5ff53ee5b1d8c2f8c (diff)
downloadgcc-6fc058da980d2f4bbb0036936eef7b11df743565.zip
gcc-6fc058da980d2f4bbb0036936eef7b11df743565.tar.gz
gcc-6fc058da980d2f4bbb0036936eef7b11df743565.tar.bz2
WordBreakIterator.java (WordBreakIterator): Don't initialize `iter'.
* gnu/java/text/WordBreakIterator.java (WordBreakIterator): Don't initialize `iter'. * gnu/java/text/SentenceBreakIterator.java (SentenceBreakIterator): Don't initialize `iter'. * gnu/java/text/LineBreakIterator.java (LineBreakIterator): Don't initialize `iter'. * gnu/java/text/CharacterBreakIterator.java (CharacterBreakIterator): Don't initialize `iter'. * gnu/java/text/BaseBreakIterator.java (BaseBreakIterator): New constructor. * java/text/BreakIterator.java: Updated documentation. From-SVN: r89539
Diffstat (limited to 'libjava/gnu/java/text/BaseBreakIterator.java')
-rw-r--r--libjava/gnu/java/text/BaseBreakIterator.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/libjava/gnu/java/text/BaseBreakIterator.java b/libjava/gnu/java/text/BaseBreakIterator.java
index 5bb6f6e..40a698f 100644
--- a/libjava/gnu/java/text/BaseBreakIterator.java
+++ b/libjava/gnu/java/text/BaseBreakIterator.java
@@ -1,5 +1,5 @@
/* BaseBreakIterator.java -- Base class for default BreakIterators
- Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,6 +40,7 @@ package gnu.java.text;
import java.text.BreakIterator;
import java.text.CharacterIterator;
+import java.text.StringCharacterIterator;
/**
* @author Tom Tromey <tromey@cygnus.com>
@@ -48,6 +49,14 @@ import java.text.CharacterIterator;
public abstract class BaseBreakIterator extends BreakIterator
{
+ public BaseBreakIterator ()
+ {
+ // It isn't documented, but break iterators are created in a
+ // working state; their methods won't throw exceptions before
+ // setText().
+ iter = new StringCharacterIterator("");
+ }
+
public int current ()
{
return iter.getIndex();