empty collectioons should use Collections.emptyXXX()

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@807103 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2009-08-24 06:57:16 +00:00
parent c13a6f0208
commit 8b9071efb3
1 changed files with 6 additions and 2 deletions

View File

@ -241,7 +241,9 @@ public class SolrConfig extends Config {
}
}
return Collections.unmodifiableMap(chains);
return chains.isEmpty() ?
Collections.<String, List<PluginInfo>>emptyMap():
Collections.unmodifiableMap(chains);
}
private PluginInfo loadSinglePlugin(String tag){
NodeList nodes = (NodeList) evaluate(tag, XPathConstants.NODESET);
@ -257,7 +259,9 @@ public class SolrConfig extends Config {
for (int i=0; i<nodes.getLength(); i++) {
result.add(new PluginInfo(nodes.item(i) ,"[solrconfig.xml] "+tag,requireName));
}
return Collections.unmodifiableList(result) ;
return result.isEmpty() ?
Collections.<PluginInfo>emptyList() :
Collections.unmodifiableList(result) ;
}
/* The set of materialized parameters: */