This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]