Use Intrinsics.checkNotNullExpressionValue to throw NPE in Java null checks
Similarly to previous commit, this method was unused since its introduction before 1.0, so we're changing its semantics to throw NPE and starting to use it with API version >= 1.4. #KT-22275 In Progress
This commit is contained in:
@@ -88,9 +88,9 @@ public class Intrinsics {
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkNotNullExpressionValue(Object value, String message) {
|
||||
public static void checkNotNullExpressionValue(Object value, String expression) {
|
||||
if (value == null) {
|
||||
throw sanitizeStackTrace(new IllegalStateException(message));
|
||||
throw sanitizeStackTrace(new NullPointerException(expression + " must not be null"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user