Hi Brad,

I actually saw your PRs - great job!

"never change a running system" only applies if you intend to throw that system away some time in future. This should not apply to open source projects with the goal to exist for a while.

Technical dept is a real thing. It already starts with compiler warnings. Those warnings might not be everything btw, javac gives up printing warnings after it thinks it was enough to convince devs to do something (-Xmaxwarns 5000 for the full experience). If the project has enough deprecation warnings you might see no other warning types at all.


rawtype fixes can be very often combined with upgrades to newer (collection) APIs. This isn't really a surprise since warnings indicate old code. Sometimes a stream is easier to read and shorter than a iterator and the warnings are gone too. Other times a immutable collection can be used e.g List.of() (unfortunately thats 9+) or utilities like Arrays.asList(), list.toArray(new T[0]) or Collections.emptyList()...


best regards,
michael


On 15.07.21 01:02, Brad Walker wrote:
I should probably chime in here as the Netbeans Rust Remover.

Netbeans has gone through some changes over the years. A big part of that
is "the code just works". So this means, it can largely be "left alone". It
might not be optimal and in some places prevents moving to newer JDKs. But,
it's something that needs to be fixed and/or improved on. So it's become my
little way to help the project.

I have personally cleaned up over thousands of these "warnings".. The
rawtype warning is a favorite place that I've done a LOT of cleanup. The
deprecation warning, I've cleaned up some. There are still a lot of those.

I continue to do this work going forward and would welcome any help.

FYI.

-brad w.


On Wed, Jul 14, 2021 at 4:34 PM Kenneth Fogel <[email protected]>
wrote:

For my own amusement I tried to compile the NetBeans 12.5 beta using Java
16 and 17 on my new Windows system. In both cases there was an issue with
not finding the JavaScript engine. JS support in Java was deprecated in
Java 11 but it was not removed until Java 15 This is not new information. I
assume a replacement is being determined

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.




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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



Reply via email to