FieldInfo[] fields = classInfo.getFields();
if (fields != null) {
Arrays.sort(
fields, new Comparator() {
public int compare(Object o1, Object o2) {
FieldInfo field1 = (FieldInfo) o1;
FieldInfo field2 = (FieldInfo) o2;
return field1.getName().compareTo(field2.getName());
}
}
);
for (int i = 0; i < fields.length; i++) {
FieldInfo field = fields[i];
int mods = field.getModifiers();
if (((mods & Constants.ACC_PRIVATE) == 0) ||
((mods & (Constants.ACC_STATIC |
Constants.ACC_TRANSIENT)) == 0)) {
out.writeUTF(field.getName());
out.writeInt(mods & filterSynthetic());
out.writeUTF(field.getSignature());
}
}
}
// handle static initialization.