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
@@ -0,0 +1,7 @@
|
||||
public class Test {
|
||||
void test(String s) {
|
||||
if (s == null) {
|
||||
throw new IllegalArgumentException("s should not be null");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class Test {
|
||||
internal fun test(s: String?) {
|
||||
requireNotNull(s) { "s should not be null" }
|
||||
}
|
||||
}
|
||||
+5
@@ -3779,6 +3779,11 @@ public class JavaToKotlinConverterForWebDemoTestGenerated extends AbstractJavaTo
|
||||
runTest("j2k/testData/fileOrElement/postProcessing/GetOperator.java");
|
||||
}
|
||||
|
||||
@TestMetadata("GuardClause.java")
|
||||
public void testGuardClause() throws Exception {
|
||||
runTest("j2k/testData/fileOrElement/postProcessing/GuardClause.java");
|
||||
}
|
||||
|
||||
@TestMetadata("IfNullReturnToElvis.java")
|
||||
public void testIfNullReturnToElvis() throws Exception {
|
||||
runTest("j2k/testData/fileOrElement/postProcessing/IfNullReturnToElvis.java");
|
||||
|
||||
+5
@@ -3779,6 +3779,11 @@ public class JavaToKotlinConverterSingleFileTestGenerated extends AbstractJavaTo
|
||||
runTest("j2k/testData/fileOrElement/postProcessing/GetOperator.java");
|
||||
}
|
||||
|
||||
@TestMetadata("GuardClause.java")
|
||||
public void testGuardClause() throws Exception {
|
||||
runTest("j2k/testData/fileOrElement/postProcessing/GuardClause.java");
|
||||
}
|
||||
|
||||
@TestMetadata("IfNullReturnToElvis.java")
|
||||
public void testIfNullReturnToElvis() throws Exception {
|
||||
runTest("j2k/testData/fileOrElement/postProcessing/IfNullReturnToElvis.java");
|
||||
|
||||
Reference in New Issue
Block a user