Add inspection for check/require/checkNotNull/requireNotNull
#KT-30640 Fixed #KT-22412 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
64780293d3
commit
90b0ea73dc
+7
@@ -0,0 +1,7 @@
|
||||
// FIX: Replace with 'require()' call
|
||||
// WITH_RUNTIME
|
||||
fun test(b: Boolean) {
|
||||
<caret>if (b) {
|
||||
throw IllegalArgumentException("test")
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// FIX: Replace with 'require()' call
|
||||
// WITH_RUNTIME
|
||||
fun test(b: Boolean) {
|
||||
require(!b) { "test" }
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// FIX: Replace with 'require()' call
|
||||
// WITH_RUNTIME
|
||||
fun test(b: Boolean) {
|
||||
<caret>if (b) {
|
||||
throw java.lang.IllegalArgumentException("test")
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// FIX: Replace with 'require()' call
|
||||
// WITH_RUNTIME
|
||||
fun test(b: Boolean) {
|
||||
require(!b) { "test" }
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// FIX: Replace with 'require()' call
|
||||
// WITH_RUNTIME
|
||||
fun test(b: Boolean) {
|
||||
<caret>if (b) {
|
||||
// comment1
|
||||
throw IllegalArgumentException()
|
||||
// comment2
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// FIX: Replace with 'require()' call
|
||||
// WITH_RUNTIME
|
||||
fun test(b: Boolean) {
|
||||
// comment1
|
||||
// comment2
|
||||
require(!b)
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// FIX: Replace with 'require()' call
|
||||
// WITH_RUNTIME
|
||||
fun test(b: Boolean) {
|
||||
<caret>if (b) {
|
||||
// comment1
|
||||
throw IllegalArgumentException("test")
|
||||
// comment2
|
||||
}
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// FIX: Replace with 'require()' call
|
||||
// WITH_RUNTIME
|
||||
fun test(b: Boolean) {
|
||||
require(!b) {
|
||||
// comment1
|
||||
"test"
|
||||
// comment2
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// FIX: Replace with 'require()' call
|
||||
// WITH_RUNTIME
|
||||
fun test(foo: Boolean) {
|
||||
<caret>if (!foo) throw IllegalArgumentException("test")
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// FIX: Replace with 'require()' call
|
||||
// WITH_RUNTIME
|
||||
fun test(foo: Boolean) {
|
||||
require(foo) { "test" }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// FIX: Replace with 'require()' call
|
||||
// WITH_RUNTIME
|
||||
fun test(foo: Int) {
|
||||
<caret>if (foo != 0) throw IllegalArgumentException("test")
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// FIX: Replace with 'require()' call
|
||||
// WITH_RUNTIME
|
||||
fun test(foo: Int) {
|
||||
require(foo == 0) { "test" }
|
||||
}
|
||||
Reference in New Issue
Block a user