You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2019/12/07 11:22:15 UTC

[GitHub] [netbeans] mklaehn commented on issue #1741: [NETBEANS-3543] Corrected compiler warnings in extide/o.apache.tools.…

mklaehn commented on issue #1741: [NETBEANS-3543] Corrected compiler warnings in extide/o.apache.tools.…
URL: https://github.com/apache/netbeans/pull/1741#issuecomment-562842107
 
 
   > Hello Martin, thanks for the cleanup.
   > 
   > If you removed all compilation warnings from the module, should you also make sure that once a new warning is introduced, the compilation fails?
   > 
   > Because without such automatic check your work may not last. Traditionally the NetBeans community never paid much attention to warnings - as such I wouldn't even noticed if I re-introduced a warning.
   
   I fully agree with you.
   
   However, the only thing I've accomplished is correcting the linter warnings for specific types - namely the one listed in the description of this PR. With the current value of the `javac.compilerargs` property no more linter warnings are produced. This however does not mean that the compiler does not produce no warnings. The following warnings are an exerpt of the warning still produced during the build process:
   
   ```
   .../nbbuild/build/public-package-jars/org-netbeans-api-annotations-common.jar(/org/netbeans/api/annotations/common/NonNull.class): warning: Cannot find annotation method 'when()' in type 'Nonnull': class file for javax.annotation.Nonnull not found
   warning: unknown enum constant When.ALWAYS
     reason: class file for javax.annotation.meta.When not found
   .../nbbuild/build/public-package-jars/org-netbeans-api-annotations-common.jar(/org/netbeans/api/annotations/common/NullAllowed.class): warning: Cannot find annotation method 'when()' in type 'Nonnull'
   warning: unknown enum constant When.MAYBE
   warning: No processor claimed any of these annotations: org.netbeans.api.annotations.common.NullAllowed,org.netbeans.api.annotations.common.NonNull
   ```
   
   Setting the `-Werror` javac flag then causes the build to fail rather fast.
   
   ```
   error: warnings found and -Werror specified
   1 error
   5 warnings
   ```
   
   I have not investigated what causes these messages nor how to fix them. That would propably be a job for someone that is more knowledgeable with the NetBeans buildsystem.
   
   > There is a `-Werror` javac flag. You should enable it when setting the `javac.compilerargs` property. Or (better) change `common.xml` to support a new property `javac.failOnWarnings=false` (`false` by default) that each cleaned up module could set to `true`.
   
   My - at this stage rather pragmatic - opinion would be to add the `-Werror` to the `javac.compilerargs` property. Anyone acustomed to javac and its commandline argument knows what that does.
   Admittably a new property `javac.failOnWarnings=false` has its charm as well but who knows how it is used in the build.
   
   Just a gut feelling...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists