[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: Use TreeMap for proper sorting of BeanInfos

Kaffe CVS cvs-commits at kaffe.org
Tue Nov 23 19:36:21 PST 2004


PatchSet 5474 
Date: 2004/11/24 03:32:25
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath:  Use TreeMap for proper sorting of BeanInfos

2004-11-24  Dalibor Topic  <robilad at kaffe.org>

        * libraries/javalib/gnu/java/beans/BeanInfoEmbryo.java:
        Resynced with GNU Classpath.

        2004-11-15  Craig Black  <craig.black at aonix.com>

        * gnu/java/beans/BeanInfoEmbryo.java: Use TreeMap for proper sorting.

Members: 
	ChangeLog:1.3020->1.3021 
	libraries/javalib/gnu/java/beans/BeanInfoEmbryo.java:1.4->1.5 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3020 kaffe/ChangeLog:1.3021
--- kaffe/ChangeLog:1.3020	Wed Nov 24 03:20:35 2004
+++ kaffe/ChangeLog	Wed Nov 24 03:32:25 2004
@@ -1,5 +1,14 @@
 2004-11-24  Dalibor Topic  <robilad at kaffe.org>
 
+	* libraries/javalib/gnu/java/beans/BeanInfoEmbryo.java:
+        Resynced with GNU Classpath.
+
+	2004-11-15  Craig Black  <craig.black at aonix.com>
+
+        * gnu/java/beans/BeanInfoEmbryo.java: Use TreeMap for proper sorting.
+
+2004-11-24  Dalibor Topic  <robilad at kaffe.org>
+
 	* libraries/javalib/java/lang/StackTraceElement.java,
 	libraries/javalib/java/nio/channels/Channels.java,
 	libraries/javalib/java/rmi/Naming.java,
Index: kaffe/libraries/javalib/gnu/java/beans/BeanInfoEmbryo.java
diff -u kaffe/libraries/javalib/gnu/java/beans/BeanInfoEmbryo.java:1.4 kaffe/libraries/javalib/gnu/java/beans/BeanInfoEmbryo.java:1.5
--- kaffe/libraries/javalib/gnu/java/beans/BeanInfoEmbryo.java:1.4	Fri May 21 16:05:35 2004
+++ kaffe/libraries/javalib/gnu/java/beans/BeanInfoEmbryo.java	Wed Nov 24 03:32:27 2004
@@ -48,6 +48,9 @@
 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 @@
  **/
 
 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 @@
 
 		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 @@
 
 		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)) {




More information about the kaffe mailing list