JDK-8175390 : TYPE_USE annotations not shown in JavaDoc
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 8u121
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2017-02-22
  • Updated: 2017-07-28
  • Resolved: 2017-07-28
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
9Fixed
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
OS X 10.10.5

A DESCRIPTION OF THE PROBLEM :
Annotation types supporting ElementType.TYPE_USE and meta-annotated with @Documented are not shown in rendered JavaDocs.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
mkdir -p src/main/java/com/example

cat > src/main/java/com/example/MyAnno.java <<EOL
package com.example;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

@Documented
@Target({ TYPE, METHOD, FIELD, CONSTRUCTOR, PARAMETER, TYPE_USE })
@Retention(RUNTIME)
public @interface MyAnno {
}
EOL

cat > src/main/java/com/example/MyAnnoUser.java <<EOL
package com.example;

import java.util.List;

@MyAnno
public class MyAnnoUser {

    @MyAnno public String foo;
    public List<@MyAnno String> foos;

    @MyAnno public MyAnnoUser() {}

    @MyAnno public void doFoo(@MyAnno String foo) {}
    public void doBar(List<@MyAnno String> foos) {}
}
EOL

javadoc -sourcepath src/main/java -d target/javadoc $(find src/main/java -name "*.java")

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The rendered JavaDocs for the field "foos" and the method "doBar()" should show the MyAnno annotation on the type argument of List:

public java.util.List<@MyAnno java.lang.String> foos
public void doBar(java.util.List<MyAnno java.lang.String> foos)
ACTUAL -
The MyAnno annotation is not shown on the type argument of List:

public java.util.List<java.lang.String> foos
public void doBar(java.util.List<java.lang.String> foos)

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
See "Steps to Reproduce"
---------- END SOURCE ----------


Comments
This is fixed in jdk9 standard doclet.
22-02-2017