This content has been marked as final.
Show 5 replies
-
1. Re: Bug in getDeclaringClass in 3.0RC1
hlovatt Jan 6, 2005 4:35 PM (in response to hlovatt)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? -
2. Re: Bug in getDeclaringClass in 3.0RC1
chiba Jan 12, 2005 12:25 PM (in response to hlovatt)That's a good idea. I'll implement it.
-
3. Re: Bug in getDeclaringClass in 3.0RC1
chiba Jan 13, 2005 12:06 PM (in response to hlovatt)I have implemented getEnclosingClass().
The source is in CVS HEAD. -
4. Re: Bug in getDeclaringClass in 3.0RC1
hlovatt Jan 24, 2005 2:20 AM (in response to hlovatt)"chiba" wrote:
I have implemented getEnclosingClass().
The source is in CVS HEAD.
Thanks - I look forward to the next release
Keep up the good work -
5. Re: Bug in getDeclaringClass in 3.0RC1
chiba Jan 24, 2005 10:31 AM (in response to hlovatt)I have released 3.0!
Please enjoy.