You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Galen O'Sullivan (JIRA)" <ji...@apache.org> on 2017/06/12 22:50:00 UTC

[jira] [Commented] (GEODE-130) Suppress proprietary API compiler warnings

    [ https://issues.apache.org/jira/browse/GEODE-130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16047163#comment-16047163 ] 

Galen O'Sullivan commented on GEODE-130:
----------------------------------------

Can we use the [SuppressWarnings|https://docs.oracle.com/javase/8/docs/api/java/lang/SuppressWarnings.html] annotation to suppress these warnings?

> Suppress proprietary API compiler warnings
> ------------------------------------------
>
>                 Key: GEODE-130
>                 URL: https://issues.apache.org/jira/browse/GEODE-130
>             Project: Geode
>          Issue Type: Bug
>          Components: build
>            Reporter: Anthony Baker
>            Priority: Trivial
>
> Geode uses several internal JDK classes like SignalHandler and Unsafe.  These generate compiler warnings like:
> {noformat}
> /Users/abaker/code/incubator-geode/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/shell/unsafe/GfshSignalHandler.java:73: warning: SignalHandler is internal proprietary API and may be removed in a future release
>     return (handler == SignalHandler.SIG_DFL || handler == SignalHandler.SIG_IGN ? null : handler);
> {noformat}
> It would be nice to suppress these using the {{-XDignore.symbol.file=true}} javac argument ([1|http://stackoverflow.com/questions/4065401/using-internal-sun-classes-with-javac]) to remove noise from the build output.  Looks like the only way to do this is to fork the javac compiler from gradle ([2|https://discuss.gradle.org/t/passing-arguments-to-compiler-and-javadoc/1661]) and add a compiler arg:
> {noformat}
> options.fork = true
> options.forkOptions.executable = 'javac'
> options.compilerArgs << '-XDignore.symbol.file'
> {noformat}
> I'm not sure it's worth the performance hit of forking javac to suppress the warnings.
> Of course, we will need to address usage of these API's in Java9 as we will not have access to internal JDK classes (due to Project Jigsaw).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)