You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "yunghoyi (JIRA)" <ji...@apache.org> on 2015/05/30 06:16:17 UTC

[jira] [Closed] (LANG-1140) lang.reflect.FieldUtils.getAllFields() returns false result

     [ https://issues.apache.org/jira/browse/LANG-1140?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

yunghoyi closed LANG-1140.
--------------------------
    Resolution: Not A Problem

Not the problem of lang. The problem was caused by jacoco plugin.

> lang.reflect.FieldUtils.getAllFields() returns false result
> -----------------------------------------------------------
>
>                 Key: LANG-1140
>                 URL: https://issues.apache.org/jira/browse/LANG-1140
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.reflect.*
>    Affects Versions: 3.5
>         Environment: Linux ubuntu 3.16.0-38-generic x86_64 GNU/Linux
> java version "1.7.0_79"
> OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-0ubuntu0.14.10.2)
> OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
>            Reporter: yunghoyi
>             Fix For: Patch Needed
>
>
> JUnit test returns errors below.
>    FieldUtilsTest.testGetAllFields:154 expected:<5> but was:<7>
>    FieldUtilsTest.testGetAllFieldsList:168 expected:<5> but was:<7>
> Both methods has a parameter "FieldUtils.getAllFields(PublicChild.class).length ."
> PublicChild which has 1 field extends Parent which has 4 fields.
> I made a dummy class which contains no field, the result of getAllFields() was 1, not 0.
> Lang-3.4 doesn't have this problem.
> {code:title=PublicChild2.java|borderStyle=solid}
> public class PublicChild2 {
> 	static final String VALUE = "child";
> }
> {code}
> {code:title=FieldUtilsTest.java|borderStyle=solid}
> assertEquals(1, PublicChild2.class.getDeclaredFields().length);
> {code}
> Result: fails. returns 2



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)