Desugaring of anonymous classes

Michael Ernst mernst at
Sun Mar 31 11:39:13 PDT 2013

Dear type annotations specification experts,

In January, I removed the text from the specification that was
compiler-specific.  This text was among the removed text:

  As another example, an anonymous class desugars into a class declaration
  and instantiation.  A programmer may write both type and declaration
  annotations on an anonymous class in Java source code.  In the classfile,
  the type annotations are copied to the class declaration and to its
  instantiation (new expression).  The declaration annotations are copied
  only to the class declaration.

Do you consider this possibly implementation-specific, and therefore it
does not belong in the specification.  Or, will every compiler follow this
implementation strategy so it is worth re-instating as useful guidance?


More information about the type-annotations-spec-experts mailing list