I'm checking this in.
We lose the order of fields in internalGetFields. This in turn makes
JNA die. The order is not guaranteed, of course, but there's no
reason that Class should rearrange things gratuitously -- that's what
the VM is for :)
Tom
ChangeLog:
2007-08-15 Tom Tromey <[EMAIL PROTECTED]>
* java/lang/Class.java (internalGetFields): Use LinkedHashSet.
Index: java/lang/Class.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/lang/Class.java,v
retrieving revision 1.52
diff -u -r1.52 Class.java
--- java/lang/Class.java 4 Feb 2007 09:58:00 -0000 1.52
+++ java/lang/Class.java 15 Aug 2007 16:22:29 -0000
@@ -1,5 +1,5 @@
/* Class.java -- Representation of a Java class.
- Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+ Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation
This file is part of GNU Classpath.
@@ -66,7 +66,7 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
/**
@@ -596,7 +596,7 @@
*/
private Field[] internalGetFields()
{
- HashSet<Field> set = new HashSet<Field>();
+ LinkedHashSet<Field> set = new LinkedHashSet<Field>();
set.addAll(Arrays.asList(getDeclaredFields(true)));
Class[] interfaces = getInterfaces();
for (int i = 0; i < interfaces.length; i++)