public FieldMember findInstanceField ( String name ) { FieldMember found = getLatestTypeDescriptor ( ) . getField ( name ) ; if ( found != null ) { return found ; } // Walk up the supertypes - this is looking for instance fields so no need to search interfaces String slashedSupername = getTypeDescriptor ( ) . getSupertypeName ( ) ; ReloadableType rtype = typeRegistry . getReloadableType ( slashedSupername ) ; while ( rtype != null ) { found = rtype . getLatestTypeDescriptor ( ) . getField ( name ) ; if ( found != null ) { break ; } slashedSupername = rtype . getTypeDescriptor ( ) . getSupertypeName ( ) ; rtype = typeRegistry . getReloadableType ( slashedSupername ) ; } return found ; }
Find the named instance field either on this reloadable type or on a reloadable supertype - it will not go into the non - reloadable types . This method also avoids interfaces because it is looking for instance fields . This is slightly naughty but if we assume the code we are reloading is valid code it should never be referring to interface fields .