private void errorOnLeftOvers(String section,NamedList<Object> leftovers){
  if (null == leftovers || 0 == leftovers.size())   return;
  List<String> unknownElements=new ArrayList<String>(leftovers.size());
  for (  Map.Entry<String,Object> unknownElement : leftovers) {
    log.error("Unknown config parameter in {} section of solr.xml: {} -> {}",section,unknownElement.getKey(),unknownElement.getValue());
    unknownElements.add(unknownElement.getKey());
  }
  if (!unknownElements.isEmpty()) {
    throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,String.format(Locale.ROOT,"%s section of solr.xml contains %d unknown config parameter(s): %s",section,unknownElements.size(),unknownElements));
  }
}

private void errorOnLeftOvers ( String section , NamedList < Object > leftovers ) { if ( null == leftovers || 0 == leftovers . size ( ) ) return ; List < String > unknownElements = new ArrayList < String > ( leftovers . size ( ) ) ; for ( Map . Entry < String , Object > unknownElement : leftovers ) { log . error ( "Unknown config parameter in {} section of solr.xml: {} -> {}" , section , unknownElement . getKey ( ) , unknownElement . getValue ( ) ) ; unknownElements . add ( unknownElement . getKey ( ) ) ; } if ( ! unknownElements . isEmpty ( ) ) { throw new SolrException ( SolrException . ErrorCode . SERVER_ERROR , String . format ( Locale . ROOT , "%s section of solr.xml contains %d unknown config parameter(s): %s" , section , unknownElements . size ( ) , unknownElements ) ) ; } }
logs each item in leftovers and then throws an exception with a summary
