RFR: 7903674: jextract should ignore non-enum constants inside enum [v4]

Jorn Vernee jvernee at openjdk.org
Tue Feb 20 13:46:04 UTC 2024


On Tue, 20 Feb 2024 13:37:33 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:

>> * checking cursor kind of child cursor to be CursorKind.EnumConstantDecl. 
>> * Piggybacking to fix similar check of record child element kinds to be CursorKind.FieldDecl.  
>> * Added null check for createTree return value in collectNestedTypes method as well.
>> * In addition to jextract tests, I ran all samples on Mac OS. All fine with this change. Also, ran jextract script for Mac OS from  https://github.com/manuelbl/JavaDoesUSB.git.
>
> Athijegannathan Sundararajan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   reduce the diffs for this patch.

src/main/java/org/openjdk/jextract/impl/TreeMaker.java line 374:

> 372:                 if (child.kind() == CursorKind.EnumConstantDecl) {
> 373:                     Declaration enumConstantDecl = createTree(child);
> 374:                     if (enumConstantDecl != null) {

The null check here is not needed anymore. (test coverage shows the `null` branch is uncovered here as well)

test/testng/org/openjdk/jextract/test/api/attributes/Test7903674.java line 28:

> 26: import testlib.JextractApiTestBase;
> 27: 
> 28: public class Test7903674 extends JextractApiTestBase {

Could you please give a descriptive name to the test class. It becomes very hard to find anything with all the bug numbers.

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

PR Review Comment: https://git.openjdk.org/jextract/pull/221#discussion_r1495847475
PR Review Comment: https://git.openjdk.org/jextract/pull/221#discussion_r1495846317


More information about the jextract-dev mailing list