I think I can answer my own question :) In java.lang.Class the method getDeclaringClass returns null for an anonymous class because the Java Language Specification doesn't list anonymous classes as members of a class (but strangely does list named classes as members). I suspect therefore that CtClass's getDeclaringClass is mimicing this behaviour when it throws a NotFoundException for an anonymous class.
Sun have introduced in J5 a new method, getEnclosingClass, which works with anonymous and named classes and gives the outer class. Therefore, are there plans to add getEnclosingClass to Javassist? View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3860984#3860984 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3860984 ------------------------------------------------------- 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 [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-user
