Field serialPersistentFields =
final Field serialPersistentFields =
  private void setFields(Class cl)  {    if (!isSerializable() || isExternalizable())      {	fields = NO_FIELDS;	return;      }    try      {	Field serialPersistentFields =	  cl.getDeclaredField("serialPersistentFields");	serialPersistentFields.setAccessible(true);	int modifiers = serialPersistentFields.getModifiers();	if (Modifier.isStatic(modifiers)	    && Modifier.isFinal(modifiers)	    && Modifier.isPrivate(modifiers))	  {	    fields = getSerialPersistentFields(cl);	    if (fields != null)	      {		Arrays.sort (fields);		calculateOffsets();		return;	      }	  }      }    catch (NoSuchFieldException ignore)      {      }    catch (IllegalAccessException ignore)      {      }    int num_good_fields = 0;    Field[] all_fields = cl.getDeclaredFields();    int modifiers;    // set non-serializable fields to null in all_fields    for (int i = 0; i < all_fields.length; i++)      {	modifiers = all_fields[i].getModifiers();	if (Modifier.isTransient(modifiers)	    || Modifier.isStatic(modifiers))	  all_fields[i] = null;	else	  num_good_fields++;      }    // make a copy of serializable (non-null) fields    fields = new ObjectStreamField[ num_good_fields ];    for (int from = 0, to = 0; from < all_fields.length; from++)      if (all_fields[from] != null)	{	  Field f = all_fields[from];	  fields[to] = new ObjectStreamField(f.getName(), f.getType());	  to++;	}    Arrays.sort(fields);    calculateOffsets();  }