lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SOLR-6022) Rename getAnalyzer to getIndexAnalyzer
Date Sat, 26 Apr 2014 16:16:16 GMT

    [ https://issues.apache.org/jira/browse/SOLR-6022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13982033#comment-13982033
] 

Uwe Schindler edited comment on SOLR-6022 at 4/26/14 4:14 PM:
--------------------------------------------------------------

The sophisticated backwards policeman says:

To provide backwards compatibility for those that *implement* getAnalyzer, the delegation
must be the other way round:
- In trunk, all like it is in the patch.
- In 4.x, getAnalyzer() stays as it is - no code changes, but gets deprecated. getIndexAnalyzer
is new method, but delegates in 4.x to the deprecated getAnalyzer() with a @SuppressWranings("deprecation")
on the call. By this we have two good things: both methods behave identical behavior, so people
can call both. But people who implement only the old one will still get called by Solr's code,
so they don't loose functionality. This is the general pattern to replace methods (also used
by the JDK) - it just "feels" unnatural, but is correct way to deprecate :-)

Uwe



was (Author: thetaphi):
The sophisticated backwards policeman says:

To provide backwards compatibility for those that *implement* getAnalyzer, the delegation
must be the other way round:
- In trunk, all like it is in the patch.
- In 4.x, getAnalyzer() stays as it is - no code changes, but gets deprecated. getIndexAnalyzer
is new method, but delegates in 4.x to the deprecated getAnalyzer() with a @SuppressWranings("deprecation")
on the call. By this we have two good things: both methods behave identical behavior, so people
can call both. But people who implement only the old one will still get called by Solr's code,
so they don't loose functionality. This is the general pattern to replace methods (also used
by the JDK).

Uwe


> Rename getAnalyzer to getIndexAnalyzer
> --------------------------------------
>
>                 Key: SOLR-6022
>                 URL: https://issues.apache.org/jira/browse/SOLR-6022
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Ryan Ernst
>         Attachments: SOLR-6022.patch
>
>
> We have separate index/query analyzer chains, but the access methods for the analyzers
do not match up with the names.  This can lead to unknowingly using the wrong analyzer chain
(as it did in SOLR-6017).  We should do this renaming in trunk, and deprecate the old getAnalyzer
function in 4x.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message