RFR: 7903674: jextract should ignore non-enum constants inside enum [v4]
Jorn Vernee
jvernee at openjdk.org
Tue Feb 20 14:16:08 UTC 2024
On Tue, 20 Feb 2024 13:59:08 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> 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)
>
> Isn't that the whole point of the fix? (e.g. skipping nulls when a "weird" cursor shows up)
I thought the `child.kind() == CursorKind.EnumConstantDecl` supersedes that.
P.S. If `null`s are still possible at this point, it would be nice to have a test for that too.
-------------
PR Review Comment: https://git.openjdk.org/jextract/pull/221#discussion_r1495888116
More information about the jextract-dev
mailing list