[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lucene-dev
Subject:    Re: svn commit: r156600 - in lucene/java/trunk/src: java/org/apache/lucene/queryParser/precedence/Pr
From:       Erik Hatcher <erik () ehatchersolutions ! com>
Date:       2005-03-09 17:58:44
Message-ID: 6b064b850da4b49f94bb1f9706c90ddd () ehatchersolutions ! com
[Download RAW message or body]


On Mar 9, 2005, at 9:37 AM, Daniel Naber wrote:

> On Wednesday 09 March 2005 10:52, Erik Hatcher wrote:
>
>> It's a nuisance to have that static method when making a subclass of
>> QueryParser - since static methods are not overridable it would be 
>> easy
>> to mistakenly call the parent static parse method which would
>> instantiate QueryParser rather than QueryParserSubclass.
>
> Sorry, I still don't understand: I just implemented MyQueryParser which
> extends QueryParser as a test that has a method static public Query
> parse(String expression, String field, Analyzer analyzer). When I call
> MyQueryParser.parse(...), my method is called, as I would have 
> expected.

Sorry for the confusion - yes, you're absolutely right.  static methods 
don't get overridden but they "hide" the superclass method.

I still feel that static methods are more trouble than they are worth 
for a query parser, but it's not a huge deal.

	Erik


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic