You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Matt Benson (JIRA)" <ji...@apache.org> on 2013/03/13 03:06:12 UTC
[jira] [Reopened] (LANG-873) Add FieldUtils getDeclaredFields() to
return all the fields defined in the given class and super classes
[ https://issues.apache.org/jira/browse/LANG-873?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matt Benson reopened LANG-873:
------------------------------
I disagree with applying the "Declared" nomenclature to this new method. The whole point of a "declared" field vs. just-a-field is that it is declared in the subtype.
> Add FieldUtils getDeclaredFields() to return all the fields defined in the given class and super classes
> --------------------------------------------------------------------------------------------------------
>
> Key: LANG-873
> URL: https://issues.apache.org/jira/browse/LANG-873
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.reflect.*
> Reporter: Emmanuel Bourg
> Priority: Minor
> Fix For: 3.2
>
> Attachments: FieldUtils.diff, FieldUtilsTest.diff
>
>
> {{java.lang.Class.getDeclaredFields()}} doesn't return the fields defined by the super classes. I'd like to suggest the addition of a new method in FieldUtils that also returns the inherited fields (including the private fields).
> According to this question on StackOverflow this method would be quite useful:
> http://stackoverflow.com/questions/3567372/access-to-private-inherited-fields-via-reflection-in-java
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira