A library for diffing java.util.Lists
I recently set up a new project on kenai.com - this is something that has been available in NetBeans for years, and is probably useful to a wider audience. It is a library for taking two
java.util.Lists and generating a diff between them.
Collections as models for Swing components. But most revolve around observable lists, or wrapping lists in observable wrappers. style="border-style:solid;border-width:12px;border-color:white;"
But sometimes, you simply don't control the code that is handing you a list. I was in that situation when writing the Navigator for NetBeans 4 — I could get a list of class members, but there was no way to detect changes between them except to compare the previous list I got with the new one. So I wrote this general-purpose library for generating diffs between lists. It has proven useful in many projects, some not NetBeans-related, so it makes more sense as a project apart from NetBeans. The main wiki page for the project describes it, and the choices of algorithms available, in detail. With it, there is also a subproject that implements Swing
ListModels, to make it easy to use with
JLists (it will be there as soon as I make a build of NB with this bug fixed).