mirror of https://github.com/apache/lucene.git
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) {
|
||||
return ch;
|
||||
} else {
|
||||
assert !Character.isLowSurrogate((char) ch);
|
||||
assert !Character.isLowSurrogate((char) ch) : "unpaired low surrogate: " + Integer.toHexString(ch);
|
||||
off++;
|
||||
if (Character.isHighSurrogate((char) ch)) {
|
||||
int ch2 = input.read();
|
||||
if (ch2 >= 0) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue