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/12/31 03:59:07 UTC

[GitHub] [lucene] mocobeta edited a comment on pull request #567: LUCENE-10335: Deprecate broken helper methods not compatible with module system; add ModuleResourceLoader and add integration test

mocobeta edited a comment on pull request #567:
URL: https://github.com/apache/lucene/pull/567#issuecomment-1003258524


   > There are some remaining issues with code doing: Class.getClassLoader().getResource.... This code does not even work from inside the same module and always returns null. In most cases this is just a bug: From what I see it only affects BinaryDictionary in Kuromoji and Nori. As said before this should be refactored to not have this crazy File vs. Resource options from former times not applicable to Lucene anymore.
   
   There are two problems and I think we can handle them separately.
   
   As for the first one, "Class.getClassLoader().getResource....", all resources (dictionary data) contained in kuromoji and nori are placed in "org/apache/lucene/analysis/[ja|ko]/dict/", so they can be loaded by `org.apache.lucene.analysis.[ja|ko].dict.BinaryDictionary#getResourceAsStream()` by tweaking the paths a bit.
   A quick fix is here and it passes tests. I can make a PR or directly commit it into this branch, if you are okay with that.
   https://github.com/mocobeta/lucene/commit/5432b09c980f029d03c6271b3ab7f50d0a9842e7
   
   As for the second one, "File vs. Resource options", resolving this is not much trivial to me. I think another issue is needed for it.


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