This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: Class.internalGetFields
- From: Tom Tromey <tromey at redhat dot com>
- To: GCJ-patches <java-patches at gcc dot gnu dot org>
- Date: Wed, 15 Aug 2007 10:31:07 -0600
- Subject: Patch: FYI: Class.internalGetFields
- Reply-to: Tom Tromey <tromey at redhat dot com>
This changes Class.internalGetFields not to reorder fields.
This ought to let JNA work.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* java/lang/Class.java (internalGetFields): Use LinkedHashSet.
* classpath/lib/java/lang/Class.class: Rebuilt.
Index: java/lang/Class.java
===================================================================
--- java/lang/Class.java (revision 127484)
+++ java/lang/Class.java (working copy)
@@ -56,7 +56,7 @@
import java.security.ProtectionDomain;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.HashMap;
import java.util.Collection;
import java.lang.reflect.AnnotatedElement;
@@ -473,7 +473,7 @@
*/
private Field[] internalGetFields()
{
- HashSet set = new HashSet();
+ LinkedHashSet set = new LinkedHashSet();
set.addAll(Arrays.asList(getDeclaredFields(true)));
Class[] interfaces = getInterfaces();
for (int i = 0; i < interfaces.length; i++)