public static boolean fieldIsNonnull ( Field field , AnnotationCache annotationCache ) { Class < ? > type = field . getDeclaringClass ( ) ; if ( annotationCache . hasFieldAnnotation ( type , field . getName ( ) , NONNULL ) ) { return true ; } if ( annotationCache . hasFieldAnnotation ( type , field . getName ( ) , NULLABLE ) ) { return false ; } return annotationCache . hasClassAnnotation ( type , FINDBUGS1X_DEFAULT_ANNOTATION_NONNULL ) || annotationCache . hasClassAnnotation ( type , JSR305_DEFAULT_ANNOTATION_NONNULL ) || annotationCache . hasClassAnnotation ( type , ECLIPSE_DEFAULT_ANNOTATION_NONNULL ) ; }
Checks whether the given field is marked with an Nonnull annotation whether directly or through some default annotation mechanism .