RFR: 7903788: preparation towards json configuration for jextract tool [v4]

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Aug 16 14:22:00 UTC 2024


On Fri, 16 Aug 2024 13:56:50 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:

>>> What about j.l.reflect.GenericArrayType? That seems like a valid target for this?
>> 
>> I though of GenericArrayType. Then realised that I've walk to the bottom type and find the eraser type.. and then build array-of-array.. (up to whatever dimension. Say List<String>[][][]). Not sure if that is worth it.
>
>> What's the advantage of having the arrayConverters? In the end they will still (a) create a new array and (b) loop over the contents. Wouldn't it make more sense to define all the array logic in here, remove `arrayConverters` and then just redefine all the implementations of the factories in `JSONArrays` as shortcuts to this method?
> 
> Wouldn't that involve comparing Class object with a series of if-else-if for array component type? if (type == boolean.class).. else if (type == char.class)... unless I miss something.

Ah ok, you want to avoid the `if`. Fine.

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

PR Review Comment: https://git.openjdk.org/jextract/pull/257#discussion_r1719910169


More information about the jextract-dev mailing list