Here is my braindump from Information Overload Central, AKA Java One 2008.
The day started with, you guessed it, another keynote. I just can't stay focused during them, so FWIW, here is what I got out of it.
A few months ago, I had asked Bob Brewin at Sun about the situation about audio and video codecs in Java and FX. He hemmed and hawed and mumbled something about how Ogg Vorbis wasn't really going to work out. The good news is that Sun now licensed the same codecs that are used in Flash, and there will be decent multimedia support going forward. It is just extremely annoying that codecs are so patent-encumbered, and it is yet more evidence that patents hinder, and not promote, the progress of science and the useful arts.
At the press cocktail hour, James Gosling was kind enough to give me some inside dope on JFX development. One of my graduate students, Sadiya Hameed, is working on reimplementing Java FX Script as a DSL. Whenever she showed me some code that she found in the wild, I thought “Whoa! That's a lot of math.” (Which, BTW, one of the keynote speakers said today as well.) As it turns out, a lot of the math is apparently auto-generated when a set of Adobe Illustrator files is transcoded into Java FX Script. The work flow is that the creative folks work in the tools that they like (and not so much in Java FX Script), and that the programmers work in the tools that they like (maybe Java FX Script for the front end, and definitely Java on the back end). Gosling also said that some of the tools were still pretty rough, which is why the keynote didn't show them off. That all made perfect sense. They should let him give the keynote next year.
I am a definite fan of JPA and EJB3, so I was keen on learning what is new in EJB 3.1. Fortunately, much of it centered on my pet topic, ease of development.
It surprises me how many people still don't realize that EJB3 was a game-changer. Last year, it was still ok to complain about EJB bloat. This year, not so much.
Bill Pugh gave an amusing talk about “WTF code”. He is the inventor of the nifty Findbugs tool and regularly trolls for dysfunctional code (in unsavory places such as this one) to add more bug-finding rules. Here are some of the beauties that he presented:
while ((c = (char) in.read()) != -1) { ... }
A char
is a value between 0 and 65535, never -1...
private final String lock = "LOCK"; synchronized (lock) { ... }
Literal strings are interned, so hopefully two programmers don't have that bright idea...
synchronized(getClass()) { myStaticCounter++; }
Let's hope nobody calls this from a subclass...
DateFormat
is not threadsafe...java.sql.Timestamp
is not symmetric... (The
audience's collective eyes glazed over at this point. An informal poll
revealed that a large fraction was blissfully unaware of the
instanceof
vs. getClass()
controversy in the
equals
method. This seems to be a lost cause. Maybe
anyone who overrides equals
in a non-final class needs to
supply an annotation @IKnowWhatIAmDoing
.) An interesting presentation about what to expect in Java 7 and beyond.
Rules:
enum
,
assert
). “Restricted” keywords are ok
(module
, and hopefully, property
:-))@Foo(name = "fred")
), the choice of =
was a
mistake, because you can't do foo(name = "fred")
for
ordinary methods. Had the Java 5 designers respected the future, they
would have chosen something like @Foo(name : "fred")
. Or
not...wouldn't that conflict with BGGA control invocation? Principles:
Likely to be in Java SE 7:
// Multi-catch try { .... } catch(X1, X2 e) { ... }
Definitely won't be in Java ever:
I want the multi-catch.
Modules and better annotations are noble but dull. Did I ever mention that I
want native properties? That I am sick of the boilerplate?
I asked James Gosling. He said that there is a long stack of proposals on
what to do with properties (I know...one of my students, Nikolay Botev,
compiled a long list of them, and another, Alexandre Alves, implemented a
javac
extension to implement one.) And they all run against a
brick wall when they try to deal with bound properties. I agree...bound
properties are a lost cause. Let's just admit that and move on, with simple
properties and a “restricted” property
keyword!
Too bad I didn't have a chance to ask about that in the BOF. I had been a reviewer for the tools and languages track, and Sharat Chander, the track chair, took out all of the reviewers for dinner. Potentially little known facts: (1) Competition for slots at Java One is intense. We had over 300 proposals for maybe 20 slots. (2) Most of the reviewers—at least in our track—are not from Sun.