RFR: 7903673: Jextract throws NPE when generating enum constant javadoc

Maurizio Cimadamore mcimadamore at openjdk.org
Mon Feb 19 14:03:25 UTC 2024


This PR fixes `TreeMaker` so that it doesn't try to generate javadoc for `null` enum constants.

Unfortunately I was not able to reproduce on Linux. The problem seems to appear on MacOS when extracting this enum:


enum __CFByteOrder {
    CFByteOrderUnknown,
    CFByteOrderLittleEndian,
    CFByteOrderBigEndian
}; 


But there doesn't seem to be anything peculiar with this (and this does work when extracted in isolation).
It might indicate a deeper issue in libclang. For now, I made the code more robust, so that it handles possible null enum constants (these are left out from the IR).

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

Commit messages:
 - Initial push

Changes: https://git.openjdk.org/jextract/pull/219/files
 Webrev: https://webrevs.openjdk.org/?repo=jextract&pr=219&range=00
  Issue: https://bugs.openjdk.org/browse/CODETOOLS-7903673
  Stats: 9 lines in 1 file changed: 3 ins; 2 del; 4 mod
  Patch: https://git.openjdk.org/jextract/pull/219.diff
  Fetch: git fetch https://git.openjdk.org/jextract.git pull/219/head:pull/219

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


More information about the jextract-dev mailing list