views:

62

answers:

4

I mean, can I use the com.sun.org.apache (all subpackages) classes as I use they from org.apache (in any Apache lib)?

Will the OpenJDK maintain this package up to date with apache updates?

And the JDK7 will maintain this package?

Where can I find information about that?

+1  A: 

Err I wouldn't, just based on the fact that they're internal classes and there is a risk of them changing over time. Use the org.apache classes instead.

No idea about the intentions with keeping them up to date, maybe try posting a message on the openjdk forum:

http://mail.openjdk.java.net/mailman/listinfo

Jon
A: 

If documentation for this package says that it is public, then it's OK to use.

Otherwise they can pool a floor underneath you when they decide not to support it in the future.

Usually, you should not rely on anything other than java and javax in JDK.

Alexander Pogrebnyak
or org.w3c ... don't forget that.
bmargulies
+1  A: 

My understanding is that this is a fork of the apache code. At one point they were the same, but no more. So you can't count on the same bug fixes being present in both versions.

Jason
+1  A: 

It is a very bad idea to use it. Once upon a time, Sun took a copy of Xerces, chock full of bugs. They made some changes. Perhaps they subtracted some bugs. We know that there are many very serious bugs that they did not subtract.

And they renamed it to com.sun.... for one reason: to tell you not to use it. At any time, in any point release, in any patch, they can change those classes incompatibly or remove them.

Further, these classes may not be in IBM's copy of the JRE, or Apple's, or (haha) Microsoft's, or JRocket.

If you want Xerces, use Xerces. To find information about this, read the Xerces-j mailing list archive for many stern warnings from the Xerces developers about the version forked by Sun.

The fact that the classes are formally 'public' means nothing except that Sun needed to be able to new them from some other package.

bmargulies