ICU-13617 Stop consuming AttributedCharacterIterator instances twice.

X-SVN-Rev: 41405
This commit is contained in:
Fredrik Roubert 2018-05-17 18:53:16 +00:00
parent 54a48fffc3
commit 9006190a53

View File

@ -11,7 +11,6 @@ package com.ibm.icu.dev.test.bidi;
import java.awt.font.NumericShaper;
import java.awt.font.TextAttribute;
import java.text.AttributedCharacterIterator;
import java.text.AttributedString;
import org.junit.Test;
@ -207,9 +206,8 @@ public class TestCompatibility extends BidiFmwk {
as.addAttribute(TextAttribute.BIDI_EMBEDDING, new Integer(1), 0, 26);
as.addAttribute(TextAttribute.BIDI_EMBEDDING, new Integer(-1), 0, 6);
as.addAttribute(TextAttribute.BIDI_EMBEDDING, new Integer(-1), 19, 26);
AttributedCharacterIterator aci = as.getIterator();
bidi = new Bidi(aci);
jbidi = new java.text.Bidi(aci);
bidi = new Bidi(as.getIterator());
jbidi = new java.text.Bidi(as.getIterator());
compareBidi(bidi, jbidi);
String out = bidi.writeReordered(0);
logln("Output #1 of Bidi(AttributedCharacterIterator): " + out);
@ -217,17 +215,15 @@ public class TestCompatibility extends BidiFmwk {
as = new AttributedString("HEBREW 123 english MOREHEB");
as.addAttribute(TextAttribute.RUN_DIRECTION, TextAttribute.RUN_DIRECTION_RTL);
as.addAttribute(TextAttribute.BIDI_EMBEDDING, new Integer(0), 0, 26);
aci = as.getIterator();
bidi = new Bidi(aci);
jbidi = new java.text.Bidi(aci);
bidi = new Bidi(as.getIterator());
jbidi = new java.text.Bidi(as.getIterator());
compareBidi(bidi, jbidi);
out = bidi.writeReordered(0);
logln("Output #2 of Bidi(AttributedCharacterIterator): " + out);
as = new AttributedString("HEBREW 123 english MOREHEB");
aci = as.getIterator();
bidi = new Bidi(aci);
jbidi = new java.text.Bidi(aci);
bidi = new Bidi(as.getIterator());
jbidi = new java.text.Bidi(as.getIterator());
compareBidi(bidi, jbidi);
out = bidi.writeReordered(0);
logln("Output #3 of Bidi(AttributedCharacterIterator): " + out);