Search

Categories

Links

Referers

Guide to javac

Aug 18 2006, 07:48:33 PM PDT »Java»Compiler Comments [4]
We have started writing a guide for javac, similar to the guide for javadoc. The plans are to describe JSR 269 (Pluggable Annotation Processing API), JSR 199 (Java™ Compiler API), and the Tree API.

If there is anything you would like to see in such a guide, please let me know within the next few days.

UPDATE: unfortunately, it only became clear to me very recently that I would have to write the guide and it was almost too late for JDK 6. I have added a minimal version that includes links to the manual pages and all the relevant API (this should make it easier to locate the Tree API docs). We hope to improve the guide in the coming month so it is ready for the first update release to JDK 6. The good news is that that gives us more time to incorporate your ideas and I have opened the comments again.

Post a Comment:
Comments are closed for this entry.
Comments:

Any assistance in the guide for moving away from third-party bytecode libraries like BCEL, ASM, or CGlib and toward JSR199 would be helpful. I typically call ASM's low-level bytecode generation directly, so I'd love to know what my migration path is to 199.

Posted by Charles Oliver Nutter on August 21, 2006 at 12:59 PM PDT #

Some examples of what you can and can't do with the relevant APIs would be great. For things that you can't do, explain why. For things that you can do, give some simple examples. Here are some example suggestions:

  1. Provide compiler support to reduce NullPointerExceptions. A language extension (like Nice) is one option. Annotations are another option. Either way, the compiler is needed in order to track the propagation of where nulls could be and annotation is used to persist that information.
  2. Annotation processing for thread affinity.
  3. Infering tighter access modifiers like Jamit does.

Thanks, Curt

Posted by Curt Cox on August 21, 2006 at 01:43 PM PDT #

Charles, I may have to disappoint you that JSR 199 is not a replacement for the third party libraries you mention. However, documenting that explicitly may be a good idea as Curt suggests.

Posted by Peter von der Ahé on August 21, 2006 at 07:53 PM PDT #

Hi Peter, It could be interesting to describe how to use the jsr199. For example, how does a user specify multiple output directories for multiple source files? Imagine a case where you have two compilation units X and Y. You want to use the jsr199 to compiler X into a folder bin and Y into a folder bin2. Other examples of usage of jsr199 API would be helpful.

Posted by Olivier Thomann on September 18, 2006 at 04:08 PM PDT #

Java is a trademark of Sun Microsystems, Inc.
Copyright © 2006,2007 Peter von der Ahé