JDK-8214902 : Pretty-printing marker annotations add unnecessary parenthesis
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-12-05
  • Updated: 2018-12-14
  • Resolved: 2018-12-06
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 12
12 b24Fixed
Related Reports
Relates :  
Description
Pretty-printing the AST node for a marker annotation adds unnecessary parenthesis, e.g. `@A` becomes `@A()`.

Fixing this would be a small step towards improving the fidelity of the AST, as discussed in JDK-8024098: "A nice goal/test would be to be able to take a source file, run it through parse() and analyze(), write out the tree, and get the same sequence of tokens found in the original file"
Comments
As discussed in the review thread [1], this is also an opportunity to clean up unnecessary parens on marker annotations in other tests. [1] http://mail.openjdk.java.net/pipermail/compiler-dev/2018-December/012720.html
05-12-2018