RFR: 8152616: com.sun.tools.javac.tree.Pretty generates nested comments for enum

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Jan 25 11:17:54 UTC 2018


Hi Srinivas,
two comments:

* why the logic for printing the enum constant constructor type 
arguments? It is not possible to specify explicit constructor arguments 
on enum constants. (Funnily, javac attempts to parse them, but the 
attempt fails because the parser mode is wrong, so an error is 
generated). The spec has no place for them in the grammar:

https://docs.oracle.com/javase/specs/jls/se9/html/jls-8.html#jls-8.9.1

* I believe your end of block comment is misplaced, and it skips enum 
constructor arguments - that is, I see that '*/' is put AFTER the 
constructor arguments and before the '{' if any. Now, that doesn't 
affect your test, because the constants in the test don't have 
constructor arguments, but I believe there's bug lurking in here?

Cheers
Maurizio


On 25/01/18 08:19, Srinivas Dama wrote:
>
> Hi,
>
> Please review http://cr.openjdk.java.net/~sdama/8152616/webrev.00/ 
> <http://cr.openjdk.java.net/%7Esdama/8152616/webrev.00/> for 
> https://bugs.openjdk.java.net/browse/JDK-8152616
>
> Regards,
>
> Srinivas
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20180125/713605ed/attachment.html>


More information about the compiler-dev mailing list