[jira] [Updated] (BEANUTILS-409) BeanUtils - 'describe' method returning Incorrect array value

2013-03-02 Thread Senthil Kumar Balakrishnan (JIRA)

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

Senthil Kumar Balakrishnan updated BEANUTILS-409:
-

Attachment: BEANUTILS-409-FIX.patch

Fix as suggested by Niall Pemberton.

 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-FIX.patch, BEANUTILS-409-Test.patch


 I want to convert a bean class to a map (key=the name of the member,value=the 
 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 { 
 private ArrayListString myList = new ArrayListString(); 
 public Demo() { 
 myList.add(first_value); 
 myList.add(second_value); 
 } 
  
 public ArrayListString getMyList() { 
 return myList; 
 } 
  
 public void setMyList(ArrayListString myList) { 
 this.myList = myList; 
 } 
  
 public static void main(String[] args) { 
 Demo myBean = new Demo(); 
 try { 
 Map describe = BeanUtils.describe(myBean); 
 Iterator it = describe.entrySet().iterator(); 
 while (it.hasNext()) { 
 Map.Entry pairs = (Map.Entry) it.next(); 
 System.out.println(String.format(key=%s,value=%s, 
 (String) pairs.getKey(), (String) pairs.getValue())); 
  
 } 
 } catch (Exception e) { 
 e.printStackTrace(); 
 } 
 } 
 } 
  •The expected output:
  
 key=myList,value=[first_value,second_value]
 key=class,value=class $Demo
  •But the real output is:
  
 key=myList,value=[first_value]
 key=class,value=class $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 administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (BEANUTILS-409) BeanUtils - 'describe' method returning Incorrect array value

2013-03-02 Thread Senthil Kumar Balakrishnan (JIRA)

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

Senthil Kumar Balakrishnan updated BEANUTILS-409:
-

Attachment: (was: BEANUTILS-409-FIX.patch)

 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=the name of the member,value=the 
 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 { 
 private ArrayListString myList = new ArrayListString(); 
 public Demo() { 
 myList.add(first_value); 
 myList.add(second_value); 
 } 
  
 public ArrayListString getMyList() { 
 return myList; 
 } 
  
 public void setMyList(ArrayListString myList) { 
 this.myList = myList; 
 } 
  
 public static void main(String[] args) { 
 Demo myBean = new Demo(); 
 try { 
 Map describe = BeanUtils.describe(myBean); 
 Iterator it = describe.entrySet().iterator(); 
 while (it.hasNext()) { 
 Map.Entry pairs = (Map.Entry) it.next(); 
 System.out.println(String.format(key=%s,value=%s, 
 (String) pairs.getKey(), (String) pairs.getValue())); 
  
 } 
 } catch (Exception e) { 
 e.printStackTrace(); 
 } 
 } 
 } 
  •The expected output:
  
 key=myList,value=[first_value,second_value]
 key=class,value=class $Demo
  •But the real output is:
  
 key=myList,value=[first_value]
 key=class,value=class $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 administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (BEANUTILS-409) BeanUtils - 'describe' method returning Incorrect array value

2013-03-02 Thread Senthil Kumar Balakrishnan (JIRA)

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

Senthil Kumar Balakrishnan updated BEANUTILS-409:
-

Attachment: BEANUTILS-409-FIX.patch

Re-attaching file.

 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-FIX.patch, BEANUTILS-409-Test.patch


 I want to convert a bean class to a map (key=the name of the member,value=the 
 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 { 
 private ArrayListString myList = new ArrayListString(); 
 public Demo() { 
 myList.add(first_value); 
 myList.add(second_value); 
 } 
  
 public ArrayListString getMyList() { 
 return myList; 
 } 
  
 public void setMyList(ArrayListString myList) { 
 this.myList = myList; 
 } 
  
 public static void main(String[] args) { 
 Demo myBean = new Demo(); 
 try { 
 Map describe = BeanUtils.describe(myBean); 
 Iterator it = describe.entrySet().iterator(); 
 while (it.hasNext()) { 
 Map.Entry pairs = (Map.Entry) it.next(); 
 System.out.println(String.format(key=%s,value=%s, 
 (String) pairs.getKey(), (String) pairs.getValue())); 
  
 } 
 } catch (Exception e) { 
 e.printStackTrace(); 
 } 
 } 
 } 
  •The expected output:
  
 key=myList,value=[first_value,second_value]
 key=class,value=class $Demo
  •But the real output is:
  
 key=myList,value=[first_value]
 key=class,value=class $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 administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (BEANUTILS-409) BeanUtils - 'describe' method returning Incorrect array value

2013-03-02 Thread Niall Pemberton (JIRA)

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

Niall Pemberton updated BEANUTILS-409:
--

Attachment: BEANUTILS-409-register.patch

I was thinking more along the lines of a new register method - attaching 
BEANUTILS-409-register.patch

With this you could change the behaviour of all the default arrat converters 
with 2 lines:

{code}
BeanUtilsBean.setInstance(new BeanUtilsBean2());
BeanUtilsBean.getInstance().getConvertUtils().register(false, true, 0, false);
{code}

 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-FIX.patch, BEANUTILS-409-register.patch, 
 BEANUTILS-409-Test.patch


 I want to convert a bean class to a map (key=the name of the member,value=the 
 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 { 
 private ArrayListString myList = new ArrayListString(); 
 public Demo() { 
 myList.add(first_value); 
 myList.add(second_value); 
 } 
  
 public ArrayListString getMyList() { 
 return myList; 
 } 
  
 public void setMyList(ArrayListString myList) { 
 this.myList = myList; 
 } 
  
 public static void main(String[] args) { 
 Demo myBean = new Demo(); 
 try { 
 Map describe = BeanUtils.describe(myBean); 
 Iterator it = describe.entrySet().iterator(); 
 while (it.hasNext()) { 
 Map.Entry pairs = (Map.Entry) it.next(); 
 System.out.println(String.format(key=%s,value=%s, 
 (String) pairs.getKey(), (String) pairs.getValue())); 
  
 } 
 } catch (Exception e) { 
 e.printStackTrace(); 
 } 
 } 
 } 
  •The expected output:
  
 key=myList,value=[first_value,second_value]
 key=class,value=class $Demo
  •But the real output is:
  
 key=myList,value=[first_value]
 key=class,value=class $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 administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (BEANUTILS-409) BeanUtils - 'describe' method returning Incorrect array value

2013-03-02 Thread Senthil Kumar Balakrishnan (JIRA)

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

Senthil Kumar Balakrishnan updated BEANUTILS-409:
-

Attachment: BEANUTILS-409-TESTCASE.patch

Agree with you Niall. 

Updated the test accordingly  attaching the test patch - 
BEANUTILS-409-TESTCASE.patch

 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-FIX.patch, BEANUTILS-409-register.patch, 
 BEANUTILS-409-TESTCASE.patch, BEANUTILS-409-Test.patch


 I want to convert a bean class to a map (key=the name of the member,value=the 
 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 { 
 private ArrayListString myList = new ArrayListString(); 
 public Demo() { 
 myList.add(first_value); 
 myList.add(second_value); 
 } 
  
 public ArrayListString getMyList() { 
 return myList; 
 } 
  
 public void setMyList(ArrayListString myList) { 
 this.myList = myList; 
 } 
  
 public static void main(String[] args) { 
 Demo myBean = new Demo(); 
 try { 
 Map describe = BeanUtils.describe(myBean); 
 Iterator it = describe.entrySet().iterator(); 
 while (it.hasNext()) { 
 Map.Entry pairs = (Map.Entry) it.next(); 
 System.out.println(String.format(key=%s,value=%s, 
 (String) pairs.getKey(), (String) pairs.getValue())); 
  
 } 
 } catch (Exception e) { 
 e.printStackTrace(); 
 } 
 } 
 } 
  •The expected output:
  
 key=myList,value=[first_value,second_value]
 key=class,value=class $Demo
  •But the real output is:
  
 key=myList,value=[first_value]
 key=class,value=class $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 administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (BEANUTILS-409) BeanUtils - 'describe' method returning Incorrect array value

2013-02-21 Thread Benedikt Ritter (JIRA)

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

Benedikt Ritter updated BEANUTILS-409:
--

Fix Version/s: 1.8.4

 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
Priority: Critical
  Labels: describe
 Fix For: 1.8.4


 I want to convert a bean class to a map (key=the name of the member,value=the 
 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 { 
 private ArrayListString myList = new ArrayListString(); 
 public Demo() { 
 myList.add(first_value); 
 myList.add(second_value); 
 } 
  
 public ArrayListString getMyList() { 
 return myList; 
 } 
  
 public void setMyList(ArrayListString myList) { 
 this.myList = myList; 
 } 
  
 public static void main(String[] args) { 
 Demo myBean = new Demo(); 
 try { 
 Map describe = BeanUtils.describe(myBean); 
 Iterator it = describe.entrySet().iterator(); 
 while (it.hasNext()) { 
 Map.Entry pairs = (Map.Entry) it.next(); 
 System.out.println(String.format(key=%s,value=%s, 
 (String) pairs.getKey(), (String) pairs.getValue())); 
  
 } 
 } catch (Exception e) { 
 e.printStackTrace(); 
 } 
 } 
 } 
  •The expected output:
  
 key=myList,value=[first_value,second_value]
 key=class,value=class $Demo
  •But the real output is:
  
 key=myList,value=[first_value]
 key=class,value=class $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 administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira