Finding the declaring class of a _Jv_Field

Jeff Sturm jeff.sturm@appnet.com
Tue Oct 31 13:07:00 GMT 2000


Mark Wielaard wrote:
> What do people think? (I ask because I cannot believe that almost all
> current JVMs get this wrong. And I thought it was kind of cool that
> final in the VM actually meant local modifiable but pulic readable.)

Final should mean "write once". I'm as fuzzy on the meaning of the spec as
anyone else, but IMO final initializations outside of <init> (for instance
variables) or <clinit> (for static variables) ought to be disallowed, for the
simple reason that a lot of code exists that assumes access to final fields need
not be synchronized.
This would be easy to check in a bytecode verifier, and I'm a little surprised
that most VM's don't check for repeated final initializations. I'm willing to
bet there's a way to circumvent the security manager through reassignment of a
final field, somehow.
--
Jeff Sturm
jeff.sturm@commerceone.com


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /