RFR: 7903776: jextract generates uncompilable code when C identifier with the name from "java.lang" classes is used

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Jul 16 13:56: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 329:

> 327:         // Java types that are used unqualified in the generated code
> 328:         return switch (name) {
> 329:             case "String", "Struct", "MethodHandle",

should `String` be dropped from this list? Also, there seem to be other names that are out of sync, such as `NativeArena` and `Struct` (I wonder if we just want to repeat your trick for `java.lang.foreign`) and some are missing (e.g. `MethodHandle` but  not `VarHandle` ?)

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

PR Review Comment: https://git.openjdk.org/jextract/pull/253#discussion_r1679445837


More information about the jextract-dev mailing list