struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Al Sutton>
Subject RE: use of private final vs. protected
Date Wed, 03 Jun 2009 15:14:58 GMT
Back in the dim and distant past I remember final being used to give the JIT an optimization
hint that whatever's described as final can be inlined as it won't change (note JIT not compiler).
It's not a big saving, but in tight loops and heavily called code it can all add up.

I found which expands on it a bit.



* Written an Android App? - List it at *

Funky Android Limited is registered in England & Wales with the
company number  6741909. The registered head office is Kemp House,
152-160 City Road, London,  EC1V 2NX, UK.

The views expressed in this email are those of the author and not
necessarily those of Funky Android Limited, it's associates, or it's

-----Original Message-----
From: Wes Wannemacher [] 
Sent: 03 June 2009 16:02
To: Struts Developers List
Subject: use of private final vs. protected

I am looking at subclassing JakartaMultiPartRequest and almost all of
the members are 'private final', but they are Lists and Maps, so I am
curious what the justification is... I want to subclass and get at the
data, obviously I'd have to change the declarations to protected, but
is final necessary? From what I can see, the only thing it guarantees
is that with each instance of JakartaMultiPartRequest, the Lists or
Maps will point to new instances. I guess what I'm wondering is if
there is an intention to follow a coding standard or something that
I'm missing because I don't see much point for these members to be
private or final (especially since it makes it pretty much impossible
for me to subclass it).


Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message