jaxen-xpath / jaxen

The Jaxen XPath Engine for Java
Other
82 stars 33 forks source link

Need to upgrade to JDOM2 #2

Closed Rahman14354 closed 7 years ago

Rahman14354 commented 8 years ago

JAXEN latest build dosen't support JDOM2, Need support for JDOM2.

https://github.com/hunterhacker/jdom/wiki/JDOM2-Migration-Issues

elharo commented 8 years ago

This is probably not so much an upgrade as an additional navigator since JDOM2 changed the package names.

I would certainly consider a patch that supplied this.

wltjr commented 7 years ago

Not sure I would continue to support JDOM, rather encourage people to upgrade to JDOM2. In the event it is decided to be an upgrade. Should be able to just change namespace org.jdom -> org.jdom2. I have not seen any breakage or issues thus far. If it is an additional navigator, then code may be duplicated for different packages. Not sure that would make sense either. Unless there is a way to address both. I may look into patching this. Though at first will just start by changing jdom -> jdom2 and going from there. Maybe do a jaxen 2, so its a clean break from 1.x stuff. I think jdom 1.x is legacy and not sure it will be maintained or not. It went unmaintained for some time.

elharo commented 7 years ago

In any case, this likely belongs in JDOM2, not in Jaxen.

wltjr commented 7 years ago

This is about jaxen's usage of jdom in -> org/jaxen/jdom/*java. That stuff all uses org.jdom. That can be changed to org.jdom2 more than likely.

elharo commented 7 years ago

No, it can't be. That's a navigator for JDOM 1 and a lot of existing code depends on it. That shouldn't prevent a different navigator for JDOM 2.

wltjr commented 7 years ago

I understand, that means all the navigator code for JDOM 1 needs to be duplicated. I have not noticed any API breakage or changes from JDOM 1 -> JDOM 2. It is mostly a namespace, package name change. I am not sure it makes sense to have duplicate code just for a different namespace in jaxen.

At some point everyone needs to stop using JDOM 1. Thus maybe worth a jaxen 2, that does not support jdom2 at all. That way not duplicated code. JDOM 1 is legacy.

elharo commented 7 years ago

You can discuss the wisdom of the package change with the JDOM team. There's a lot of legacy code out there that uses JDOM 1. It's not going to migrate.

wltjr commented 7 years ago

There isn't really a JDOM team. It went unmaintained for many years. Someone came along, updated it for jdom2, and made some fixes for jdom. Jdom 1.x hasn't had a release in 4 years... I updated any code of mine using JDOM 1.x many years ago.

Mostly just 1 person working on it https://github.com/hunterhacker/jdom/commits/master

"JDOM 2.0.6 is available! This is a recommended upgrade for anyone still using JDOM 1.1.3 or earlier, and using Java5 or later." .... "JDOM 1.x versions are operating in maintenance mode only and only bug fixes will be considered for future 1.x releases. The only reason to continue using JDOM 1.x is for compatibility with older Java versions (back to Java 1.2)." http://www.jdom.org/

Then from the migration guide

"Apart from the changed package name though, the rest of JDOM2 is mostly compatible with JDOM 1.x. This means that, after changing the org.jdom2 import statements there is a very good chance that everything will 'just work'. There are small issues you may encounter that require code changes though these should be rare." https://github.com/hunterhacker/jdom/wiki/JDOM2-Migration-Issues

Furthermore 02.26.2012: JDOM 1.1.3 Released! 04.08.2012: JDOM 2.0.0 Released!

That was 4 years ago. No further releases to 1.x codebase since. Its code for pre 1.5 jdk. JDOM 2 is for >= 1.5. Which 1.5 is EOL pretty much everywhere including IBM.

It is way past time to update to current code and stop holding onto and using legacy code. The fact that jaxen still uses jdom 1, makes it so other projects are not moving on either. Something has to give, and stop holding onto all this legacy code.

elharo commented 7 years ago

First get the rest of the world to migrate off JDOM 1.0, then maybe we can talk about deleting this code; but I'm not going to put the cart before the horse.

Nothing here prevents you from writing a JDOM 2 navigator if that's what you need; but that doesn't require deleting the existing JDOM 1 navigator.

wltjr commented 7 years ago

Given your lack of cooperation, its no surprise others are not migrating either. Though most projects that are active are looking to migrate if they have not already. Given the lack of tags, release of jaxen in years etc. I do not think you are looking to move this project forward really. There are other issues like circular dependencies with dom4j. Likely not using newer Java code per changes in newer JDK/JRE, etc.

Thankfully very few things use jaxen, seems to be legacy code itself. Rather than mess with jaxen or trying to get it updated. Might as well just get projects to move off using it. Thanks for your cooperation!