Musings on JDK development

JSR 269 Passes Final Approval Ballot

The votes are in and JSR 269 has passed its final approval ballot!

Now that the initial JSR 269 API is defined, I'm looking forward to using the API for various meta-programming tasks, like writing coding convention checkers and incrementally refining the API in JDK 7.

Join the discussion

Comments ( 3 )
  • Manabu Nakamura Wednesday, November 8, 2006
    I want to process annotations on local classes and anonymous classes by using Pluggable Annotation Processing API.
    Is this a bug or a specification?
  • Joe Darcy Monday, November 13, 2006

    The standardized version of the API does not support operating on local and anonymous classes; although those classes can be modeled using the standard API.

    However, using the com.sun.source.tree API in JDK 6, those kinds of classes can be processed. For an example of how to use the tree API in this fashion, see some of the tests in the open source javac project's test/tools/javac/api directory, in particular TestOperators.java:

  • Manabu Nakamura Tuesday, November 14, 2006
    Thank you, Joe.
    I want to write an annotation processor like this.
    I have used the com.sun.source.tree API. However, I can't get the Element for the local and anonymous class by using Trees.instance(processingEnv).getElement(getCurrentPath()) in TreePathScanner#visitClass(). Is this a bug or a specification?
    P.S. I can't get a TypeElement object of a local and anonymous class by processingEnv.getElementUtils().getTypeElement("Processor.1LocalClass") and processingEnv.getElementUtils().getTypeElement("Processor.1") in 6rcb93 or later. Is this a valid behavior?
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.