You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by GitBox <gi...@apache.org> on 2019/07/07 20:18:31 UTC

[GitHub] [lucene-solr] msokolov commented on a change in pull request #767: LUCENE-8904: enhance Nori DictionaryBuilder tool

msokolov commented on a change in pull request #767: LUCENE-8904: enhance Nori DictionaryBuilder tool
URL: https://github.com/apache/lucene-solr/pull/767#discussion_r300883524
 
 

 ##########
 File path: lucene/analysis/nori/src/tools/java/org/apache/lucene/analysis/ko/util/BinaryDictionaryWriter.java
 ##########
 @@ -137,14 +139,17 @@ public int put(String[] entry) {
       flags |= BinaryDictionary.HAS_READING;
     }
 
-    assert leftId < 8192; // there are still unused bits
-    assert posType.ordinal() < 4;
+    if (leftId >= ID_LIMIT) {
+      throw new IllegalArgumentException("leftId >= " + ID_LIMIT + ": " + leftId);
+    }
+    if (posType.ordinal() >= 4) {
+      throw new IllegalArgumentException("posType.ordinal() >= " + 4 + ": " + posType.ordinal());
 
 Review comment:
   Maybe also log posType itself? If this ever happens, that should help 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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