lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <>
Subject [jira] Commented: (LUCENE-1269) Analysers and Filters should not be final
Date Sun, 27 Apr 2008 23:06:55 GMT


Hoss Man commented on LUCENE-1269:

the general reason why things are final is to protect the lucene devs from needing to maintain
compatibility when making perf improvements or adding functionality.

Conventional wisdom also says that Analyzers rarely need to be extended because it's generally
better for users to compose their own using the underlying TokenFilters -- FrenchAnalyzer
is a great example of that.  Anything you might do in a subclass can be done just as easily
and with about the same amount of code if you write your own Analyzer that uses the same underlying

Any class that is currently final can be made non-final, but doing so requires a careful API
review to ensure that the public and protected methods are things that we really want to be
exposed to (and over ridable by) subclasses.

(going back to the specific example of FrenchAnalyzer: i see no reason not to remove "final"
.. but i would still encourage people to write their own Analyzer instead of subclassing it)

> Analysers and Filters should not be final
> -----------------------------------------
>                 Key: LUCENE-1269
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Analysis
>    Affects Versions: 2.3.1
>            Reporter: C├ędrik LIME
>            Priority: Minor
> I am trying to extend some Lucene Analysers to further improve their behaviour. However,
some Analysers and Filters are final classes that I cannot extend (thus resorting to copying
the class, which is less than optimal).
> Any reason we would want to inhibit people from extending a class like FrenchAnalyzer?
> Could me make all Analysers and Filters in the contrib-analysis package non-final?

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message