Posted by timboudreau
on May 12, 2009 at 11:18 AM PDT
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.
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.
There are a number of libraries around that support using
s as models for Swing components. But most revolve around observable lists, or wrapping lists in observable wrappers.
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
s, to make it easy to use with
s (it will be there as soon as I make a build of NB with this bug