tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: How to get fields list in order
Date Thu, 02 Nov 2006 14:09:33 GMT

> How can I get a list of the public fields declared in a class, *in the
> order they are declared*?  Using Reflection's getFields and
> getDeclaredFields methods returns them in no particular order, and I
> need them in the order they are declared so I can get their starting
> byte offsets.

Since you mentioned byte offsets, I have to ask: are you trying to
subvert the serialization system? Or, even worse, inspect the object
memory from with JNI?

I would guess that if you can't get the proper order of the fields from
Class.getDeclaredFields, then you can't get it at all.


View raw message