Patch: error->warning when assigning to final field

Mark Wielaard
Sun Jan 14 13:50:00 GMT 2001


On Sun, Jan 14, 2001 at 01:46:01PM -0800, Per Bothner wrote:
> Mark Wielaard <> writes:
> > It does violate JLS 4.5.4,, 15.14.1/2, 15.15.1/2, 15.26 and
> > chapter 16 (see also the example in 6.5.6).
> I'm sorry if my message was misleading.  Of course the compiler should
> complain when compiling a .java source file to either native or .class.
> (Javac does complain about this - at least I assume it does.)
> However, this patch is for compiling .class files to source files.
> [...] 
> So quoting from the JLS is irrelevant.

Ah, I see. Sorry about my confusion. You are right when talking about
compiling from bytecode. Although I think it is strange that the JLS
explicitly forbits it but the JVM allows it. Do you know why the JVM
allows for this non-intuitive behaviour?



More information about the Java-patches mailing list