Nelz's Blog

Mah blogginess

[BACKPOST] Amen for Jakarta's Commons-Collections

So, I hadn’t really been working on my personal side-project much in the past couple of months because I had hit a bit of a stumbling block.

While using Struts, I encountered a problem where I needed a variable-length list of fields, all to end up in the same array. This means I was going to need an array that did Lazy Loading. (See here for a description.)

Well, after hanging it up for a while, I did a search, and found the Jakarta Commons Project had a decorator on List objects that would do lazy loading on set() or add() method invocations.

However, I found that those decorators (GrowthList and LazyList) were only added to the 3.2 release. And, as of yet, the 3.2 release hadn’t been added to the Maven repository, thus requiring that I add the 3.2 jar to my local repository manually.

But, I have the object in now, and it’s working exactly as I need. Thank you to the Jakarta project!