lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r807103 - /lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java
Date Mon, 24 Aug 2009 06:57:16 GMT
Author: noble
Date: Mon Aug 24 06:57:16 2009
New Revision: 807103

URL: http://svn.apache.org/viewvc?rev=807103&view=rev
Log:
empty collectioons should use Collections.emptyXXX()

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java?rev=807103&r1=807102&r2=807103&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java Mon Aug 24 06:57:16 2009
@@ -241,7 +241,9 @@
       }
     }
 
-    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 @@
      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: */



Mime
View raw message