Eliminating Assembler Already Defined Messages for Java Library
Per Bothner
per@bothner.com
Tue Mar 13 17:52:00 GMT 2001
Alexandre Petit-Bianco <apbianco@cygnus.com> writes:
> I was going look at it but if you want to get rid of the code [for
> checking assignment to final fields], what can I say, go ahead. I'd
> like to see someone write something based on Per's check-init.c code
It shouldn't be too difficult: To handle "definitely unassigned" of
final variables (fields or locals) just allocate one more bit in the
bitvectors. To handle final fields just allocate two bits for them in
the bitvector at the start of a constructor. Most of the code should
work as is.
Maybe I'll have a chance to do this.
> -- I tried to reuse it but couldn't figure how to make it work in
> this particular context at the time I decided to spend some time on
> a solution.
If you can't figure out how to implement something correctly, then it
is better to ask the Java list, or leave it for later. "Correctly" in
this case means following the specification (which has admittedly
changed in the second edition); this requires using the "definitely
[un]assigned" rules. Anything else would be at best a partial
stop-gap hack. The latter may be better then nothing, I guess,
assuming it does not take too long or complain about correct programs.
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/
More information about the Java
mailing list