[foreign] RFR 8223247: jextract should generate static forwarder regardless of -l option

Henry Jen henry.jen at oracle.com
Thu May 2 16:55:45 UTC 2019


Since static will try to bind, it must have a library. This is simply make the intention of using default library explicit as it seems we are preferring explicitness.

Either way will work fine, I think. Just some may simply “forgot” to make sure the library is needed.

Cheers,
Henry



> On May 2, 2019, at 8:17 AM, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote:
> 
> Honestly this looks good as is. Henry do you have some specific case in mind you'd like to prevent?
> 
> If this is just 'fear of misuse', I suggest let's try it out and see where we land
> 
> Maurizio
> 
> On 02/05/2019 16:09, Henry Jen wrote:
>> I was thinking about this because I need static forwarder with default library. I think it’s better to have static forwarder initially based on if -l is provided, or explicit set to true assuming the default library should be enough for binding.
>> 
>> Cheers,
>> Henry
>> 
>> diff -r c6aa368eeed0 -r 237718a86bbe src/jdk.jextract/share/classes/com/sun/tools/jextract/Main.java
>> --- a/src/jdk.jextract/share/classes/com/sun/tools/jextract/Main.java	Wed May 01 23:00:41 2019 -0700
>> +++ b/src/jdk.jextract/share/classes/com/sun/tools/jextract/Main.java	Wed May 01 23:14:20 2019 -0700
>> @@ -117,11 +117,11 @@
>>          }
>> 
>>          // generate static forwarder class if user specified -l option
>> -        boolean staticForwarder = true;
>> +        boolean staticForwarder = options.has("l");
>>          if (options.has("static-forwarder")) {
>>              staticForwarder = (boolean)options.valueOf("static-forwarder");
>>          }
>> -        builder.setGenStaticForwarder(staticForwarder && options.has("l"));
>> +        builder.setGenStaticForwarder(staticForwarder);
>> 
>>          boolean recordLibraryPath = options.has("record-library-path");
>>          if (recordLibraryPath) {
>> 
>> 
>>> On May 2, 2019, at 7:47 AM, Sundararajan Athijegannathan <sundararajan.athijegannathan at oracle.com> wrote:
>>> 
>>> Please review.
>>> 
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8223247
>>> Webrev: https://cr.openjdk.java.net/~sundar/8223247/webrev.00/
>>> 
>>> Thanks,
>>> -Sundar



More information about the panama-dev mailing list