RFR: 7903257: jextract should generate javadoc comments [v6]

Jorn Vernee jvernee at openjdk.org
Thu Oct 13 13:24:30 UTC 2022


On Wed, 12 Oct 2022 17:21:27 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:

>> Generating C signature as doc comments.
>
> Athijegannathan Sundararajan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   added {@snippet : } around code in javadoc comment.

Marked as reviewed by jvernee (no project role).

src/main/java/org/openjdk/jextract/impl/CDeclarationPrinter.java line 224:

> 222:                     // defensive. If no name is present, we don't want to crash
> 223:                     return new TypeVisitorResult(false,
> 224:                         t.name().isPresent()? t.name().get() : t.toString());

Suggestion:

                    return new TypeVisitorResult(false, t.name().orElse(t.toString()));

src/main/java/org/openjdk/jextract/impl/CDeclarationPrinter.java line 268:

> 266:         @Override
> 267:         public TypeVisitorResult visitType(Type t, String context) {
> 268:             return new TypeVisitorResult(false, t.getClass().getName());

Above in visitDelegated the default name seems to be `t.toString`. Maybe these could be factored out in some `defaultNameFor(Type type)` helper method for clarity.

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

PR: https://git.openjdk.org/jextract/pull/85


More information about the jextract-dev mailing list