danmuzi commented on a change in pull request #285:
URL: https://github.com/apache/lucene/pull/285#discussion_r718565282
##########
File path:
lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanTokenizer.java
##########
@@ -592,6 +594,29 @@ public void testCombining() throws IOException {
new POS.Tag[] {POS.Tag.SL});
}
+ public void testEmptyBacktrace() throws IOException {
+ String text = "";
+
+ // since the max backtrace gap ({@link KoreanTokenizer#MAX_BACKTRACE_GAP
+ // is set to 1024, we want the first 1023 characters to generate multiple
paths
+ // so that the regular backtrace is not executed.
+ for (int i = 0; i < 1023; i++) {
+ text += "끙";
+ }
Review comment:
It's not important, but we can use String#repeat which is new in Java 11.
```java
// since the max backtrace gap ({@link KoreanTokenizer#MAX_BACKTRACE_GAP
// is set to 1024, we want the first 1023 characters to generate multiple
paths
// so that the regular backtrace is not executed.
String text = "끙".repeat(1023);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]