IDEA-179370 "Constant conditions and exceptions" quickfix "Replace with 'x != null ?:'" does nothing

This commit is contained in:
Tagir Valeev
2017-09-22 16:20:55 +07:00
parent 05cc265293
commit 29e2383afd
3 changed files with 19 additions and 1 deletions
@@ -0,0 +1,9 @@
// "Replace with 'njc != null ?:'" "true"
public class JC {
class Inner {}
public static void main(String[] args) {
JC njc = Math.random() > 0.5 ? new JC() : null;
System.out.println(njc != null ? njc.new Inner() : null);
}
}
@@ -0,0 +1,9 @@
// "Replace with 'njc != null ?:'" "true"
public class JC {
class Inner {}
public static void main(String[] args) {
JC njc = Math.random() > 0.5 ? new JC() : null;
System.out.println(njc.new In<caret>ner());
}
}