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" View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3860260#3860260 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3860260 ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user