commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (JIRA)" <>
Subject [jira] [Commented] (LANG-965) FieldUtils methods leak accessible flags
Date Thu, 16 Oct 2014 06:26:34 GMT


Benedikt Ritter commented on LANG-965:

This needs more thought. There is a fundamental problem with getField, since neither the user
nor we can tell if the accessibility has been changed after we have handed the field out of
the API. My opinion is, to get this right we will have to implement something like:

FieldUtils.doWithField("fieldName", true, new FieldAccessCallback(Field theField) {
   // user can do something with the field here

In doWithField we can restore the accessibility after we have called the callback.

> FieldUtils methods leak accessible flags
> ----------------------------------------
>                 Key: LANG-965
>                 URL:
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.reflect.*
>    Affects Versions: 3.1, 3.2.1
>         Environment: Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17
> Maven home: C:\Java\apache-maven-3.1.1\bin\..
> Java version: 1.7.0_51, vendor: Oracle Corporation
> Java home: C:\Program Files\Java\jdk1.7.0_51\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Benedikt Ritter
>             Fix For: Patch Needed
>         Attachments: commons-lang-965.patch, commons-lang-965.patch
> When various FieldUtils methods are called the accessible is set to true but never reset
to false. This is side-effect should be cleaned up.
> This makes a mess of the object model which represents the class meta data.

This message was sent by Atlassian JIRA

View raw message