You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Simon Lessard <si...@gmail.com> on 2007/08/16 16:08:34 UTC

[TRINIDAD] Why are we generating final property accessors

Hello all,

I assume it's only for performances? But isn't that a little bit too
restrictive to prevent any subclass from overriding a get to add a prefix or
suffix for example?


~ Simon

Re: [TRINIDAD] Why are we generating final property accessors

Posted by Blake Sullivan <bl...@oracle.com>.
Adam Winer wrote:
> On the components, the accessors are final because the
> renderers typically go through the bean, not the component,
> so overriding is pointless.
>   
Specifically, all of the cases where you think that making a class or 
method final could allow the compiler to generate faster code are either 
dangerous for compatibility and/or cases where HotSpot can determine 
that the optimization is possible based on the classes actually loaded 
in your application, which optimizes all of the non-final cases as well.

-- Blake Sullivan
> AFAIK, there is zero benefit to performance from setting final
> anywhere other than on an instance variable.
>
> -- Adam
>
>
> On 8/16/07, Simon Lessard <si...@gmail.com> wrote:
>   
>> Hello all,
>>
>> I assume it's only for performances? But isn't that a little bit too
>> restrictive to prevent any subclass from overriding a get to add a prefix or
>> suffix for example?
>>
>>
>> ~ Simon
>>
>>     


Re: [TRINIDAD] Why are we generating final property accessors

Posted by Adam Winer <aw...@gmail.com>.
On the components, the accessors are final because the
renderers typically go through the bean, not the component,
so overriding is pointless.

AFAIK, there is zero benefit to performance from setting final
anywhere other than on an instance variable.

-- Adam


On 8/16/07, Simon Lessard <si...@gmail.com> wrote:
> Hello all,
>
> I assume it's only for performances? But isn't that a little bit too
> restrictive to prevent any subclass from overriding a get to add a prefix or
> suffix for example?
>
>
> ~ Simon
>