The 1.2 prototype has surprisingly little documentation. I started this thread to try to remedy that, in part. I'm going to start off by listing what's
I've noticed changed in 1.2, gotchas to watch out for, etc, and I hope you all will follow up below w/ all the rest of the changed things which I haven't discovered yet.
1) THE COMMAND-LINE scripts/javac TOOL NEEDS THE '-gj' OPTION.
The previous release didn't. This is a big user-noticible change if you were using the older 1.0-ea prototype in makefiles and such. Note that the 'javac --help' information lists '-gj' as the default; it is wrong. '-nogj' is the default. I hope this doesn't reflect on the status of GJ in java 1.5?
2) THE COLLECTIONS API HAS CHANGED.
This is made more interesting by the fact that this release doesn't come with
any javadoc and (as far as I know) javap still crashes when given GJ .class files. The only way to tell that the interface
has changed out from under you is the javac error message which you will
sometimes get when you try to extend a Collection class
with a now-incorrectly-typed method. (Other times, javac will just crash.)
The changes I have seen have altered the signature of addAll, putAll, and similar methods from:
class Collection<V> {
boolean addAll(Collection<V> c);
}
to
class Collection<V> {
<T extends V> boolean addAll(Collection<T> c);
}
Note that this gives you much more flexibility and restores covariance in some ways; but it also breaks all your Collection subclasses which override methods with the now-obsolete signatures.
Are there any other similar method changes to watch out for? Post below; if the 'offical' javadoc for this 1.2 prototype release isn't forthcoming 'soon' I'll probably hand-edit the 1.0 prototype javadoc to be correct for the new release and post it on the web for everyone to use pro tem. (But it would be nice if the Sun folk did this themselves, so I wouldn't have to bother, hint, hint!)
3) NO MORE JAVADOC. Mentioned above; hope you've got a copy of the 1.0 javadoc lying around still.
4) BUGS FIXED. As pnkfelix noted in another post here, some type-system loopholes have been fixed in this release. Also, the bugs which prevented casts from Set to Collection and from Set to Set<T> appear to have been fixed. The bad-line-numbers-on-non-Unix-platforms bug is reputedly gone. Further, it
seems that this release compiles non-GJ code better. I'll probably post more on these issues as I get a little more experience w/ this new release. Does anyone else have 'favorite' 1.0-prototype bugs which were fixed in this release?
5) ONLY WORKS ON JDK1.4. The last release didn't work on 1.3 either, as far as I can tell. But, regardless, this is the only
documented change in this release (according to the CHANGES file in the distribution).
OK. This feels incomplete. Post below and let's hear what else you've noticed has changed.
[[[ObObscurePersonalNote: Felix, FLEX now has a GJ port. 'magic-4-0' These prototype compilers are far too buggy for me to release it on the rest of the group, but I've been playing with it on my own personal branch.]]]