lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: FSDirectory.makeLock() declared final
Date Mon, 30 Aug 2004 16:22:20 GMT
Mike Hearn wrote:
> I can't see any obvious reason for this. The usual motivation given is 
> speed, but this article:
> 
> http://www-106.ibm.com/developerworks/java/library/j-jtp1029.html
> 
> ... strongly implies that it doesn't make much difference at all, and 
> the opinion of the writer is certainly that the losses outweigh the gains.

Back in 1998, when FSDirectory was first written, 'final' did actually 
make some things faster.  It permitted 'javac' to inline more things. 
It also held the promise that future compilers might do more with it. 
Well, now here we are in the future, and all we have are a bunch of 
final declarations!

Note too that a few of Lucene's final declarations are there because 
classes and/or methods really should not be overridden.  I don't think 
FSDirectory falls into this category.  So I support making FSDirectory 
and its methods non-final.

Doug

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


Mime
View raw message