-
1. Bug in getDeclaringClass in 3.0RC1
stupendousman Aug 20, 2002 4:01 AM (in response to swatkat)There is a bug in the getDeclaringClass method of CtClass when you try and get the declaring class of an anonymous inner class it throws FileNotFoundException. EG:
package examples.javassisttests.declaringclasses;
import javassist.*;
public class Test {
public static void main( final String[] notUsed ) throws NotFoundException {
new Object() {}; // annonymous inner class
final CtClass inner = ClassPool.getDefault().get( "examples.javassisttests.declaringclasses.Test$1" );
System.out.println( "Inner class = " + inner.getName() );
System.out.println( "Outer class (direct) = " + ClassPool.getDefault().get( "examples.javassisttests.declaringclasses.Test" ).getName() );
System.out.println( "Outer class (from inner) = " + inner.getDeclaringClass().getName() );
}
}
Produces:
Inner class = examples.javassisttests.declaringclasses.Test$1
Outer class (direct) = examples.javassisttests.declaringclasses.Test
javassist.NotFoundException
at javassist.ClassPool.get(ClassPool.java:295)
at javassist.CtClassType.getDeclaringClass(CtClassType.java:412)
at examples.javassisttests.declaringclasses.Test.main(Test.java:9)
Exception in thread "main" -
2. Re: JDK 1.4 Dillema
hezekiel Aug 20, 2002 1:58 PM (in response to swatkat)Been using the 3.0.1 with jdk 1.4 for a month now. No problems so far. As for the advantages you automatically get more faster serialization times with 1.4
IO? you're not supposed to do any IO-ops from your EJBs, but your own JCA connectors might benefit from those.