[OpenJDK 2D-Dev] Remove warnings

Roman Kennke roman.kennke at aicas.com
Tue Sep 25 20:43:15 UTC 2007


Today I took some time studying the J2D code [1] and came across a bunch
of warnings that I thought I'd remove (only in sun/java2d/x11 for now):

- Remove unused imports, makes code slightly cleaner.
- Access static fields like SunGraphics2D.XYZ rather than sg2d.XYZ.
Better style generally and avoids potential programming error (rarely
though).
- Add @Override to overriding methods. In case the superclass method
changes name and/or signature, this triggers a compiler error, thus
preventing accidental problems when refactoring.
- Remove some unnecessary casts to String. Makes code slightly cleaner.

Find the patch attached. Feel free to include it in OpenJDK if you like.

Cheers, Roman
-- 
Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-0
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openjdk-java2d-warnings.diff
Type: text/x-patch
Size: 16317 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20070925/7c8983dc/openjdk-java2d-warnings.diff>


More information about the 2d-dev mailing list