commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Nokleberg <>
Subject RE: [BEANUTILS] Property Descriptor Visibility
Date Tue, 14 Oct 2003 20:29:03 GMT
Arun Thomas wrote:

> While this might seem like a problem with the
> MethodUtils::getAccessibleMethod, it, in fact, reflects the reality of
> dynamic method invocation today (the behaviour is broken because these
> methods can be invoked directly, just not dynamically).  When I first
> encountered this problem, I was completely perplexed, but it turns out to
> be just the way the JRE's are written.  FYI, I've cut and pasted classes
> for a simple example below which does not use MethodUtils, but simply
> tries to dynamically invoke a method that belongs to a base class.  Here's
> the output when the base class is package protected:
> I would say, therefore, that changing this behaviour in MethodUtils is not
> particularly useful because PropertyUtils would then fail at actually
> invoking the method.  The only solution today seems to be to make the base
> class accessible.  If you find another, I'd be keen to know what it is.

FWIW this is another reason to use code generation rather than reflection.
Since the methods are invoked directly via generated bytecode there can be
no mismatch. IMHO it is unlikely that these reflection bugs will ever be
fixed, since doing so would break a bunch of existing code. See the CGLIB
net.sf.cglib.beans and net.sf.cglib.reflect packages (in CVS) for some
alternatives to the reflection-based commons libraries.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message