[foreign-jextract] RFR: 8261642: improve jextract source generation mode and remove class generation [v2]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Mon Feb 15 14:41:45 UTC 2021


On Mon, 15 Feb 2021 14:07:47 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> src/jdk.incubator.jextract/share/classes/jdk/internal/jextract/impl/StructBuilder.java line 57:
>> 
>>> 55:         this.structType = structType;
>>> 56:         prefixElementNames = new ArrayDeque<>();
>>> 57:         classBegin();
>> 
>> Kinda strange that the constructor here calls `classBegin()` but OutputFactory calls `classEnd()`. Could both calls be moved to `OutputFactory`?
>
> I can fix this

forgot about this - I cannot really do this, as nested structs don't return a new builder - in other words, the OutputFactory code doesn't really know if it should begin a class or not. I could do `if (newBuilder != currentBuilder) newBuilder.classBegin() ...` but I don't think that improves much?

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

PR: https://git.openjdk.java.net/panama-foreign/pull/450


More information about the panama-dev mailing list