This section takes you through how you can help apply Java 7 project Coin features in the OpenJDK and submit patches, improving the code quality in Java itself! Any questions, comments, feedback etc please send to the '''[mailto:firstname.lastname@example.org Adopt OpenJDK group]''' (if you have no luck there, try posting to the '''[mailto:email@example.com JUG leaders list]''').
= References to previous work =
* Stuart Marks [http://stuartmarks.wordpress.com/2010/12/23/jdk7-coin-and-making-libraries-fresh-and-minty/ Applying Project Coin to OpenJDK]
The Adopt OpenJDK reviewers will liaise with the following sponsors to get patches into the right groups.
* Stuart Marks --> core-libs.
* Artem Ananiev --> swing and awt (client)
=Instructions for instructors=
See [[GeneralInstructionsForSmallChanges#Instructions_for_instructors|Instructions for instructors]]
=What fixes are accepted (The barrier for patches)=
==Order to apply project Coin fixes in==
You should work on project Coni fixes in the following order (which is basically from safest to more difficult to prove safety).
# Diamond Operator
# Everything else (e.g. try-with-resources)
The barrier for the OpenJDK committers to accept a patch (even one as seemingly simple as a project coin 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 project coin fixes. We've listed some gotchas below:
== Diamond Operator ==
* [http://stuartmarks.wordpress.com/2011/01/24/where-can-diamond-be-used/ Where Diamond can be used]
* [http://stuartmarks.wordpress.com/2011/04/29/when-should-diamond-be-used/ When should Diamond be used]
== Strings in Switch ==
* For strings-in-switch, a null value of the switch expression results in NPE, whereas (depending on the details, of course) a cascade of if-elses may end up handling null differently.
== Multi-catch ==
* In some cases there is a catch of Exception that is better expressed as a multi-catch of several Exception subtypes. This might make for better code, but it subtly changes the behavior of the code.
See [[GeneralInstructionsForSmallChanges#Hardware_Requirements|Hardware Requirements]]
See [[GeneralInstructionsForSmallChanges#Attendee_Instructions|Attendee Instructions]]
==Look for areas to coinify==
# See your instructor(s) on the day to co-ordinate this activity or co-ordinate on the adoptopenjdk mailing list
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.
=== New Build ===
make images &> build.log
tail -f build.log
=== Old Build ===
tail -f build.log
== Check the 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
'''NOTE:''' The build will be much faster the 2nd time around, it only compiles in and around the area that you have changed.
==Run jtreg tests==
See [[GeneralInstructionsForSmallChanges#Run_jtreg_tests|Run jtreg tests]]
==Repeat the Process==
See [[GeneralInstructionsForSmallChanges#Repeat_the_Process|Repeat the process]]
See [[GeneralInstructionsForSmallChanges#Create_Patches|Create Patches]]
See [[GeneralInstructionsForSmallChanges#Submit_Patches|Submit Patches]]
Back to [[Adopt OpenJDK]]