Return-Path: Delivered-To: apmail-lucene-commits-archive@www.apache.org Received: (qmail 32589 invoked from network); 9 Jul 2010 22:45:32 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Jul 2010 22:45:32 -0000 Received: (qmail 96373 invoked by uid 500); 9 Jul 2010 22:45:32 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 96366 invoked by uid 99); 9 Jul 2010 22:45:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jul 2010 22:45:32 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jul 2010 22:45:29 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 08F4723889CB; Fri, 9 Jul 2010 22:44:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r962714 - in /lucene/dev/trunk/solr: CHANGES.txt src/java/org/apache/solr/core/CoreContainer.java Date: Fri, 09 Jul 2010 22:44:35 -0000 To: commits@lucene.apache.org From: hossman@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100709224436.08F4723889CB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: hossman Date: Fri Jul 9 22:44:35 2010 New Revision: 962714 URL: http://svn.apache.org/viewvc?rev=962714&view=rev Log: SOLR-1981: Solr will now fail correctly if solr.xml attempts to specify multiple cores that have the same name Modified: lucene/dev/trunk/solr/CHANGES.txt lucene/dev/trunk/solr/src/java/org/apache/solr/core/CoreContainer.java Modified: lucene/dev/trunk/solr/CHANGES.txt URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=962714&r1=962713&r2=962714&view=diff ============================================================================== --- lucene/dev/trunk/solr/CHANGES.txt (original) +++ lucene/dev/trunk/solr/CHANGES.txt Fri Jul 9 22:44:35 2010 @@ -364,6 +364,8 @@ Bug Fixes values which are Collections or other classes that implement Iterable. (noble, hossman) +* SOLR-1981: Solr will now fail correctly if solr.xml attempts to + specify multiple cores that have the same name (hossman) Other Changes ---------------------- Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/core/CoreContainer.java URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/core/CoreContainer.java?rev=962714&r1=962713&r2=962714&view=diff ============================================================================== --- lucene/dev/trunk/solr/src/java/org/apache/solr/core/CoreContainer.java (original) +++ lucene/dev/trunk/solr/src/java/org/apache/solr/core/CoreContainer.java Fri Jul 9 22:44:35 2010 @@ -247,18 +247,40 @@ public class CoreContainer SolrConfig.severeErrors.add(e); SolrException.logOnce(log,null,e); } + + // before looping over each core, let's check the names and fail + // fast if the same one is reused multiple times. + { // local scope, won't need these vars again + NodeList nodes = (NodeList)cfg.evaluate("solr/cores/core/@name", + XPathConstants.NODESET); + Set names = new HashSet(); + for (int i=0; i