Wednesday, December 09, 2009

JCL 2.1.1 released

JCL 2.1.1 is released with xml/web context support
Please visit project homepage for more details.

[License: LGPL]


Anonymous said...

Hi Kamran,

thanks for this library! I have a comment though:
The method JclObjectFactory.create(JarClassLoader jcl, String className, Object... args) doesn't take into account the case where the constructor's parameters of the object to create are superclasses or interfaces of 'args' (if I try I get an exception as JCL cannot match the constructor's signature with the classes of the arguments).
I've created a quick patch to allow this.
A new method that adds the constructor's signature needs to be defined and the array 'types' needs to refer to this signature:
public Object create(JarClassLoader jcl, String className, Class[] constructorSignature, Object... args) {
Class[] types = new Class[constructorSignature.length];

for( int i = 0; i < constructorSignature.length; i++ )
types[i] = constructorSignature[i];

(perhaps optimization is possible here but I didn't want to fiddle with the code!)

Franck Valentin
Wellcome Trust Genome Campus
Hinxton, Cambridge CB10 1SD

Kamran Zafar said...

Thanks for this Franck.. I will update the JclObjectFactory with this in the next release..

coldserenity said...

Hi Kamran,
Thanks for the library!
One question about it: when exception is thrown within our dynamically-loaded code - we cannot catch it within the code later because the exception itself gets wrapped into one of the JCL wrappers. Is it possible to turn the exception wrapping off?
Thanks again!