JDK-6469562 : Use compact notation to display annotation values
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-09-12
  • Updated: 2016-08-12
  • Resolved: 2016-02-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b107Fixed
Related Reports
Relates :  
Relates :  
Sub Tasks
JDK-8164470 :  
Description
The javadoc for the annotations applied to an annotated element uses a verbose form; e.g.

    @Documented
    @Retention(value=RUNTIME)
    @Target(value=ANNOTATION_TYPE)
    public @interface Inherited

The more compact

    @Documented
    @Retention(RUNTIME)
    @Target(ANNOTATION_TYPE)
    public @interface Inherited

could often be used instead.

Comments
Draft release note text: Behavioral compatibility change. Previously javadoc would include "value=" when displaying annotations even when that text was not necessary in the source because the annotations were single-element annotations (JLS 9.7.3 https://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html#jls-9.7.3). Such text is now omitted, leading to more concise annotation display.
17-02-2016

Review thread: http://mail.openjdk.java.net/pipermail/compiler-dev/2016-February/009995.html
14-02-2016

With the compact display of repeating annotations planned for JDK 8, this would be a fine time to include this more natural presentation of annotation information as well. If an annotation would only have one member displayed AND the member is named "value" then the "value=" text should be elided.
12-12-2012