mirror of
https://github.com/apache/lucene.git
synced 2025-02-06 18:18:38 +00:00
improve the assert to make this easier to debug
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1358748 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e61e9134a8
commit
256214c4b5
@ -143,13 +143,13 @@ public class MockTokenizer extends Tokenizer {
|
|||||||
if (ch < 0) {
|
if (ch < 0) {
|
||||||
return ch;
|
return ch;
|
||||||
} else {
|
} else {
|
||||||
assert !Character.isLowSurrogate((char) ch);
|
assert !Character.isLowSurrogate((char) ch) : "unpaired low surrogate: " + Integer.toHexString(ch);
|
||||||
off++;
|
off++;
|
||||||
if (Character.isHighSurrogate((char) ch)) {
|
if (Character.isHighSurrogate((char) ch)) {
|
||||||
int ch2 = input.read();
|
int ch2 = input.read();
|
||||||
if (ch2 >= 0) {
|
if (ch2 >= 0) {
|
||||||
off++;
|
off++;
|
||||||
assert Character.isLowSurrogate((char) ch2);
|
assert Character.isLowSurrogate((char) ch2) : "unpaired high surrogate: " + Integer.toHexString(ch) + ", followed by: " + Integer.toHexString(ch2);
|
||||||
return Character.toCodePoint((char) ch, (char) ch2);
|
return Character.toCodePoint((char) ch, (char) ch2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user