Send As SMS

Wednesday, March 29, 2006

Java privates, aren't

I've just discovered something that's been lurking in Sun's Java implementation for many years: runtime checking of access specifiers is turned off for applications (i.e. not applets). According to the Closed, will not be fixed bug 4030988, this was done because:
Some day the offending sort of 1.0 code (non-applets which were compiled -O) will be rare in the field, and we can make "java -verify" the default, with "java -noverify" a compatibility option.
I don't know exactly when 1.1 was released (this code name history suggets that it was more than eight years ago) and I don't recall that the compiler had any way of determining/specifying whether code that you were compiling was going to end up in an applet or not (and setting aside entirely that the -verify option is undocumented), but it seems to me that this "explanation" is more an excuse for a bad decision that someone with some clout didn't feel like revisiting: we don't need no stinking type safety!