private boolean isNullified ( Object target , Field field ) { Class < ? > type = field . getType ( ) ; Object value = null ; try { value = field . get ( target ) ; } catch ( IllegalArgumentException | IllegalAccessException e ) { throw new IrohException ( e ) ; } if ( nulls . containsKey ( type ) ) { /** * Very purposefully compare the locations rather than their values, * since we totally cheated with Objenesis obtaining instances of * these local nulls. All hell would likely break loose if we tried * to use the methods defined in the actual objects... */ if ( nulls . get ( type ) == value ) { return true ; } } return false ; }
Checks whether or not the field value object s reference points to one of our local null object references . If so this indicates that the field was nullified during eager injection and is now eligible for lazy injection .