dev@fi.java.net

Re: Final methods

From: Alan Hudson <giles_at_yumetech.com>
Date: Mon, 28 Feb 2005 10:00:21 -0800

Paul Sandoz wrote:

> Alan Hudson wrote:
>
>> I notice that all the methods on AttributesHolder.java are final. Is
>> there a reason to restrict usage in this way? I don't need to
>> override them currently but I'm not sure why they are all final.
>>
>
> Final methods are just more efficient. This class is currently meant
> for internal use. I have been thinking that we might need to move to
> the public API area so that algorithm data can be added. Then the
> methods do not necessarily need to be final.
>
Have you verified this recently. It used to be the case definately.
But I think recent JVM's inline methods when its smart to do it. At
least Sun's hotspot seems todo. I just hate seeing so many final
methods which later may bite us.