AbstractPluginLoader needs to return 'null' unless there was something registred to the same location

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@600346 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan McKinley 2007-12-02 17:35:52 +00:00
parent 9d7995d57c
commit c3f80c5004
1 changed files with 3 additions and 3 deletions

View File

@ -619,12 +619,12 @@ public final class IndexSchema {
@Override @Override
protected TokenizerFactory register(String name, TokenizerFactory plugin) throws Exception { protected TokenizerFactory register(String name, TokenizerFactory plugin) throws Exception {
return plugin; // does not need to do anything return null; // used for map registration
} }
}; };
tokenizerLoader.load( solrConfig.getResourceLoader(), (NodeList)xpath.evaluate("./tokenizer", node, XPathConstants.NODESET) ); tokenizerLoader.load( solrConfig.getResourceLoader(), (NodeList)xpath.evaluate("./tokenizer", node, XPathConstants.NODESET) );
// Make sure somethign was loaded // Make sure something was loaded
if( tokenizers.isEmpty() ) { if( tokenizers.isEmpty() ) {
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,"analyzer without class or tokenizer & filter list"); throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,"analyzer without class or tokenizer & filter list");
} }
@ -646,7 +646,7 @@ public final class IndexSchema {
@Override @Override
protected TokenFilterFactory register(String name, TokenFilterFactory plugin) throws Exception { protected TokenFilterFactory register(String name, TokenFilterFactory plugin) throws Exception {
return plugin; // does not need to do anything return null; // used for map registration
} }
}; };
filterLoader.load( solrConfig.getResourceLoader(), (NodeList)xpath.evaluate("./filter", node, XPathConstants.NODESET) ); filterLoader.load( solrConfig.getResourceLoader(), (NodeList)xpath.evaluate("./filter", node, XPathConstants.NODESET) );