December 1, 2011 is the first JDK8 Warnings Cleanup Day (WCD).
This is an OpenJDK community effort to stamp out warnings in the JDK build. You mean there are warnings when you build the JDK? There certainly are, but they’re fairly well hidden in the log files. In many cases you need to add build options to javac such as -Xlint:all to see them. If you do this, you’ll see that there are over 10,000 warnings emitted by javac during the course of the build. How did they all get there? There are many reasons, but there are two main ones.
First, javac has historically not issued very many warnings. A certain number of warnings were mandated by the Java Language Specification, but beyond that there were few. In JDK 5, javac was enhanced to provide additional warnings for “about legal, but suspect and often problematic, program constructs.” [link]
In addition, the Java Programming Language has evolved, rendering older code obsolescent. This also occurred in JDK 5 with the addition of generics. Older code that hadn’t been updated to use generics suddenly compiled with many “raw type” and “unchecked” warning messages. There’s still a lot of this old code in the JDK. In fact, these two warning messages account for the majority of javac warning messages that occur in builds of the JDK.
In the Summer of 2011, Sasha Boulgakov, a summer intern, did some analysis about build warnings and how to reduce them. He discovered that there were over 13,500 warnings issued during the build of the jdk repository alone, that is, not including corba, hotspot, jaxp, jaxws, and langtools repositories. (A notable point is that the langtools team has been quite diligent about warnings, having kept their build at zero warnings for quite some time. Kudos to the langtools team and especially Jon Gibbons for their efforts.) Although Sasha had only a short summer with us, he managed to knock off around 2,800 warnings from the jdk repository’s build. Further work by Oracle engineer Kurchi Hazra has brought this down further to around 10,000 which is where we stand today.
Why are warnings important? Most of them are probably noise and don’t represent real problems. Since the compiler is doing us the favor of pointing out “suspect and often problematic” code, a certain portion of these warnings indicate actual bugs. However, this message is drowned out in all the noise. If we could get rid of all the noise, we’d be able to see the real bugs more clearly.
That brings us to Warnings Cleanup Day.
This is a collaborative effort among the OpenJDK community members (inside and outside of Oracle) to clean up the build warnings. For this first event, we’re focusing on warnings from javac emitted during the build of the jdk repository. (There are also warnings emitted during native code compilation, but that’s a totally different subject.) We don’t have any specific numeric goals, but we’re going to try to knock off as many as we can. You can see the initial announcement here. The main WCD page is here, and the division of labor and status updates will be posted here and updated during the day. Email discussion will occur on jdk8-dev@openjdk.java.net and some of us will be hanging out on the #openjdk IRC as well.
Let’s clean up those warnings!
[...] December 1, 2011 is the first JDK8 Warnings Cleanup Day (WCD). This is an OpenJDK community effort to stamp out warnings in the JDK build. You mean there are warnings when you build the JDK? There certainly are, but they’re fairly well hidden in the log files. In many cases you need to add build [...] JDK Read the original post on Planet JDK… [...]