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 2022/05/06 07:16:31 UTC

[GitHub] [lucene] mocobeta commented on a diff in pull request #868: LUCENE-10558: Implement URL ctor to support classpath/module usage in Kuromoji and Nori dictionaries

mocobeta commented on code in PR #868:
URL: https://github.com/apache/lucene/pull/868#discussion_r866551533


##########
lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/dict/BinaryDictionary.java:
##########
@@ -140,19 +140,15 @@ public static final InputStream getResource(ResourceScheme scheme, String path)
       throws IOException {
     switch (scheme) {
       case CLASSPATH:
-        return getClassResource(path);
+        return IOUtils.requireResourceNonNull(
+            BinaryDictionary.class.getClassLoader().getResourceAsStream(path), path);

Review Comment:
   Yes, this was the (half-intentional) omission in #643. Sorry and thank you!
   
   I think it's correct; I have a minor question for @msokolov: the original code replaces `.` to `/` in the path; what is the point of it? 
   https://github.com/apache/lucene/blob/8c4445e049982e0a4b5e8c846d682e4fd4a6e8c8/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/dict/ConnectionCosts.java#L46



-- 
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