Details
-
Bug
-
Resolution: Fixed
-
P4
-
None
-
None
-
b08
-
generic
-
generic
Description
When an array type is used as a value in an annotation element, each pair of square brackets is printed twice. This means a one-dimensional array type is rendered as two-dimensional, a two-dimensional array type as four-dimensional and so on.
Example annotation interface:
--------------------------------------------------------------------
import java.lang.annotation.*;
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface MyAnnotation {
Class<?> classy();
Class<?>[] classies();
}
---------------------------------------------------------------
Example annotation host:
---------------------------------------------------------------
@MyAnnotation(classy=AnnotationHost[].class,
classies={Object[].class, int[].class})
public class AnnotationHost {}
---------------------------------------------------------------
JavaDoc output:
------------------------------------------------------------------
@MyAnnotation(classy=AnnotationHost[][].class,
classies={java.lang.Object[][].class,int[][].class})
public class AnnotationHost
extends Object
------------------------------------------------------------------
Example annotation interface:
--------------------------------------------------------------------
import java.lang.annotation.*;
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface MyAnnotation {
Class<?> classy();
Class<?>[] classies();
}
---------------------------------------------------------------
Example annotation host:
---------------------------------------------------------------
@MyAnnotation(classy=AnnotationHost[].class,
classies={Object[].class, int[].class})
public class AnnotationHost {}
---------------------------------------------------------------
JavaDoc output:
------------------------------------------------------------------
@MyAnnotation(classy=AnnotationHost[][].class,
classies={java.lang.Object[][].class,int[][].class})
public class AnnotationHost
extends Object
------------------------------------------------------------------
Attachments
Issue Links
- relates to
-
JDK-8225210 Make javadoc's presentation of annotation objects consistent with core reflection and javac
-
- Resolved
-