BeanInfoEmbryo.java: Use TreeMap for proper sorting.
2004-11-18 Craig Black <craig.black@aonix.com> * gnu/java/beans/BeanInfoEmbryo.java: Use TreeMap for proper sorting. From-SVN: r90858
This commit is contained in:
parent
b8610a5376
commit
f0b4747b4c
|
@ -1,3 +1,7 @@
|
||||||
|
2004-11-18 Craig Black <craig.black@aonix.com>
|
||||||
|
|
||||||
|
* gnu/java/beans/BeanInfoEmbryo.java: Use TreeMap for proper sorting.
|
||||||
|
|
||||||
2004-11-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
2004-11-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||||
|
|
||||||
* Makefile.am: Correct friend function declaration.
|
* Makefile.am: Correct friend function declaration.
|
||||||
|
|
|
@ -48,6 +48,9 @@ import java.lang.reflect.Method;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.TreeMap;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,7 +69,10 @@ import java.util.Vector;
|
||||||
**/
|
**/
|
||||||
|
|
||||||
public class BeanInfoEmbryo {
|
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();
|
Hashtable events = new Hashtable();
|
||||||
Vector methods = new Vector();
|
Vector methods = new Vector();
|
||||||
|
|
||||||
|
@ -85,9 +91,9 @@ public class BeanInfoEmbryo {
|
||||||
|
|
||||||
PropertyDescriptor[] Aproperties = new PropertyDescriptor[properties.size()];
|
PropertyDescriptor[] Aproperties = new PropertyDescriptor[properties.size()];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
Enumeration e = properties.elements();
|
Iterator it = properties.entrySet().iterator();
|
||||||
while (e.hasMoreElements()) {
|
while (it.hasNext()) {
|
||||||
Aproperties[i] = (PropertyDescriptor) e.nextElement();
|
Aproperties[i] = (PropertyDescriptor) (((Map.Entry)it.next()).getValue());
|
||||||
if(defaultPropertyName != null && Aproperties[i].getName().equals(defaultPropertyName)) {
|
if(defaultPropertyName != null && Aproperties[i].getName().equals(defaultPropertyName)) {
|
||||||
defaultProperty = i;
|
defaultProperty = i;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +102,7 @@ public class BeanInfoEmbryo {
|
||||||
|
|
||||||
EventSetDescriptor[] Aevents = new EventSetDescriptor[events.size()];
|
EventSetDescriptor[] Aevents = new EventSetDescriptor[events.size()];
|
||||||
i = 0;
|
i = 0;
|
||||||
e = events.elements();
|
Enumeration e = events.elements();
|
||||||
while (e.hasMoreElements()) {
|
while (e.hasMoreElements()) {
|
||||||
Aevents[i] = (EventSetDescriptor) e.nextElement();
|
Aevents[i] = (EventSetDescriptor) e.nextElement();
|
||||||
if(defaultEventName != null && Aevents[i].getName().equals(defaultEventName)) {
|
if(defaultEventName != null && Aevents[i].getName().equals(defaultEventName)) {
|
||||||
|
|
Loading…
Reference in New Issue