JDK-8225210 : Make javadoc's presentation of annotation objects consistent with core reflection and javac
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Not an Issue
  • Submitted: 2019-06-03
  • Updated: 2023-07-20
  • Resolved: 2023-07-19
Related Reports
Relates :  
Relates :  
Description
JDK-8164819 covers the alignment of javac with core-reflection.
We should extend the alignment to javadoc.
Comments
I did a bit more testing, and while String and char values were fine (also with escaped quotes) I found a problem with array type values. I filed a new bug for this: https://bugs.openjdk.org/browse/JDK-8312445
20-07-2023

I also note this was filed for JDK 9, in 2019. We may have fixed any issues since then. At any rate, it seems that there are no obvious issues now.
19-07-2023

If you tried the test classes from ExceptionalToString.java, that seems good enough.
19-07-2023

I couldn't find an issue with how JavaDoc presents annotations, so I assume this bug has been filed out of caution. If there is a concrete problem with annotations in JavaDoc this bug can be reopened or a new one filed.
19-07-2023

To evaluate the bug I ran the test classes from the ExceptionalToString.java test through javadoc and played around with the input a bit. The attached screenshot shows JavaDoc's rendering of an annotation with elements of different types (enum class, byte, Class, Class[]). JavaDoc behaviour also seems ok with erroneous input (it doesn't detect all errors, but that's expected for JavaDoc). I'll do some more research to find possible problems, and close as "not an issue" unless I find any.
18-07-2023