C#


ROSLYN.DESIGN.CA1062 : Validate arguments of public methods (C#)

See Roslyn-Detected C# Warning Classes for more information.

要旨

An externally visible method dereferences one of its reference arguments without verifying whether that argument is 'null' ('Nothing' in Visual Basic). All reference arguments that are passed to externally visible methods should be checked against 'null'. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. If the method is designed to be called only by known assemblies, you should make the method internal.

この指摘はRoslynのCA1062に該当します。ルール詳細につい ては、下記リンクを参照してください。 CA1062

プロパティ

クラス名 Validate arguments of public methods (C#)
日本語クラス名 Validate arguments of public methods (C#)
クラス分類 信頼性 (reliability)
ニーモニック ROSLYN.DESIGN.CA1062
カテゴリー なし
対応言語 C# で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Validate arguments of public methods (C#)"

関連のある設定ファイルパラメータ

設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。