private Diag GetDiagnostic(MethodDeclarationSyntax syntax, ContractCategory contractCategory) { if (syntax == null) { return(null); } syntax = syntax.FindDeclaringMemberOnBaseClass(_semanticModel, _root); if (syntax.AttributeLists.ContainsNotNullAttribute()) { return(null); } return(new Diag(syntax.Identifier.GetLocation(), syntax.Identifier.Text, contractCategory)); }