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

Uwe Schindler edited comment on SOLR-2276 at 4/11/11 6:51 AM:
--------------------------------------------------------------

Hi Marc,
to remove the unneeded cast leading to an unchecked warning, also calling 
static methods on instances is a no-go:
Replace:
{code}
clazz = (Class<? extends Encoder>) this.getClass().forName(name);
{code}
By:
{code}
clazz = Class.forName(name).asSubclass(Encoder.class);
{code}

Aditionally, maybe the reflection should try twice:
- First try by prepending the package name 
("org.apache.commons.codec.language."), as the user expects the encoder in this 
package. With your code, the user has to add the full class name.
- Use name param as "full class name".

The only problem with the reflection code is that it is case sensitive, so this 
is different from the "registry" map.

      was (Author: thetaphi):
    Hi Marc,
to remove the unneeded cast leading to an unchecked warning, also calling 
static methods on instances is a no-go:
Replace:
{code}
clazz = (Class<? extends Encoder>) this.getClass().forName(name);
{code}
By:
{code}
clazz = Class.forName(name).asSubclass(Encoder.class);
{code}
  
> Support for cologne phonetic
> ----------------------------
>
>                 Key: SOLR-2276
>                 URL: https://issues.apache.org/jira/browse/SOLR-2276
>             Project: Solr
>          Issue Type: Improvement
>          Components: Schema and Analysis
>    Affects Versions: 1.4.1
>         Environment: Apache Commons Codec 1.5
>            Reporter: Marc Pompl
>             Fix For: 4.0
>
>         Attachments: ColognePhonetic-patch-with-reflection.txt
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> As soon as Apache Commons Codec 1.5 is released, support new encoder 
> "ColognePhonetic" please.
> See JIRA for CODEC-106.
> It is fundamental for phonetic searches if you are indexing german names. 
> Other indexers are optimizied for english (words).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to