[jira] Updated: (BEANUTILS-214) [beanutils] Preserving DynaBean Property Ordering

2006-11-07 Thread Henri Yandell (JIRA)
 [ http://issues.apache.org/jira/browse/BEANUTILS-214?page=all ]

Henri Yandell updated BEANUTILS-214:


  Bugzilla Id:   (was: 37825)
Fix Version/s: LATER THAN 1.8.0

A LinkedHashMap would push the required JDK version up, so won't be in 1.8.0.

 [beanutils] Preserving DynaBean Property Ordering
 -

 Key: BEANUTILS-214
 URL: http://issues.apache.org/jira/browse/BEANUTILS-214
 Project: Commons BeanUtils
  Issue Type: Improvement
  Components: DynaBean
 Environment: Operating System: All
 Platform: All
Reporter: Martin Fick
Priority: Minor
 Fix For: LATER THAN 1.8.0


 The order of properties is not preserved when using the beanutils to fetch 
 properties from a DynaBean.  Since DynaBeans use an array to define 
 properties 
 it is natural desire to use the order of this array to do things with a 
 DynaBean.  With a 2 line patch to BeanUtilsBean.java, it can be made to 
 return 
 a LinkedHashMap for DynaBean properties which preserves the ordering of these 
 properties.   
  
 This patch is particularly usefull if you are using the display tag to 
 display DynaBeans.  Several people have suggested a patch like this on the 
 display tag mailing list. 
  
  
 *** BeanUtilsBean.java 
 --- BeanUtilsBean.java.ordered 
 *** 
 *** 26,31  
 --- 26,32  
   import java.util.ArrayList; 
   import java.util.Collection; 
   import java.util.HashMap; 
 + import java.util.LinkedHashMap; 
   import java.util.Iterator; 
   import java.util.Map; 
   import java.util.WeakHashMap; 
 *** 
 *** 487,493  
   log.debug(Describing bean:  + bean.getClass().getName()); 
   } 
  
 ! Map description = new HashMap(); 
   if (bean instanceof DynaBean) { 
   DynaProperty descriptors[] = 
   ((DynaBean) bean).getDynaClass().getDynaProperties(); 
 --- 488,494  
   log.debug(Describing bean:  + bean.getClass().getName()); 
   } 
  
 ! Map description = new LinkedHashMap(); 
   if (bean instanceof DynaBean) { 
   DynaProperty descriptors[] = 
   ((DynaBean) bean).getDynaClass().getDynaProperties();

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[jira] Updated: (BEANUTILS-214) [beanutils] Preserving DynaBean Property Ordering

2006-11-05 Thread Niall Pemberton (JIRA)
 [ http://issues.apache.org/jira/browse/BEANUTILS-214?page=all ]

Niall Pemberton updated BEANUTILS-214:
--

Bugzilla Id:   (was: 37825)
Component/s: DynaBean

 [beanutils] Preserving DynaBean Property Ordering
 -

 Key: BEANUTILS-214
 URL: http://issues.apache.org/jira/browse/BEANUTILS-214
 Project: Commons BeanUtils
  Issue Type: Improvement
  Components: DynaBean
 Environment: Operating System: All
 Platform: All
Reporter: Martin Fick
Priority: Minor

 The order of properties is not preserved when using the beanutils to fetch 
 properties from a DynaBean.  Since DynaBeans use an array to define 
 properties 
 it is natural desire to use the order of this array to do things with a 
 DynaBean.  With a 2 line patch to BeanUtilsBean.java, it can be made to 
 return 
 a LinkedHashMap for DynaBean properties which preserves the ordering of these 
 properties.   
  
 This patch is particularly usefull if you are using the display tag to 
 display DynaBeans.  Several people have suggested a patch like this on the 
 display tag mailing list. 
  
  
 *** BeanUtilsBean.java 
 --- BeanUtilsBean.java.ordered 
 *** 
 *** 26,31  
 --- 26,32  
   import java.util.ArrayList; 
   import java.util.Collection; 
   import java.util.HashMap; 
 + import java.util.LinkedHashMap; 
   import java.util.Iterator; 
   import java.util.Map; 
   import java.util.WeakHashMap; 
 *** 
 *** 487,493  
   log.debug(Describing bean:  + bean.getClass().getName()); 
   } 
  
 ! Map description = new HashMap(); 
   if (bean instanceof DynaBean) { 
   DynaProperty descriptors[] = 
   ((DynaBean) bean).getDynaClass().getDynaProperties(); 
 --- 488,494  
   log.debug(Describing bean:  + bean.getClass().getName()); 
   } 
  
 ! Map description = new LinkedHashMap(); 
   if (bean instanceof DynaBean) { 
   DynaProperty descriptors[] = 
   ((DynaBean) bean).getDynaClass().getDynaProperties();

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]