Add "Redundant 'requireNotNull' or 'checkNotNull' call" inspection
#KT-29113 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
c234683770
commit
fa1f3871c0
@@ -3248,6 +3248,15 @@
|
||||
language="kotlin"
|
||||
/>
|
||||
|
||||
<localInspection implementationClass="org.jetbrains.kotlin.idea.inspections.RedundantRequireNotNullCallInspection"
|
||||
displayName="Redundant 'requireNotNull' or 'checkNotNull' call"
|
||||
groupPath="Kotlin"
|
||||
groupName="Redundant constructs"
|
||||
enabledByDefault="true"
|
||||
level="WEAK WARNING"
|
||||
language="kotlin"
|
||||
/>
|
||||
|
||||
<referenceImporter implementation="org.jetbrains.kotlin.idea.quickfix.KotlinReferenceImporter"/>
|
||||
|
||||
<fileType.fileViewProviderFactory filetype="KJSM" implementationClass="com.intellij.psi.ClassFileViewProviderFactory"/>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<html>
|
||||
<body>This inspection reports redundant <b>requireNotNull</b> or <b>checkNotNull</b> call:
|
||||
|
||||
<pre>
|
||||
fun foo(i: Int) {
|
||||
requireNotNull(i) // This 'i' is always not null, so this 'requireNotNull' call is redundant.
|
||||
}
|
||||
</pre>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user