-
Bug
-
Resolution: Fixed
-
P4
-
8-pool, 11, 15, 16, 17
-
b06
-
generic
-
generic
-
Verified
ADDITIONAL SYSTEM INFORMATION :
Javadoc 15.0.1 for Windows x64
A DESCRIPTION OF THE PROBLEM :
When a method's receiver parameter's type annotation is not on the immediate receiver type, such as a type annotation on a type argument, Javadoc tool omits that receiver parameter and the type annotations.
E.g. for a class like Generic<T>, a receiver parameter like
void take(Generic<@Anno T> this)
(where Anno is @Documented) will have receiver parameter omitted by javadoc, rendered like
void take()
, while
void take(@Anno Generic<T> this)
will be rendered correctly.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Set up the "Ape.java" and "Cute.java" files as provided below. Run "javadoc *.java". Observe in the method detail section,
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
In the method detail section, m0, m1, and m2 methods should all have receiver (self) parameters documented as annotated with type annotation.
Expected generated method details by javadoc
public void m0(@Cute("m0") Ape<T> this)
public void m1(@Cute("m1 outer") Ape<@Cute("m1 inner") T> this)
public void m2(Ape<@Cute("m2") T> this)
public void m3()
ACTUAL -
Only m0 and m1 have receiver parameters documented with type annotations. m2 whose type annotations is not on the immediate receiver type but in a type argument T does not have receiver parameter generated in method details.
Actual generated method details by javadoc
public void m0(@Cute("m0") Ape<T> this)
public void m1(@Cute("m1 outer") Ape<@Cute("m1 inner") T> this)
public void m2()
public void m3()
---------- BEGIN SOURCE ----------
Ape.java:
public class Ape<T> {
public void m0(@Cute("m0") Ape<T>this) {}
public void m1(@Cute("m1 outer")Ape<@Cute("m1 inner") T>this) {}
public void m2(Ape<@Cute("m2") T>this) {}
public void m3(Ape<T> this) {}
}
Cute.java:
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Documented
@Target(ElementType.TYPE_USE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Cute {
String value() default "";
}
---------- END SOURCE ----------
FREQUENCY : always
Javadoc 15.0.1 for Windows x64
A DESCRIPTION OF THE PROBLEM :
When a method's receiver parameter's type annotation is not on the immediate receiver type, such as a type annotation on a type argument, Javadoc tool omits that receiver parameter and the type annotations.
E.g. for a class like Generic<T>, a receiver parameter like
void take(Generic<@Anno T> this)
(where Anno is @Documented) will have receiver parameter omitted by javadoc, rendered like
void take()
, while
void take(@Anno Generic<T> this)
will be rendered correctly.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Set up the "Ape.java" and "Cute.java" files as provided below. Run "javadoc *.java". Observe in the method detail section,
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
In the method detail section, m0, m1, and m2 methods should all have receiver (self) parameters documented as annotated with type annotation.
Expected generated method details by javadoc
public void m0(@Cute("m0") Ape<T> this)
public void m1(@Cute("m1 outer") Ape<@Cute("m1 inner") T> this)
public void m2(Ape<@Cute("m2") T> this)
public void m3()
ACTUAL -
Only m0 and m1 have receiver parameters documented with type annotations. m2 whose type annotations is not on the immediate receiver type but in a type argument T does not have receiver parameter generated in method details.
Actual generated method details by javadoc
public void m0(@Cute("m0") Ape<T> this)
public void m1(@Cute("m1 outer") Ape<@Cute("m1 inner") T> this)
public void m2()
public void m3()
---------- BEGIN SOURCE ----------
Ape.java:
public class Ape<T> {
public void m0(@Cute("m0") Ape<T>this) {}
public void m1(@Cute("m1 outer")Ape<@Cute("m1 inner") T>this) {}
public void m2(Ape<@Cute("m2") T>this) {}
public void m3(Ape<T> this) {}
}
Cute.java:
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Documented
@Target(ElementType.TYPE_USE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Cute {
String value() default "";
}
---------- END SOURCE ----------
FREQUENCY : always