diff options
| author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-18 12:53:12 +0000 |
|---|---|---|
| committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-18 12:53:12 +0000 |
| commit | 87e64ba2cbfb8a6e474323743e38957091dbbcae (patch) | |
| tree | d24efec5a262a8283ca44dcab5e5ffc1c76b625e /libjava/gnu | |
| parent | 17529f9823fb9d0ecc4817fa46b78a35bdd8f7a7 (diff) | |
| download | ppe42-gcc-87e64ba2cbfb8a6e474323743e38957091dbbcae.tar.gz ppe42-gcc-87e64ba2cbfb8a6e474323743e38957091dbbcae.zip | |
2004-11-18 Craig Black <craig.black@aonix.com>
* gnu/java/beans/BeanInfoEmbryo.java: Use TreeMap for proper sorting.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90858 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu')
| -rw-r--r-- | libjava/gnu/java/beans/BeanInfoEmbryo.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libjava/gnu/java/beans/BeanInfoEmbryo.java b/libjava/gnu/java/beans/BeanInfoEmbryo.java index 2dc1166527e..7c60e7cd39b 100644 --- a/libjava/gnu/java/beans/BeanInfoEmbryo.java +++ b/libjava/gnu/java/beans/BeanInfoEmbryo.java @@ -48,6 +48,9 @@ import java.lang.reflect.Method; import java.util.Arrays; import java.util.Enumeration; import java.util.Hashtable; +import java.util.Iterator; +import java.util.Map; +import java.util.TreeMap; import java.util.Vector; /** @@ -66,7 +69,10 @@ import java.util.Vector; **/ public class BeanInfoEmbryo { - Hashtable properties = new Hashtable(); + + // by using a TreeMap the properties will be sorted alphabetically by name + // which matches the (undocumented) behavior of jdk + TreeMap properties = new TreeMap(); Hashtable events = new Hashtable(); Vector methods = new Vector(); @@ -85,9 +91,9 @@ public class BeanInfoEmbryo { PropertyDescriptor[] Aproperties = new PropertyDescriptor[properties.size()]; int i = 0; - Enumeration e = properties.elements(); - while (e.hasMoreElements()) { - Aproperties[i] = (PropertyDescriptor) e.nextElement(); + Iterator it = properties.entrySet().iterator(); + while (it.hasNext()) { + Aproperties[i] = (PropertyDescriptor) (((Map.Entry)it.next()).getValue()); if(defaultPropertyName != null && Aproperties[i].getName().equals(defaultPropertyName)) { defaultProperty = i; } @@ -96,7 +102,7 @@ public class BeanInfoEmbryo { EventSetDescriptor[] Aevents = new EventSetDescriptor[events.size()]; i = 0; - e = events.elements(); + Enumeration e = events.elements(); while (e.hasMoreElements()) { Aevents[i] = (EventSetDescriptor) e.nextElement(); if(defaultEventName != null && Aevents[i].getName().equals(defaultEventName)) { |

