<Swing Dev> Fixing compiler warnings in src/demo/share/jfc

Marc Hoffmann hoffmann at mountainminds.com
Thu Oct 31 18:56:51 UTC 2019


Dear Swing maintainers,

I was referred to this mailing list from build-dev. I would like to fix the compiler warnings caused by the Swing demo code. Please find original posting below.

As I learned that attachments might be stripped please find my patches also in this gist: https://gist.github.com/marchof/59923f8e2ebab0768ed76ffb5315a2c7

Best regards,
-marc



MOTIVATION

As a developer of the JaCoCo code coverage library I do lots of JDK builds. JDK
builds are simple, fast and produce minimal log output. Nice! What annoys me
though are plenty of compiler warnings at the end of the build caused by the
example code in src/demo/share/jfc

FIX

I propose a series of 3 patches (based on each other) which fixes all compiler
warnings for the demos:

patch1.txt - Fix compiler warnings in demos: raw types
patch2.txt - Fix compiler warnings in demos: deprecated APIs
patch3.txt - Fix compiler warnings in demos: deprecated Applet APIs

While patch 1 & 2 do not change functionality patch 3 actually removes the
Applet versions of some of the demos. The java main versions of the same demos
are still intact.

The patches are based on changeset 56699:70e6b0d8db13.

They have been tested from this clone: 
https://github.com/marchof/jdk/tree/fix-compiler-warnings-in-demos


RESULT

All compiler warnings on demo code during JDK build are removed

TESTING

I haven't found any automated tests so I manually launched all the demos. From
what I can say they are still functional.

SCOPE

I applied minimal changes to remove compiler warnings only. There are many more
cleanup opportunities in the demo code. Also there is (dead?) code in
src/demo/share/java2d which has similar issues. Both are not on scope of these
patches.

NEXT STEPS

I’m have no experience with OpenJDK patches. If you’re interested in getting these warnings fixed please
let me know how I can submit these patches properly.



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch1.txt
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20191031/49224cf0/patch1-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch2.txt
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20191031/49224cf0/patch2-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch3.txt
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20191031/49224cf0/patch3-0001.txt>
-------------- next part --------------




More information about the swing-dev mailing list