On Sunday 23 January 2005 19:50, Marcus Sundman wrote: > The only reason it doesn't work in java without reflection is because you > can't refer to an anonymous or private class.
No, I was wrong. It just happened to work in my test case because Test1 and Test2 were in the same package. I just read the JLS (2nd ed, section 15.12.4.3 if someone is interested). The JLS says that you must have access to both the method and the class (so far OK, but then it gets bad:), and the class must either be in the same package (even a private inner class is visible within its package!!!), or be declared public, or be declared protected and a superclass of the calling class. That's is really bad design made by morons who have no clue about security (*ahem*confused deputy*ahem*). Once more Gosling et al. have shown themselves to be idiots, but that's hardly surprising. Anyway, sorry for wasting your time. And thank you, Shinobu, for your help! - Marcus Sundman --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
