[foreign-preview] RFR: Tweak warning text for restricted method access

Julia Boes jboes at openjdk.java.net
Mon Mar 7 10:27:24 UTC 2022


On Wed, 2 Mar 2022 14:49:24 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> Following some internal feedback, the new warning for restricted method access has been tweaked to this:
> 
> 
> WARNING: A restricted method in <class> has been called
> WARNING: <method> has been called by <module>
> WARNING: Use --enable-native-access=<module> to avoid a warning for this module
> 
> 
> For instance:
> 
> 
> WARNING: A restricted method in java.lang.foreign.CLinker has been called
> WARNING: java.lang.foreign.CLinker::systemCLinker has been called by module panama_module
> WARNING: Use --enable-native-access=panama_module to avoid a warning for this module
> 
> 
> or, for unnamed modules:
> 
> 
> WARNING: A restricted method in java.lang.foreign.CLinker has been called
> WARNING: java.lang.foreign.CLinker::systemCLinker has been called by the unnamed module
> WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for this module
> 
> 
> This new text helps better connecting the warning with the action that a developer might want to take to get rid of the warning.

Looks good!

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

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


More information about the panama-dev mailing list