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:
Robert Muir 2012-07-08 14:41:58 +00:00
parent e61e9134a8
commit 256214c4b5
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}
}