[jdom-interest] Opinion Poll: - JDOM2 and minimum-required Java - Java5 or Java6

Rolf jdom at tuis.net
Sun Oct 30 18:56:44 PDT 2011

Hi all.

When I started with JDOM2 I discussed with Jason whether we should 
target a minimum supported version of Java5 or Java6.

At the time I put together a list of Java6 features I thought could be 
remotely useful:

- JAXB 2.0 including StAX interfaces (we could have a StAXOutputter, etc.)
- Deque - ContentList/AttributeList could/should be a Deque too - making 
ContentList.removeLast() possible, etc.

Those were just off-the-cuff examples of what could be useful. I don't 
think that the ContentList/AttributeLists should be Deques... not now, 

Based on that we decided Java5 was still a reasonable target, unless 
something came up.

My biggest concern is that if we introduce JDOM2 as supporting Java5 
then we will have to support Java5 for a long time, introducing a 
testing dependency, and potentially curtailing future options... and 
Java5 itself has been unsupported for years....

Also, as it happens, I have inadvertently (out of habit) used an 
ArrayDeque in the DescendantIterator code as a Stack. It could be easily
replaced with some other collections structure.

What has brought this issue to a head though is that I have been working 
on some StAX code, and this is fairly well entrenched in Java6. Support 
for it on Java5 is not nice to add (need to download special jars, 
etc.). It can be done, but is a mess.

Further, I have been looking at outputting to an XMLStreamWriter, and 
the support for that would be useful to add to the XMLOutputter class...
and requiring an additional hard-to-get jar for that would be a real 
drawback.... we may as well just declare it to require Java6.

So, as a poll:

* Does anyone have a realistic need to run a future JDOM2 on Java5?
* If so, could you add additional jars to your classpath just to make 
JDOM2 work?
* Any comments, suggestions.

Currently I feel that it is reasonable to set Java6 as a minumum and not 
even bother trying to think about Java5 issues... anyone disagree?


More information about the jdom-interest mailing list