From 6de4875c54a43109ffaca957a0cd7f33ce74ad31 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Thu, 21 Jul 2022 18:28:48 +0200 Subject: [PATCH] Java: inspection description clarification GitOrigin-RevId: b14ee79a725c528f7f0405f1cd93cb4fc91cf326 --- .../src/inspectionDescriptions/ObviousNullCheck.html | 4 ++-- .../src/inspectionDescriptions/ReplaceNullCheck.html | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/java/java-impl/src/inspectionDescriptions/ObviousNullCheck.html b/java/java-impl/src/inspectionDescriptions/ObviousNullCheck.html index 6f3de214756a..3719755e1b51 100644 --- a/java/java-impl/src/inspectionDescriptions/ObviousNullCheck.html +++ b/java/java-impl/src/inspectionDescriptions/ObviousNullCheck.html @@ -5,11 +5,11 @@ called on a value that is obviously non-null (for example, a newly created objec a programming error.

Example:


-          final String greeting = Objects.requireNonNull("Hi!");
+  final String greeting = Objects.requireNonNull("Hi!");
 

After the quick-fix is applied:


-          final String greeting = "Hi!";
+  final String greeting = "Hi!";
 

New in 2017.2

diff --git a/java/java-impl/src/inspectionDescriptions/ReplaceNullCheck.html b/java/java-impl/src/inspectionDescriptions/ReplaceNullCheck.html index ff2c752afda9..78ec92177c20 100644 --- a/java/java-impl/src/inspectionDescriptions/ReplaceNullCheck.html +++ b/java/java-impl/src/inspectionDescriptions/ReplaceNullCheck.html @@ -1,13 +1,13 @@ -Reports null checks that can be replaced with an Objects/Stream static method. +Reports null checks that can be replaced with a call to a static method from Objects or Stream.

Example:


-if (message == null) {
-  application.messageStorage().save(new EmptyMessage());
-} else {
-  application.messageStorage().save(message);
-}
+  if (message == null) {
+    application.messageStorage().save(new EmptyMessage());
+  } else {
+    application.messageStorage().save(message);
+  }
 

After the quick-fix is applied: