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

Maurizio Cimadamore mcimadamore at openjdk.java.net
Mon Feb 15 16:03:57 UTC 2021


On Mon, 15 Feb 2021 15:05:52 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Yeah, I was looking at `classEnd()` where you use `if (prefixElementNames.isEmpty())` to check if the struct builder is for an anonymous nested struct or not. So I thought you could do the same for `classBegin()` and have:
>> 
>>     @Override
>>     void classBegin() {
>>         if (prefixElementNames.isEmpty()) {
>>             super.classBegin();
>>             addLayout(layoutField(), ((Type.Declared)structType).tree().layout().get())
>>                     .emitGetter(this, MEMBER_MODS, Constant.SUFFIX_ONLY);
>>         }
>>     }
>> 
>> ?
>
> Also, it might make things clearer by creating an `isAnonymousNested()` predicate for that (just for reader's sake).

Not sure about the predicate - in the sense that the builder is not an anonymous nested - it is just being reused/recycled for an anonymous nested.

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

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


More information about the panama-dev mailing list