diff --git a/java/java-analysis-api/resources/messages/JavaAnalysisBundle.properties b/java/java-analysis-api/resources/messages/JavaAnalysisBundle.properties
index 7236c9de453c..e6c791dafe49 100644
--- a/java/java-analysis-api/resources/messages/JavaAnalysisBundle.properties
+++ b/java/java-analysis-api/resources/messages/JavaAnalysisBundle.properties
@@ -321,10 +321,10 @@ inspection.requires.auto.module.message='requires' directive for an automatic mo
inspection.requires.auto.module.option=Highlight only transitive dependencies
inspection.requires.auto.module.transitive='requires transitive' directive for an automatic module
inspection.requires.auto.module=Dependencies on automatic modules
-inspection.same.return.value.display.name=Method returns the same value
-inspection.same.return.value.problem.descriptor1=Method and all its derivables always return {0}
-inspection.same.return.value.problem.descriptor2=All implementations of this method always return {0}
-inspection.same.return.value.problem.descriptor=Method always returns {0}
+inspection.same.return.value.display.name=Method always returns the same value
+inspection.same.return.value.problem.descriptor1=Method #ref() and all its overriding methods always return {0}
+inspection.same.return.value.problem.descriptor2=All implementations of method #ref() always return {0}
+inspection.same.return.value.problem.descriptor=Method #ref() always returns {0}
inspection.surround.requirenonnull.quickfix=Replace with ''Objects.requireNonNull({0})''
inspection.suspicious.array.method.call.display.name=Suspicious 'Arrays' method call
inspection.suspicious.array.method.call.problem.arrays=Array types are incompatible: arrays are always different
diff --git a/java/java-impl-inspections/src/com/intellij/codeInspection/sameReturnValue/SameReturnValueInspection.java b/java/java-impl-inspections/src/com/intellij/codeInspection/sameReturnValue/SameReturnValueInspection.java
index b2f11977509e..4e58ac71d596 100644
--- a/java/java-impl-inspections/src/com/intellij/codeInspection/sameReturnValue/SameReturnValueInspection.java
+++ b/java/java-impl-inspections/src/com/intellij/codeInspection/sameReturnValue/SameReturnValueInspection.java
@@ -1,4 +1,4 @@
-// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.codeInspection.sameReturnValue;
import com.intellij.analysis.AnalysisScope;
@@ -26,11 +26,11 @@ public class SameReturnValueInspection extends GlobalJavaBatchInspectionTool {
if (returnValue != null) {
final String message;
if (refMethod.getDerivedReferences().isEmpty()) {
- message = JavaAnalysisBundle.message("inspection.same.return.value.problem.descriptor", "" + returnValue + "");
+ message = JavaAnalysisBundle.message("inspection.same.return.value.problem.descriptor", returnValue);
} else if (refMethod.hasBody()) {
- message = JavaAnalysisBundle.message("inspection.same.return.value.problem.descriptor1", "" + returnValue + "");
+ message = JavaAnalysisBundle.message("inspection.same.return.value.problem.descriptor1", returnValue);
} else {
- message = JavaAnalysisBundle.message("inspection.same.return.value.problem.descriptor2", "" + returnValue + "");
+ message = JavaAnalysisBundle.message("inspection.same.return.value.problem.descriptor2", returnValue);
}
final UDeclaration decl = refMethod.getUastElement();
diff --git a/java/java-impl/src/inspectionDescriptions/SameReturnValue.html b/java/java-impl/src/inspectionDescriptions/SameReturnValue.html
index 5fee2f2f409c..de72c24375b8 100644
--- a/java/java-impl/src/inspectionDescriptions/SameReturnValue.html
+++ b/java/java-impl/src/inspectionDescriptions/SameReturnValue.html
@@ -1,6 +1,13 @@
Example:
+
+ class X {
+ int xxx() {
+ return 0;
+ }
+ }
+
diff --git a/java/java-tests/testData/inspection/jvm/sameReturnValue/java/expected.xml b/java/java-tests/testData/inspection/jvm/sameReturnValue/java/expected.xml
index 5b139ecd8499..72a3f27a350b 100644
--- a/java/java-tests/testData/inspection/jvm/sameReturnValue/java/expected.xml
+++ b/java/java-tests/testData/inspection/jvm/sameReturnValue/java/expected.xml
@@ -4,19 +4,19 @@