[ https://issues.apache.org/jira/browse/LUCENE-10335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17464182#comment-17464182 ]
Uwe Schindler commented on LUCENE-10335: ---------------------------------------- I can look into this tomorrow. >From what I see the method in IOUtils is not needed if you use try with >resources (and you know it can handle null). In this case you can easily fix >it at the places where Lucene uses it. In general we should review all static utility methods in various classes that take Class instances. Because most methods there are caller sensitive or were made as such since java 9 in a backwards incompatible way (and the getResourceAsStream case was a hard one in my IMAP mail log in early days of Jigsaw - it was changed several times), we have to go away from utility methods for Class and reflection in Lucene. Nowadays those early utilities like commons-beanutils or commons-reflection are a no-go. BTW, reflection utility methods are nowadays much easier to design when you make them take a lookup instance and prefer MethodHandles. > 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 > Priority: Major > > 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.1#820001) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org