SOLR-215 -- make sure that BaseTokenFilterFactory/BaseTokenizerFactory call the @Deprecated init() method

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@584316 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan McKinley 2007-10-12 23:14:07 +00:00
parent d36587fac6
commit f1c3211c3d
3 changed files with 8 additions and 5 deletions

View File

@ -34,10 +34,9 @@ public abstract class BaseTokenFilterFactory implements TokenFilterFactory, Solr
/** The init args */ /** The init args */
protected Map<String,String> args; protected Map<String,String> args;
@Deprecated @Deprecated
public void init(Map<String,String> args) { public void init(Map<String,String> args) {
log.warning("calling the deprecated form of init; should be calling init(SolrConfig solrConfig, Map<String,String> args)");
this.args=args; this.args=args;
} }
@ -45,6 +44,7 @@ public abstract class BaseTokenFilterFactory implements TokenFilterFactory, Solr
* @since solr 1.3 * @since solr 1.3
*/ */
public void init(SolrConfig solrConfig, Map<String,String> args) { public void init(SolrConfig solrConfig, Map<String,String> args) {
this.init( args ); // maintain backwards compatibility
this.args=args; this.args=args;
} }

View File

@ -35,11 +35,12 @@ public abstract class BaseTokenizerFactory implements TokenizerFactory, SolrConf
@Deprecated @Deprecated
public void init(Map<String,String> args) { public void init(Map<String,String> args) {
log.warning("calling the deprecated form of init; should be calling init(SolrConfig solrConfig, Map<String,String> args)"); //log.warning("calling the deprecated form of init; should be calling init(SolrConfig solrConfig, Map<String,String> args)");
this.args=args; this.args=args;
} }
public void init(SolrConfig solrConfig, Map<String,String> args) { public void init(SolrConfig solrConfig, Map<String,String> args) {
this.init( args );
this.args=args; this.args=args;
} }

View File

@ -632,7 +632,8 @@ public final class IndexSchema {
if (tfac instanceof SolrConfig.Initializable) if (tfac instanceof SolrConfig.Initializable)
((SolrConfig.Initializable)tfac).init(solrConfig, DOMUtil.toMapExcept(attrs,"class")); ((SolrConfig.Initializable)tfac).init(solrConfig, DOMUtil.toMapExcept(attrs,"class"));
else else
tfac.init(DOMUtil.toMapExcept(attrs,"class")); tfac.init(DOMUtil.toMapExcept(attrs,"class"));
return tfac; return tfac;
} }
@ -645,7 +646,8 @@ public final class IndexSchema {
if (tfac instanceof SolrConfig.Initializable) if (tfac instanceof SolrConfig.Initializable)
((SolrConfig.Initializable)tfac).init(solrConfig, DOMUtil.toMapExcept(attrs,"class")); ((SolrConfig.Initializable)tfac).init(solrConfig, DOMUtil.toMapExcept(attrs,"class"));
else else
tfac.init(DOMUtil.toMapExcept(attrs,"class")); tfac.init(DOMUtil.toMapExcept(attrs,"class"));
return tfac; return tfac;
} }