Prepend
2005-06-14
  Bugs in the JDK
So I submitted two bugs to Sun regarding the 1.4 JDK. One is more important than the other.
The first bug has to do with how the java.lang.reflect.Proxy class works. The Proxy class is really handy if you ever need to do multiple inheritance or other nifty Java tricks. If you want to know more you can google or look at the decent article over at devx.com.

The problem is that when you pass an implementation of Proxy from one jvm to another, you get some ClassNotFoundExceptions because the contract interface is in the application classloader and not the system class loader. This is because there is a special classloader for Proxy classes that does not use the current classloader, I suspect it uses the system classloader.

This was causing some major problems in a project I was involved in two years ago because we used Proxy classes all over the place for our transfer object. It was actually the brainchild of this developer I work with, Ali, who came up with a handy way of creating stateful transfer objects by just defining the inteface class. This worked great until we tried passing the Proxy transfer objects from JUnit to the web or ejb container. It started blowing up.

I ended up patching the custom ObjectInputStream that BEA used for WebLogic and we got it to work, but I couldn't patch the default JDK/JRE ObjectInputStream used to serialize/deserialize. I submitted a bug to Sun (208933) so they could correct it. It's been about two years and the new 1.5/5.0 JDK has come out and this bug still exists. It's pretty frustrating. Had this been apache or struts or jboss or something and a rather serious bug existed, at least I could fix it locally. I can't wait until the Apache OS JDK comes out so we don't have to deal with those slackers at Sun.

Looking at the top 25 bugs, it looks like there are quite a few problems lingering around.

Oh yeah, my other bug was the continued usage of deprecated Calendar/Date methods in the zip package. A slightly cosmetic bug, but could be serious considering that the deprecated Date methods synchronize on an internal static Calendar. So every thread using the deprecated Date constructor will block. This can be bad when your app uses this to check date diffs (like WebLogic used to do to see if JSP/Servlets have changed in a specific interval).
 
Comments:
Sun NEVER look at their bugs list (in most case, not all case, to be honest). They trend to investigate time of some cool feature that don't really useful to most ppl (like class sharing in 1.5); or duplicate opensource projects. (like XML <-> object and IDE)
 
Post a Comment



<< Home
Technical and personal notes from Brian Lee, technologist/enterprise architect/software developer/soa guy.

ARCHIVES
February 2005 / March 2005 / April 2005 / May 2005 / June 2005 / July 2005 / August 2005 / September 2005 / October 2005 / November 2005 / December 2005 / January 2006 / February 2006 / March 2006 / April 2006 / May 2006 / June 2006 / August 2006 / September 2006 / October 2006 / November 2006 / December 2006 / January 2007 / May 2007 / June 2007 / August 2007 / September 2007 / October 2007 / April 2008 / July 2008 / January 2009 / May 2009 / June 2009 /
My Photo
Name: Brian Lee
Location: Atlanta, Georgia, United States

 
Web prepend.com






Powered by Blogger