lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: svn commit: r156600 - in lucene/java/trunk/src: java/org/apache/lucene/queryParser/precedence/PrecedenceQueryParser.java java/org/apache/lucene/queryParser/precedence/PrecedenceQueryParser.jj test/org/apache/lucene/queryParser/precedence/TestPrecedenceQueryParser.java
Date Wed, 09 Mar 2005 17:58:44 GMT

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


Mime
View raw message