UPDATE - THIS WORK IS PRETTY MUCH DONE! - See Joes Darcy's blog post
This section takes you through how you can help clean up javac warnings in the OpenJDK and submit patches, reducing the number of bugs in Java itself! Any questions, comments, feedback etc please send to the Adopt OpenJDK group (if you have no luck there, try posting to the JUG leaders list).
The Adopt OpenJDK reviewers will liaise with the following sponsors to get patches into the right groups.
The barrier for the OpenJDK committers to accept a patch (even one as seemingly simple as a warning clean-up) is exceptionally high. The instructors will be checking a wide variety of conditions before your patch can be accepted. Please survey the list below and try to ensure your patch meets the quality bar.
Main focus: simple, minimal, and risk-free warnings fixes, most of the javac warnings are easy fixes. However, we've listed some gotchas below:
The compiler will occasionally issue warnings of the form: "warning: [serial] serializable class Foo has no definition of serialVersionUID". Usually the fix is to add a static serialVersionUID field initialized to the proper value.
To get the proper serial version UID value, run the "serialver" tool using a *released* version of the JDK:
java.misc.Foo: static final long serialVersionUID = 362498820763181265L;
Paste this line into Foo.java, with the addition of the private modifier:
private static final long serialVersionUID = 362498820763181265L;
Note however that anonymous inner classes should not have a serialVersionUID. Instead, use @SuppressWarnings("serial") to suppress the serialization warning for this case.
NOTE $SOURCE_CODE is where you installed the source code to. If you are using the Pre packaged VM then this is /home/openjdk/sources
cd $SOURCE_CODE cd jdk8_tl/jdk/make ./countWarnings.awk build.log
You'll see output similar to:
files warnings dir .. .. .. 8 333 make/javax/swing/plaf .. .. ..
Remember not to overlap with other efforts that are going on. If you're part of a global hack day, your instructor(s) will be co-ordinating with other teams. Fix some warnings in the source code (these are mainly under $SOURCE_CODE/jdk8_tl/jdk/src/share/classes). Depending on whether you're using the new or old build system, you'll then want to execute a build.
make images tail -f build.log
./executePartialBuild.sh tail -f build.log
When the build is done you should see something in the build.log file like:
Done Processing SUBDIRS: tools java javax sun com org sunw jpda mkdemo mksample launchers linux i586 1.8.0-internal build finished: 12-04-21 19:08
Check in the build.log file that the warnings you fixed are gone
NOTE: The build will be much faster the 2nd time around, it only compiles in and around the area that you have changed.
NOTE: You should see a much smaller set of warnings as the build.log only shows the results of the smaller build (i.e. What you've changed).
See Run jtreg tests
See Create Patches
See Submit Patches
Back to Adopt OpenJDK