InspectionsBundle.properties: can be replaced with != null -> with a null check

Review ID: IDEA-CR-27166
This commit is contained in:
Tagir Valeev
2017-11-23 09:54:38 +07:00
parent f81add674c
commit ac325e193b
5 changed files with 9 additions and 9 deletions
@@ -2,14 +2,14 @@ class SomeClientClass {
{
new Abstract<String>() {
void foo() {
if (<warning descr="Condition 'field instanceof String' is redundant and can be replaced with '!= null'">field instanceof String</warning>) {
if (<warning descr="Condition 'field instanceof String' is redundant and can be replaced with a null check">field instanceof String</warning>) {
}
}
};
new Abstract<Integer>() {
void foo() {
if (<warning descr="Condition 'field instanceof Integer' is redundant and can be replaced with '!= null'">field instanceof Integer</warning>) {
if (<warning descr="Condition 'field instanceof Integer' is redundant and can be replaced with a null check">field instanceof Integer</warning>) {
}
}
@@ -8,7 +8,7 @@ class Test {
void test() {
String x = (String)getXyz();
if(<warning descr="Condition 'x instanceof String' is redundant and can be replaced with '!= null'">x instanceof String</warning>) {
if(<warning descr="Condition 'x instanceof String' is redundant and can be replaced with a null check">x instanceof String</warning>) {
System.out.println("yes!");
}
}
@@ -16,7 +16,7 @@ class Test {
void testUnknown() {
while(getXyz() != null) {
String x = (String)getXyz();
if(<warning descr="Condition 'x instanceof String' is redundant and can be replaced with '!= null'">x instanceof String</warning>) {
if(<warning descr="Condition 'x instanceof String' is redundant and can be replaced with a null check">x instanceof String</warning>) {
System.out.println("yes!");
}
}
@@ -49,16 +49,16 @@ class CovariantReturn {
}
boolean testType(Base base) {
return base instanceof Derived && <warning descr="Condition 'base.baz() instanceof String' is redundant and can be replaced with '!= null'">base.baz() instanceof String</warning>;
return base instanceof Derived && <warning descr="Condition 'base.baz() instanceof String' is redundant and can be replaced with a null check">base.baz() instanceof String</warning>;
}
boolean testType2(Base base) {
return base instanceof Derived && base instanceof Derived2 &&
<warning descr="Condition 'base.baz() instanceof String' is redundant and can be replaced with '!= null'">base.baz() instanceof String</warning>;
<warning descr="Condition 'base.baz() instanceof String' is redundant and can be replaced with a null check">base.baz() instanceof String</warning>;
}
boolean testTypeGeneric(BaseGeneric<?> base) {
return base instanceof DerivedGenericImpl && <warning descr="Condition 'base.get(null) instanceof Integer' is redundant and can be replaced with '!= null'">base.get(null) instanceof Integer</warning>;
return base instanceof DerivedGenericImpl && <warning descr="Condition 'base.get(null) instanceof Integer' is redundant and can be replaced with a null check">base.get(null) instanceof Integer</warning>;
}
interface Super {
@@ -87,7 +87,7 @@ public class StreamInlining {
}
void test(Stream<String> stream, Optional<String> opt) {
stream.filter(<warning descr="Condition 'String.class::isInstance' is redundant and can be replaced with '!= null'">String.class::isInstance</warning>).forEach(System.out::println);
stream.filter(<warning descr="Condition 'String.class::isInstance' is redundant and can be replaced with a null check">String.class::isInstance</warning>).forEach(System.out::println);
opt.filter(<warning descr="Method reference result is always 'true'">String.class::isInstance</warning>).ifPresent(System.out::println);
}
@@ -63,7 +63,7 @@ dataflow.message.npe.field.access.sure=Dereference of <code>#ref</code> #loc wil
dataflow.message.npe.field.access=Dereference of <code>#ref</code> #loc may produce <code>java.lang.NullPointerException</code>
dataflow.message.cce=Casting <code>{0}</code> to <code>#ref</code> #loc may produce <code>java.lang.ClassCastException</code>
dataflow.message.arraystore=Storing element of type <code>{0}</code> to array of <code>{1}</code> elements may produce <code>java.lang.ArrayStoreException</code>
dataflow.message.redundant.instanceof=Condition <code>#ref</code> #loc is redundant and can be replaced with <code>!= null</code>
dataflow.message.redundant.instanceof=Condition <code>#ref</code> #loc is redundant and can be replaced with a null check
dataflow.message.contract.fail=The call to '#ref' always fails, according to its method contracts
dataflow.message.contract.fail.index=The call to '#ref' always fails as index is out of bounds
dataflow.message.constant.condition=Condition <code>#ref</code> #loc is always <code>{0}</code>