This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: Class.internalGetFields


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++)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]