-
Bug
-
Resolution: Unresolved
-
P3
-
8, 9
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 :
Annotations meta-annotated with @Documented show up twice in the JavaDoc when given on a public field or method parameter.
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
@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;
public class MyAnnoUser {
@MyAnno public String foo;
public void doFoo(@MyAnno String foo) {}
}
EOL
javadoc -sourcepath src/main/java -d target/javadoc $(find src/main/java -name "*.java")
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
In the field/method details section of MyAnnoUser, the MyAnno annotation should be shown once for each usage:
public @MyAnno java.lang.String foo
public void doFoo(@MyAnno java.lang.String foo)
ACTUAL -
The MyAnno annotation is show twice for each usage:
@MyAnno
public @MyAnno java.lang.String foo
public void doFoo(@MyAnno
@MyAnno java.lang.String foo)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
See above (steps to reproduce)
---------- END SOURCE ----------
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 :
Annotations meta-annotated with @Documented show up twice in the JavaDoc when given on a public field or method parameter.
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
@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;
public class MyAnnoUser {
@MyAnno public String foo;
public void doFoo(@MyAnno String foo) {}
}
EOL
javadoc -sourcepath src/main/java -d target/javadoc $(find src/main/java -name "*.java")
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
In the field/method details section of MyAnnoUser, the MyAnno annotation should be shown once for each usage:
public @MyAnno java.lang.String foo
public void doFoo(@MyAnno java.lang.String foo)
ACTUAL -
The MyAnno annotation is show twice for each usage:
@MyAnno
public @MyAnno java.lang.String foo
public void doFoo(@MyAnno
@MyAnno java.lang.String foo)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
See above (steps to reproduce)
---------- END SOURCE ----------
- relates to
-
JDK-8175390 TYPE_USE annotations not shown in JavaDoc
- Resolved
-
JDK-8278592 Documented annotations with target TYPE_USE and PARAMETER are duplicated
- Open