|
OpenJDK, Java's open source reference implementation (also the foundation of Oracle JDK) has reached an important milestone. The jdk repository, which contains the library code, has eliminated all compilation warnings in the upcoming release of JDK 9, and Joe Darcy and others led Oracle engineers to work on it for months, perfecting it. Which also includes some contributions from the community.
Java, like other programming languages, such as C, supports an inspection mode (linting mode) that can warn of poor code styles and potentially insecure coding practices. Examples include whether there is default handling in switch / case statements, and the use of Java primitive types. While the warnings generated by the checks appear to be modest, the bug is likely to be hidden behind the tagged code. Eliminating warnings can reveal real problems, some of which are hidden deep.
The OpenJDK team addresses this problem by eliminating one type of warning and then setting the warning to a fatal error so that code with this warning can not be committed to the repository. When all the warning types are removed, the compilation process will turn on the -Xlint: all -Werror switch so that all warnings become fatal when the JDK is compiled.
Finally, Darcy wrote a blog post in which he gave advice to Java developers wishing to use this method to clean up their compilation warnings in their projects. |
|
|
|