fixed yellow code in PersistentFSImpl where VEvent was casted to subclass for the method different not-nullness

This commit is contained in:
Alexey Kudravtsev
2017-06-09 11:08:23 +03:00
parent d474438a0f
commit 3c9c050b46
4 changed files with 76 additions and 15 deletions
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>A.java</file>
<line>5</line>
<problem_class>Redundant type cast</problem_class>
<description>Casting &lt;code&gt;a&lt;/code&gt; to &lt;code&gt;AA&lt;/code&gt; is redundant</description>
</problem>
</problems>
@@ -0,0 +1,32 @@
import org.jetbrains.annotations.*;
class A {
static String doit(A a) {
String d = ((AA)a).danuna();
String notNull = ((AA)a).doadd();
return notNull + d;
}
@Nullable
String doadd() {
return null;
}
@NotNull
String danuna() {
return "";
}
}
class AA extends A {
@NotNull
String doadd() {
return "";
}
@Override
@NotNull
String danuna() {
return "";
}
}