dsmiley commented on code in PR #1302:
URL: https://github.com/apache/solr/pull/1302#discussion_r1080763089


##########
solr/core/src/java/org/apache/solr/core/SolrConfig.java:
##########
@@ -393,14 +393,22 @@ private SolrConfig(
   }
 
   private IndexSchemaFactory.VersionedConfig readXml(SolrResourceLoader 
loader, String name) {
+    InputStream in = null;
     try {
-      ResourceProvider rp = new ResourceProvider(loader, name);
+      in = loader.openResource(name);
+      ResourceProvider rp = new ResourceProvider(in);
       XmlConfigFile xml = new XmlConfigFile(loader, rp, name, null, 
"/config/", null);
       return new IndexSchemaFactory.VersionedConfig(
           rp.zkVersion,
           new DataConfigNode(new 
DOMConfigNode(xml.getDocument().getDocumentElement())));

Review Comment:
   I checked and I think this is wrong.  It's a getter to a final field 
populated by methods that call a chain of methods terminating in 
DocumentBuilder.parse() that doesn't return null.



##########
solr/core/src/java/org/apache/solr/core/SolrConfig.java:
##########
@@ -393,14 +393,22 @@ private SolrConfig(
   }
 
   private IndexSchemaFactory.VersionedConfig readXml(SolrResourceLoader 
loader, String name) {
+    InputStream in = null;
     try {
-      ResourceProvider rp = new ResourceProvider(loader, name);
+      in = loader.openResource(name);

Review Comment:
   Not sure if we *need* that.  I was able to apply your change here to 9.1 in 
my reproducing setup.  Your change, as well as a tweak to use the simpler 
try-with-resources both yielded working test runs.



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

Reply via email to