Skip to content

Commit 36c9607

Browse files
committed
8331591: sun.font.CharSequenceCodePointIterator is buggy and unused
Reviewed-by: angorya, honkar
1 parent b33096f commit 36c9607

File tree

1 file changed

+0
-55
lines changed

1 file changed

+0
-55
lines changed

src/java.desktop/share/classes/sun/font/CodePointIterator.java

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ public static CodePointIterator create(char[] text, int start, int limit) {
5656
return new CharArrayCodePointIterator(text, start, limit);
5757
}
5858

59-
public static CodePointIterator create(CharSequence text) {
60-
return new CharSequenceCodePointIterator(text);
61-
}
62-
6359
public static CodePointIterator create(CharacterIterator iter) {
6460
return new CharacterIteratorCodePointIterator(iter);
6561
}
@@ -129,57 +125,6 @@ public int charIndex() {
129125
}
130126
}
131127

132-
final class CharSequenceCodePointIterator extends CodePointIterator {
133-
private CharSequence text;
134-
private int index;
135-
136-
public CharSequenceCodePointIterator(CharSequence text) {
137-
this.text = text;
138-
}
139-
140-
public void setToStart() {
141-
index = 0;
142-
}
143-
144-
public void setToLimit() {
145-
index = text.length();
146-
}
147-
148-
public int next() {
149-
if (index < text.length()) {
150-
char cp1 = text.charAt(index++);
151-
if (Character.isHighSurrogate(cp1) && index < text.length()) {
152-
char cp2 = text.charAt(index+1);
153-
if (Character.isLowSurrogate(cp2)) {
154-
++index;
155-
return Character.toCodePoint(cp1, cp2);
156-
}
157-
}
158-
return cp1;
159-
}
160-
return DONE;
161-
}
162-
163-
public int prev() {
164-
if (index > 0) {
165-
char cp2 = text.charAt(--index);
166-
if (Character.isLowSurrogate(cp2) && index > 0) {
167-
char cp1 = text.charAt(index - 1);
168-
if (Character.isHighSurrogate(cp1)) {
169-
--index;
170-
return Character.toCodePoint(cp1, cp2);
171-
}
172-
}
173-
return cp2;
174-
}
175-
return DONE;
176-
}
177-
178-
public int charIndex() {
179-
return index;
180-
}
181-
}
182-
183128
// note this has different iteration semantics than CharacterIterator
184129
final class CharacterIteratorCodePointIterator extends CodePointIterator {
185130
private CharacterIterator iter;

0 commit comments

Comments
 (0)