Tree Wagers

There has been a lot of public comments about the modifications we've made to Harmony's java.util.TreeMap implementation.  We've been working on it since I announced our use of the code last summer.  Reliability and compatibility are our greatest concerns, and much of the last several months have been spent flushing out obscure compatibility concerns.  Of course, some of the time has been spent in legal reviews for open source contributions.  However, today is the day.

I am very happy to announce that after completing Sun's open source review process, along with many iterations of quality assurance and compatibility testing we are engaging the Harmony community to do as we said we would, give the modifications we made to java.util.TreeMap back to Harmony.

While the modifications made to this TreeMap meet the Java 6 specification there remains behavioral compatibility differences between the TreeMap from Harmony and the TreeMap implementation in OpenJDK. These inconsistencies are continuing to be discovered and addressed --- compatibility is very important to us!  However, it appears to be important to Harmony to receive the modifications immediately.  More important than spending the engineering time to deliver an implementation that is fully compatible, beyond the Java 6 specification, with Java 6 TreeMap or OpenJDK's TreeMap. Hence, we are giving these modifications to Harmony in their current form.

Last but not least, it seems its time for Tim to make his £500 donation to the Woodland Trust.  I expect it would be too much to ask that it be done on behalf of the Sun Java development team :-)   Either way, I expect a bit of head slapping and tree hugging in Hampshire, UK tomorrow.


David, I'm on vacation this week (literally in a farmer's field!) so only a short comment. Can you help me reconcile the statements you make that Sun considers compatibility important, however, the changes that will be offered back to Harmony are incompatible with the versions in the JDK and OpenJDK?

You are right that Apache prefers to conduct the improvements and enhancements, including stability and compatibility changes, in the open project. No secret dev teams here ;-)

Posted by Tim Ellison on April 07, 2009 at 10:52 PM EDT #

No secret dev teams here either. We have found subtle behavioral differences surrounding performance of differing data sets and access types. There are no compatibility differences as far as the specification is concerned, but there are performance differences. The wide use of Sun's Java implementation has driven us to not only hold the line with compatibility as regards to the specification, but also performance.

Posted by David Dagastine on April 08, 2009 at 12:03 AM EDT #

Tim, I forgot to add this, your vacation seems right up my alley. Have fun!

Posted by David Dagastine on April 08, 2009 at 12:08 AM EDT #

Being the author who implemented the enhancements / modifications ... There are uses cases outside the defined behavior of the TreeMap specification that differs between OpenJDK's TreeMap and Harmony's TreeMap. Often times these cases occur when an Entry is returned, added and then subsequently mutated outside of the TreeMap. In some cases the Entry in the TreeMap also mutated, in other cases it is not. In some cases, the Entry's state is preserved once outside the TreeMap and other times it is not. There is a very large number of use cases involved and many of which are being discovered.

So, although both TreeMap implementations implement the TreeMap specification, there remain compatibility differences depending on how the TreeMap is being used. It is a subtle difference between "Java compatibility" and "complete compatibility".

Posted by charlie hunt on April 08, 2009 at 03:42 AM EDT #

So when is this code going to hit OpenJDK? I don't think anyone expects the code in OpenJDK7 to be perfect and it's certainly not meant to be JDK 1.6 compatible. It would be far better if development on this was done out in the open. Much less room for spurious rumours. Of course, once it's contributed to Harmony, anyone can combine it with OpenJDK really...

Posted by Andrew John Hughes on April 08, 2009 at 02:52 PM EDT #

@Andrew: (Back from vacation) I do not have the power to say when or if this source code will hit OpenJDK. The source code that shows up in the OpenJDK collection classes is controlled by what's called the "OpenJDK collections community".

What I can tell you, though, I have on my "todo list" an item for engaging the OpenJDK collections community on the subject of TreeMap. When this happens, it will be done in the "open" (as this is what I would like to do too). Unfortunately, I cannot give you time frame of when I expect that to happen due to other work priorities. Keep watching OpenJDK and you will see when this commences.

Thanks for asking!

Posted by charlie hunt on April 13, 2009 at 06:03 AM EDT #

Post a Comment:
Comments are closed for this entry.



« July 2016