diff --git a/java/java-analysis-impl/resources/messages/InspectionGadgetsBundle.properties b/java/java-analysis-impl/resources/messages/InspectionGadgetsBundle.properties
index 799da6e3e97a..01034e42509b 100644
--- a/java/java-analysis-impl/resources/messages/InspectionGadgetsBundle.properties
+++ b/java/java-analysis-impl/resources/messages/InspectionGadgetsBundle.properties
@@ -2269,8 +2269,8 @@ inspection.if.statement.missing.break.in.loop.description=Loop can be terminated
inspection.if.statement.missing.break.in.loop.quickfix=Add 'break'
inspection.case.mismatch.display.name=Mismatched case in 'String' operation
-inspection.case.mismatch.message.arg.is.lower=Method ''{0}()'' always returns {1}: the argument contains a lowercase symbol while the qualifier is uppercase-only
-inspection.case.mismatch.message.arg.is.upper=Method ''{0}()'' always returns {1}: the argument contains an uppercase symbol while the qualifier is lowercase-only
+inspection.case.mismatch.message.arg.is.lower=Method ''{0}()'' always returns {1}: the argument contains a lowercase symbol while the qualifier doesn''t contain lowercase symbols
+inspection.case.mismatch.message.arg.is.upper=Method ''{0}()'' always returns {1}: the argument contains an uppercase symbol while the qualifier doesn''t contain uppercase symbols
inspection.case.mismatch.message.label.is.lower=Switch branch is unreachable: the label contains a lowercase symbol while the selector is uppercase-only
inspection.case.mismatch.message.label.is.upper=Switch branch is unreachable: the label contains an uppercase symbol while the selector is lowercase-only
diff --git a/java/java-tests/testData/ig/com/siyeh/igtest/bugs/case_mismatch/MismatchedStringCase.java b/java/java-tests/testData/ig/com/siyeh/igtest/bugs/case_mismatch/MismatchedStringCase.java
index 47426e8b48f3..fe0f48d1a70e 100644
--- a/java/java-tests/testData/ig/com/siyeh/igtest/bugs/case_mismatch/MismatchedStringCase.java
+++ b/java/java-tests/testData/ig/com/siyeh/igtest/bugs/case_mismatch/MismatchedStringCase.java
@@ -1,28 +1,33 @@
import java.util.Locale;
class X {
+ void testEmpty() {
+ String prevFile = "";
+ if (prevFile.endsWith("-cfs")) {}
+ }
+
void test(String s1, String s2) {
- if(s1.toLowerCase().startsWith("FOO")) {}
- if(s1.toLowerCase().startsWith("FOO", 1)) {}
- if(s1.toLowerCase().equals("FOO")) {}
+ if(s1.toLowerCase().startsWith("FOO")) {}
+ if(s1.toLowerCase().startsWith("FOO", 1)) {}
+ if(s1.toLowerCase().equals("FOO")) {}
if(s1.toLowerCase().equalsIgnoreCase("FOO")) {} // ok
- if(s1.toLowerCase().endsWith("FOO")) {}
- if(s1.toLowerCase().contains("FOO")) {}
- if(s1.toLowerCase().indexOf("FOO") == -1) {}
- if(s1.toUpperCase(Locale.ENGLISH).startsWith("AAAAAAaAAA")) {}
+ if(s1.toLowerCase().endsWith("FOO")) {}
+ if(s1.toLowerCase().contains("FOO")) {}
+ if(s1.toLowerCase().indexOf("FOO") == -1) {}
+ if(s1.toUpperCase(Locale.ENGLISH).startsWith("AAAAAAaAAA")) {}
String s3 = s1.toLowerCase();
if(s3.equals("")) {}
- if(s3.equals("X")) {}
- if(s3.equals("Hello " + s2)) {}
+ if(s3.equals("X")) {}
+ if(s3.equals("Hello " + s2)) {}
if(s3.equals(s2.toUpperCase())) {} // strange but possible if both contain no letters
if(s3.equals(s2.toUpperCase()+"!")) {} // also possible
- if(s3.equals(s2.toUpperCase()+"!"+"X")) {}
+ if(s3.equals(s2.toUpperCase()+"!"+"X")) {}
}
void reassignParameter(String s) {
s = s.toLowerCase();
- if (s.equals("Yes")) {
+ if (s.equals("Yes")) {
}
}