You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/09/29 14:24:50 UTC

[GitHub] [lucene] danmuzi commented on a change in pull request #285: LUCENE-10086: Fix an AssertionError when KoreanTokenizer tries to backtrace from and to the same position

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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org