[ 
https://issues.apache.org/jira/browse/LUCENE-10335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17531809#comment-17531809
 ] 

Michael Sokolov commented on LUCENE-10335:
------------------------------------------

This issue broke backwards compatibility. I think we really ought to have 
mentioned in CHANGES.txt.Specifically what happened was that previously:

    new ConnectionCosts(BinaryDictionary.ResourceScheme.CLASSPATH, path)

would load the resource from the given path, but now the path is ignored and a 
default path is substituted in its place. I think the same is true for the 
other external resource files.

I guess we can add a CHANGES entry now to warn people since anyone that loads 
these resources from the classpath will have trouble when upgrading, since 
their dictionaries will be silently overridden with Lucene's built-in ones, 
causing subtle (or not so subtle) changes in tokenization. I can add an entry 
there, but first I'm trying to understand what options we have.

I the classpath mechanism we used before is no longer feasible because of Java 
module system rules, how can we load our resources that are shipped in jars?  
Maybe we could provide a constructor accepting InputStreams so the caller can 
open up the classpath resources?

> IOUtils.getDecodingReader(Class<?>, String) is broken with modules
> ------------------------------------------------------------------
>
>                 Key: LUCENE-10335
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10335
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Dawid Weiss
>            Assignee: Uwe Schindler
>            Priority: Major
>             Fix For: 9.1, 10.0 (main)
>
>         Attachments: LUCENE-10335-1.patch, LUCENE-10335.patch, Screenshot 
> from 2021-12-25 18-04-55.png
>
>          Time Spent: 18h 40m
>  Remaining Estimate: 0h
>
> This method calls clazz.getResourceAsStream() but in a modular application 
> the method won't see any of the resources in clazz's module, causing an NPE. 
> We should deprecate or even remove this method entirely, leaving only 
> getDecodingReader(InputStream) and opening the resource on the caller's side.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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

Reply via email to