RFR: JDK-8278795: Create test library and tests for langtools snippets

Jonathan Gibbons jjg at openjdk.java.net
Thu Dec 23 21:10:17 UTC 2021


On Thu, 16 Dec 2021 14:14:44 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:

>> Please review a test-only fix to provide a new test library for analyzing snippets, and two tests that use that library to test snippets in the `jdk.javadoc` and `jdk.compiler` modules.
>> 
>> It is expected that the library may evolve in future updates as we explore additional ways to analyze snippets.
>
> test/langtools/tools/lib/snippets/SnippetUtils.java line 310:
> 
>> 308:             switch (ve.getKind()) {
>> 309:                 case ENUM_CONSTANT, FIELD -> scanDocComment(ve, treeScanner);
>> 310:                 default -> defaultAction(ve, treeScanner);
> 
> What kinds of elements are handled by the default branch?

It's there as a default to catch "anything else" that may come along, but that being said, IIRC I believe record components will come this way.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6839


More information about the compiler-dev mailing list