noblepaul commented on a change in pull request #1108: SOLR-14125 : Streaming expressions to be loadable from packages URL: https://github.com/apache/lucene-solr/pull/1108#discussion_r360733385
########## File path: solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamFactory.java ########## @@ -24,8 +24,8 @@ import java.util.HashMap; import java.util.List; import java.util.Locale; -import java.util.Map; import java.util.Map.Entry; +import java.util.function.Supplier; Review comment: In the new scheme of things you can't hold direct reference to a `class`. If a plugin can be reloaded, it's best to just hold an indirect reference. The `Supplier` makes it cleaner. For the in-built classes, the supplier is just a simple wrapper. But for the plugins loaded from packages, it listens to package changes and gives the right class on-demand. The `Class` objects of a plugin are something that needs to be garbage collected as the `ClassLoader` goes away. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org