RFR: 7903776: jextract generates uncompilable code when C identifier with the name from "java.lang" classes is used
Chen Liang
liach at openjdk.org
Tue Jul 16 14:31:04 UTC 2024
On Tue, 16 Jul 2024 13:34:47 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:
> Unqualified names are mangled by NameMangler. But it was complete (didn't include "Boolean"). For uniformity & future proof mangling all type names from "java.lang" package.
src/main/java/org/openjdk/jextract/impl/NameMangler.java line 339:
> 337: // java.lang package is auto-imported. Check if we've clash
> 338: // of the given identifier with any of the java.lang.* types.
> 339: Class.forName("java.lang." + name);
1. Should we cache the results?
2. This detects package-private classes in java.lang too, which might not be desired. Maybe `yield clazz.accessFlags().contains(AccessFlag.PUBLIC)`
-------------
PR Review Comment: https://git.openjdk.org/jextract/pull/253#discussion_r1679522441
More information about the jextract-dev
mailing list