uschindler commented on pull request #567:
URL: https://github.com/apache/lucene/pull/567#issuecomment-1003136354
FYI, I did some tests / investigation today to work around the caller
sensitiveness:
- Use getResource() on the class file (use simple class name with
`.concat(".class")`) to get the URL of the class passed into the IOUtils method
- Then use a relative URL resolve to get the real file.
After some discussion with @dweiss and own tests, I found this is a "bad"
workaround:
- It won't work in non-module mode if classes es separate from resources
(gradle layout)
- We should not "work around" the module system (although it works)
This code is more repetition, but much more clear and is written like it
should be done with module system. The static ctor should load the resource on
its own and not pass it to a method in Lucene Core.
I only have some suggestions for future: Add more convenience methods to
WordListLoader, so you can easily load wordlists from UTF-8 enoded input
streams with default comment character (`"#"`). This would remove a few extra
parameters repeated in every Analyzer class.
--
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]