diff options
author | Aaron M. Renn <arenn@urbanophile.com> | 1999-03-31 01:51:56 +0000 |
---|---|---|
committer | Aaron M. Renn <arenn@urbanophile.com> | 1999-03-31 01:51:56 +0000 |
commit | 4db808a2a6196db3500af6f48c6818fc20ce66db (patch) | |
tree | cce00d9d0a6694a5424957b0f5c64bfef69e85c2 | |
parent | d282982c975a5f6938ad4b2a78c5c7ed4895c0b8 (diff) | |
download | classpath-4db808a2a6196db3500af6f48c6818fc20ce66db.tar.gz |
Fix in getRunLength to detect when attribute is not set on a character.
I still don't know what this interface method is supposed to do, but at
least it now does better what I think it is supposed to do!
-rw-r--r-- | java/text/AttributedStringIterator.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/java/text/AttributedStringIterator.java b/java/text/AttributedStringIterator.java index 22111c714..9e74f42aa 100644 --- a/java/text/AttributedStringIterator.java +++ b/java/text/AttributedStringIterator.java @@ -209,12 +209,16 @@ getRunLimit(Set attribute_set) Map attribute_map = getAttributes(); + boolean found = false; Iterator iter = attribute_set.iterator(); - while(iter.hasNext()) + while(iter.hasNext()) if (!attribute_map.containsKey(iter.next())) - break; + { + found = true; + break; + } - if (iter.hasNext()) + if (found) break; } while (ci.next() != CharacterIterator.DONE); @@ -225,8 +229,8 @@ getRunLimit(Set attribute_set) if (run_limit == orig_index) return(-1); // No characters match the given attributes - else if (!hit_end) - --run_limit; +// else if (!hit_end) +// --run_limit; return(run_limit); } |