@SuppressWarnings()アノテーションパラメータリスト



Suppresswarnings Annotation Parameter List



@SuppressWarnings()の機能は、注釈付きスコープ内の警告をサイレントに保つようにコンパイラーに指示することです。

すべて:@SuppressWarnings( 'all')



省略形:@SuppressWarnings(value = {“ deprecation”})、@ SuppressWarnings(“ deprecation”)と省略できます。

複数:@SuppressWarnings({'unchecked'、 'fallthrough'})



実際、もっとたくさんあります。公式のものが見つかりません。以下のものは、基本的に日常の開発をカバーできるソースコードリファレンスから見つかります。

@SuppressWarnings('unchecked')//A warning when an unchecked conversion is performed, for example, when a collection is used, Generics is not used to specify the type of the collection. @SuppressWarnings('unused') //Unused variables @SuppressWarnings('resource') //There are generics and unspecified types @SuppressWarnings('path') //Warning when there is a path that does not exist in the class path, source file path, etc. @SuppressWarnings('deprecation') //Warning when deprecated classes or methods are used @SuppressWarnings('fallthrough') //Warning when the Switch block leads directly to the next situation without break @SuppressWarnings('serial')//Warning when a certain class implements Serializable but does not define serialVersionUID @SuppressWarnings('rawtypes') //No parameters with generics are passed @SuppressWarnings('finally') //A warning when any finally clause cannot be completed normally. @SuppressWarnings('try') // Warning when there is no catch @SuppressWarnings('all') //All types of warnings // The following are seen in source code references, but are rarely used in practice @SuppressWarnings('FragmentNotInstantiable') @SuppressWarnings('ReferenceEquality') @SuppressWarnings('WeakerAccess') @SuppressWarnings('UnusedParameters') @SuppressWarnings('NullableProblems') @SuppressWarnings('SameParameterValue') @SuppressWarnings('PointlessBitwiseExpression')