getAccessibleMethod returns null when method is declared in a package-private
class but used through a bublic subclass
----------------------------------------------------------------------------------------------------------------------
Key: BEANUTILS-316
URL: https://issues.apache.org/jira/browse/BEANUTILS-316
Project: Commons BeanUtils
Issue Type: Bug
Components: Bean / Property Utils
Affects Versions: 1.7.0
Environment: Probably not relevant here, but I use IBM Websphere
Application Server 5.0
Reporter: Romain Muller
Priority: Minor
Given two classes : A, which is package-private, and B which extends A and is
public. You might then access all methods declared in A from any instance of B
anywhere, even outside of the package containing A.
But PropertyUtils.setProperty fails if the property accessed is not overloaded
in B.
Fact is in my use case it appears unrelevant for users of B to knoy about A,
and it is definitely undesireable to use references declared as A from anywhere
outside the package.
PropertyUtils shoud in my opinion check wether the effective class of the bean
is public and that the accessor method is also public instead of looking for a
public method declared in a public class or interface.
This might not conform to JavaBean specifications, though, but this change
would not cost a lot, and would definitely get things a little more flexible.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.