@ Override public Description matchMethod ( MethodTree methodTree , VisitorState state ) { SuggestedFix . Builder fix = null ; if ( isInjectedConstructor ( methodTree , state ) ) { for ( AnnotationTree annotationTree : methodTree . getModifiers ( ) . getAnnotations ( ) ) { if ( OPTIONAL_INJECTION_MATCHER . matches ( annotationTree , state ) ) { // Replace the annotation with "@Inject" if ( fix == null ) { fix = SuggestedFix . builder ( ) ; } fix = fix . replace ( annotationTree , "@Inject" ) ; } else if ( BINDING_ANNOTATION_MATCHER . matches ( annotationTree , state ) ) { // Remove the binding annotation if ( fix == null ) { fix = SuggestedFix . builder ( ) ; } fix = fix . delete ( annotationTree ) ; } } } if ( fix == null ) { return Description . NO_MATCH ; } else { return describeMatch ( methodTree , fix . build ( ) ) ; } }
Matches injected constructors annotated with