8009645: ClassFileTransformer hooks in ClassLoader no longer required

Alan Bateman Alan.Bateman at oracle.com
Fri Mar 8 16:27:55 UTC 2013

I need a reviewer for a change to remove some crud from 
java.lang.ClassLoader. The crud in question is a hook to allow 
implementations of sun.misc.ClassFileTransformer be notified when 
defineClass fails with a class format error. It was originally added >10 
years ago for Sun's Browser Plug-in to allow it fix up bad JDK1.1-era 
class files. I have confirmed that this is no longer needed.

As always with sun.misc classes it is useful to know if they are used 
outside of the JDK. To than end, I checked the data that Mandy collected 
on sun.* usage by artifacts in Maven Central.  In the case of 
ClassFileTransformer, we only found one usage and that was in an old 
version of an artifact so it's no longer an issue. Given that 
java.lang.instrument has been available since JDK5 then there really 
isn't any excuse to be using this class anyway.

The webrev with the proposed changes is here. I've left 
sun.misc.ClassFileTransformer in place for now with a warning in the 
javadoc. It is a definitely a candidate to remove in the future.




More information about the core-libs-dev mailing list