This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Java finality
- From: Chris Burdess <dog at bluezoo dot org>
- To: java at gcc dot gnu dot org
- Date: Mon, 7 Feb 2005 11:48:04 +0000
- Subject: Java finality
This article
http://www.javaspecialists.co.za/archive/Issue096.html
explains how final fields can be modified, and that this behaviour is
sanctioned by JSR 133. However, I find it rather disturbing. I can see
the value of being able to subvert programmer-defined accessibility via
the setAccessible method for e.g. IDE vendors and orthogonal
persistence mechanisms, but I can't see any value in being able to
subvert final fields, especially in ways which are not consistent.
The results for gcj (recent CVS HEAD) on the same corpus show that even
the one change not permitted (albeit silently) by Sun's implementation
is effected without IllegalAccessException. The output of
FinalFieldChange is:
Ng Keng Yap, 27 of IQ=150 from Malaysia
What are other people's thoughts on this matter?
--
Chris Burdess