@ Override public Description matchMemberReference ( MemberReferenceTree tree , VisitorState state ) { if ( ! matchWithinClass ) { return Description . NO_MATCH ; } Symbol . MethodSymbol referencedMethod = ASTHelpers . getSymbol ( tree ) ; Symbol . MethodSymbol funcInterfaceSymbol = NullabilityUtil . getFunctionalInterfaceMethod ( tree , state . getTypes ( ) ) ; handler . onMatchMethodReference ( this , tree , state , referencedMethod ) ; return checkOverriding ( funcInterfaceSymbol , referencedMethod , tree , state ) ; }
for method references we check that the referenced method correctly overrides the corresponding functional interface method