When I posted my hacked version of javac, LAPT-javac, I was a little hesitant at first, because I expected my hack would receive quite a bit of attention and public scrutiny, and I was afraid I had unknowingly done something really wrong and it would make me look stupid in front of the whole world.
Well, while the latter may still happen, so far it seems like LAPT-javac and I have pretty much been ignored. There was one email with a question about how LAPT-javac relates to another project, Javari from MIT, and there was one comment in my announcement thread on Lambda the Ultimate about pluggable annotations in JSR 269.
Here’s my reply to the LtU comment:
Hi!
Thanks for your comment and for the pointer to JSR 269. I wasn’t aware of that one before, so I guess there’s yet another JSR that I need to track ;)
I looked at the Early Draft, and it looks like it supports a slightly extended annotation syntax as compared to Java 5.0 and provides a vastly improved support infrastructure that pulls apt into the standard API and extends it.
There are references to annotations on local variables, but I’m not exactly sure we can rely on that. After all, you can annotate local variables in Java 5.0, and the API provides the ElementType.LOCAL_VARIABLE enum value to control if an annotation can be applied to a local variable, yet the Java 5.0 compiler and apt completely ignore them.
Another reader also asked if I was aware of the Javari project at MIT and if what they were doing was similar to what I am doing. I have looked at Javari, and even though it’s not even the primary focus of that exciting project, they specify an extended syntax for annotations that allows you to annotate pretty much anything in a Java program. So what they are doing is way more compli cated and extensive than what I did. I just made the Java 5.0 compiler work the way I thought it should work, given the Java 5.0 language.
There was a very encouraging paragraph on the Javari website: Apparently, Sun has agreed to extend annotations (and hopefully the way they can be processed) in Java 7.0; until then, the Javari team will provide a modified javac that supports the 7.0 syntax.
That’s great, for two reasons: At least by the time Java 7.0 comes around, my hack should be unnecessary. And with Java 7.0 (and the Javari modification before that), we’ll get extended annotations. However, Java 7.0 is still very far away, and at least from what I can tell, the Javari modification is not yet available.
Until then, I’m hoping that my hack will be useful to someone (it is useful to me) and that maybe Sun will notice how easy it was to do, so perhaps it will get rolled into 6.0 already? I know those chances are slim, but one can dream… ;)
Thanks again for your comments and question. If you have any other questions or comments, please let me know, either here or by sending me an email (contact information is on the project website).
I’m looking forward to hearing from you, and I will keep everyone posted about improving (=hacking) the reflection API and apt.
I guess two other JSRs that I should keep on my watch list are JSR 202: JavaTM Class File Specification Update and JSR 305 (see Java Community News article). Especially JSR 305, lead by Bill Pugh of the FindBugs project looks interesting, relevant and challenging.