Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is com.sun.org.apache same as org.apache package?

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?

like image 204
The Student Avatar asked May 07 '10 20:05

The Student


3 Answers

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.

like image 115
bmargulies Avatar answered Oct 22 '22 03:10

bmargulies


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

like image 31
Jon Avatar answered Oct 22 '22 01:10

Jon


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.

like image 1
Jason Avatar answered Oct 22 '22 02:10

Jason