Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2E2C1E2D1 for ; Sun, 24 Feb 2013 10:38:15 +0000 (UTC) Received: (qmail 41534 invoked by uid 500); 24 Feb 2013 10:38:14 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 41270 invoked by uid 500); 24 Feb 2013 10:38:14 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 41235 invoked by uid 99); 24 Feb 2013 10:38:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Feb 2013 10:38:13 +0000 Date: Sun, 24 Feb 2013 10:38:13 +0000 (UTC) From: "Benedikt Ritter (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (BEANUTILS-409) BeanUtils - 'describe' method returning Incorrect array value MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/BEANUTILS-409?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1= 3585343#comment-13585343 ]=20 Benedikt Ritter commented on BEANUTILS-409: ------------------------------------------- Hello Senthil, I've started a discussion about this issue on the ML [1]. I'll comment here= as soon as I get feedback. [1] http://markmail.org/message/5k53gqakfpt2r7xl =20 > BeanUtils - 'describe' method returning Incorrect array value > ------------------------------------------------------------- > > Key: BEANUTILS-409 > URL: https://issues.apache.org/jira/browse/BEANUTILS-409 > Project: Commons BeanUtils > Issue Type: Bug > Affects Versions: 1.8.3 > Environment: commons-beanutils 1.8.3, jdk 1.6.0_20 > Reporter: benny > Assignee: Benedikt Ritter > Priority: Critical > Labels: describe > Fix For: 1.8.4 > > Attachments: BEANUTILS-409-Test.patch > > > I want to convert a bean class to a map (key=3Dthe name of the member,val= ue=3Dthe value of the member). > I'm using the method BeanUtils.describe(beanClass); > (I'm using commons-beanutils 1.8.3, jdk 1.6.0_20, on commons-beanutils 1.= 5 it works) > The problem is that the return value is incorrect, (the map contain only = the first item from the array), > the code: > public class Demo {=20 > private ArrayList myList =3D new ArrayList();=20 > public Demo() {=20 > myList.add("first_value");=20 > myList.add("second_value");=20 > }=20 > =20 > public ArrayList getMyList() {=20 > return myList;=20 > }=20 > =20 > public void setMyList(ArrayList myList) {=20 > this.myList =3D myList;=20 > }=20 > =20 > public static void main(String[] args) {=20 > Demo myBean =3D new Demo();=20 > try {=20 > Map describe =3D BeanUtils.describe(myBean);=20 > Iterator it =3D describe.entrySet().iterator();=20 > while (it.hasNext()) {=20 > Map.Entry pairs =3D (Map.Entry) it.next();=20 > System.out.println(String.format("key=3D%s,value=3D%s= ", (String) pairs.getKey(), (String) pairs.getValue()));=20 > =20 > }=20 > } catch (Exception e) {=20 > e.printStackTrace();=20 > }=20 > }=20 > }=20 > =E2=80=A2The expected output: > =20 > key=3DmyList,value=3D[first_value,second_value] > key=3Dclass,value=3Dclass $Demo > =E2=80=A2But the real output is: > =20 > key=3DmyList,value=3D[first_value] > key=3Dclass,value=3Dclass $Demo > As you can see the array contains two values but the output(and the map) = contains only one,why?? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira