Thanks Ken for trying to compile NetBeans with new JDKs!

čt 15. 7. 2021 v 0:34 odesílatel Kenneth Fogel <[email protected]>
napsal:

> Next, I compiled NB 12.5 with jdk-11.0.11.9-hotspot. I sent all output to
> a file for a simple analysis.
>
> Here is the report when I searched for "rawtypes":
> Search "rawtypes" (5400 hits in 1 file of 1 searched)
>
> Second most common is deprecation:
> Search "deprecation" (5128 hits in 1 file of 1 searched)
>
> I was surprised to discover these issues. Generics have been in Java since
> 2004 but it appears that much of the NB code remains pre-generic, hence the
> rawtypes warning. Technically this is just an annoyance because generics
> are a compile time trick so failing to use generic-style syntax likely has
> little effect on the compiled code. It can obscure code that calls on a
> data structure with different arguments when it should not. Use <Object> if
> you need this functionality otherwise declare the types and get rid of
> these warnings.
>
> The deprecation messages are more worrisome. Sure, much of Date was
> deprecated probably 20 years ago but it is still around. JavaScript support
> was deprecated in 11 and gone in 15 hence being unable to compile NB with
> 16 or 17. Is there a 'deprecation' team that is tracking each of these 5128
> issues and a 'rawtypes' team cleaning up the generics issue? There may be
> more issues lurking in the compiler output.
>
>
NetBeans project historically ignores warnings during compilation (probably
also my fault). However I have nothing against fixing (or suppressing)
warnings and making the build less verbose. I even started doing that in
https://github.com/apache/netbeans/pull/2835

If you, or anyone else, want to fix a module and make it "warning free",
then just add `-Werror` like I did here
https://github.com/apache/netbeans/pull/2835/files#diff-d11cd82d852793f61e937b98deb0b0896f124975394ac77672ae1db9ac2704ebR21
and then make sure the module compiles. Once it does, create a PR and let
it be integrated.

Thanks in advance for making NetBeans better.
-jt

PS: Organizing a wider community effort to eliminate warnings would also
count...

Reply via email to