You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thomas Neidhart (JIRA)" <ji...@apache.org> on 2013/11/17 21:09:21 UTC
[jira] [Commented] (BEANUTILS-451) PropertyUtils doesn´t work with private internal classes
[ https://issues.apache.org/jira/browse/BEANUTILS-451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13824940#comment-13824940 ]
Thomas Neidhart commented on BEANUTILS-451:
-------------------------------------------
By default, one can not access a private inner class from another class, in this case PropertyUtils, as it is not accessible.
You can test with by calling: PropertyUtils.isReadable(bean, "field"), which will return false in your case.
> PropertyUtils doesn´t work with private internal classes
> --------------------------------------------------------
>
> Key: BEANUTILS-451
> URL: https://issues.apache.org/jira/browse/BEANUTILS-451
> Project: Commons BeanUtils
> Issue Type: Bug
> Components: Bean / Property Utils
> Affects Versions: 1.8.3
> Reporter: Robson Vargas Farias
> Priority: Critical
>
> I did a test using a internal private class to get the value of the fields. Sample:
> public class Master {
> private class Internal {
> private String field;
> public String getField() { return field; }
> public void setField(String field) {
> this.field = field;
> }
> }
> }
> When I try: PropertyUtils.getProperty(myInternalInstance, "field") I got an exception about "field not found".
--
This message was sent by Atlassian JIRA
(v6.1#6144)