question: FieldReflector ( ObjectStreamField [ ] fields ) { this . fields = fields ; int nfields = fields . length ; readKeys = new long [ nfields ] ; writeKeys = new long [ nfields ] ; offsets = new int [ nfields ] ; typeCodes = new char [ nfields ] ; ArrayList < Class < ? > > typeList = new ArrayList < > ( ) ; Set < Long > usedKeys = new HashSet < > ( ) ; for ( int i = 0 ; i < nfields ; i ++ ) { ObjectStreamField f = fields [ i ] ; Field rf = f . getField ( ) ; long key = ( rf != null ) ? unsafe . objectFieldOffset ( rf ) : Unsafe . INVALID_FIELD_OFFSET ; readKeys [ i ] = key ; writeKeys [ i ] = usedKeys . add ( key ) ? key : Unsafe . INVALID_FIELD_OFFSET ; offsets [ i ] = f . getOffset ( ) ; typeCodes [ i ] = f . getTypeCode ( ) ; if ( ! f . isPrimitive ( ) ) { typeList . add ( ( rf != null ) ? rf . getType ( ) : null ) ; } } types = typeList . toArray ( new Class < ? > [ typeList . size ( ) ] ) ; numPrimFields = nfields - types . length ; }
target:  Constructs FieldReflector capable of setting/getting values from the subset of fields whose ObjectStreamFields contain non-null reflective Field objects.  ObjectStreamFields with null Fields are treated as filler, for which get operations return default values and set operations discard given values.