RFR: JDK-8272945: Use snippets in java.compiler documentation
Erik Joelsson
erikj at openjdk.java.net
Fri Dec 3 13:50:14 UTC 2021
On Fri, 3 Dec 2021 00:41:23 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> Please review a patch to use snippets in the `java.compiler` documentation, instead of a mix of raw HTML and/or `{@code ...}`. The change is just about the presentation of the code fragments; there are no changes to the normative specifications for the module.
>>
>> One of the examples went to extraordinary lengths to include the character sequence `*/` within the example. That example has been replaced by an external snippet in a separate source file, which does not have any restriction on the use of `*/`. However, it does require that the file be excluded from standard compilation, and that is done by setting `EXCLUDES`, once for the "interim" compiler, and once again for the "product" compiler. Going forward, a better solution might be to modify the `SetupJavaCompilation` macro to ignore all directories whose name is not a valid Java identifier (or, if easier, contains a `-`, such as `doc-files` or `snippet-files`.)
>
> make/modules/java.compiler/Java.gmk line 30:
>
>> 28:
>> 29: EXCLUDES += \
>> 30: javax/tools/snippet-files \
>
> You can put this just on a single line :-).
>
> And I'm frankly not sure if make is happy about having a trailing backslash but no additional line...
As long as the next line is empty, it works, but it's not a good idea. That's why we came up with the terminating # in our 1 element per line lists. In this case, I would prefer a single line assignment without any backslashes.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6686
More information about the compiler-dev
mailing list