uschindler commented on code in PR #962:
URL: https://github.com/apache/solr/pull/962#discussion_r957613604
##########
solr/core/src/java/org/apache/solr/core/SolrConfig.java:
##########
@@ -413,7 +413,7 @@ private void readXml(
Map<String, IndexSchemaFactory.VersionedConfig> configCache,
ResourceProvider rp)
throws IOException {
- XmlConfigFile xml = new XmlConfigFile(loader, rp, name, null, "/config/",
null);
+ XmlConfigFile xml = new XmlConfigFile(loader, name, "/config/", null);
Review Comment:
What's going on with ResourceProvider `rp`?
##########
solr/core/src/java/org/apache/solr/schema/IndexSchemaFactory.java:
##########
@@ -155,7 +155,7 @@ public static ConfigNode getParsedSchema(InputStream is,
SolrResourceLoader load
XmlConfigFile schemaConf = null;
InputSource inputSource = new InputSource(is);
inputSource.setSystemId(SystemIdResolver.createSystemIdFromResourceName(name));
- schemaConf = new XmlConfigFile(loader, SCHEMA, inputSource, "/" + SCHEMA +
"/", null);
+ schemaConf = new XmlConfigFile(loader, SCHEMA, "/" + SCHEMA + "/", null);
Review Comment:
`inputSource` seems unused now.
##########
solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java:
##########
@@ -230,12 +228,8 @@ public static NodeConfig fromInputStream(
substituteProps = new Properties();
}
try {
- byte[] buf = IOUtils.toByteArray(is);
- try (ByteArrayInputStream dup = new ByteArrayInputStream(buf)) {
- XmlConfigFile config =
- new XmlConfigFile(loader, null, new InputSource(dup), null,
substituteProps);
- return fromConfig(solrHome, config, fromZookeeper);
- }
+ XmlConfigFile config = new XmlConfigFile(loader, null, null,
substituteProps);
Review Comment:
how is the InputStream `is` used here? Maybe we can remove the whole method
`fromInputStream()`?
` new XmlConfigFile(loader, null, null, substituteProps);` will throw NPE at
some point because there is no name and InputStream is gone. So I think this
method is never used anymore and is just a relic.
Did you look at Emma / coverage output?
--
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]