private void thereCanBeOnlyOne(String xpath,String section){
  NodeList lst=config.getNodeList(xpath,false);
  if (1 < lst.getLength())   throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,lst.getLength() + " instances of " + section+ " found in solr.xml");
}

private void thereCanBeOnlyOne ( String xpath , String section ) { NodeList lst = config . getNodeList ( xpath , false ) ; if ( 1 < lst . getLength ( ) ) throw new SolrException ( SolrException . ErrorCode . SERVER_ERROR , lst . getLength ( ) + " instances of " + section + " found in solr.xml" ) ; }
throws an error if more then one element matching the xpath
