Test for IDEA-229317 (already fixed in 58cc2013cd628)

GitOrigin-RevId: 51537605f5bbe48ec885412753924f9ad07e7113
This commit is contained in:
Tagir Valeev
2019-12-18 04:34:21 +00:00
committed by intellij-monorepo-bot
parent 4935b387da
commit 2001b7bfb3
3 changed files with 61 additions and 0 deletions
@@ -0,0 +1,26 @@
class Bar {
int method(boolean b) {
if (b) {
return methodTrue();
}
return methodFalse();
}
int methodTrue() {
return 3;
}
int methodFalse() {
return 5;
}
}
class Foo {
// IDEA-229317
void method() {
System.out.println(new Bar().<caret>method(true));
System.out.println(new Bar().method(false));
System.out.println(new Bar().method(Math.random() > 0.5));
}
}
@@ -0,0 +1,31 @@
class Bar {
int methodTrue() {
return 3;
}
int methodFalse() {
return 5;
}
}
class Foo {
// IDEA-229317
void method() {
Bar bar2 = new Bar();
System.out.println(bar2.methodTrue());
Bar bar1 = new Bar();
System.out.println(bar1.methodFalse());
int result;
Bar bar = new Bar();
if (Math.random() > 0.5) {
result = bar.methodTrue();
} else {
result = bar.methodFalse();
}
System.out.println(result);
}
}
@@ -550,6 +550,10 @@ public class InlineMethodTest extends LightRefactoringTestCase {
public void testIgnoreReturnValue() {
doTest();
}
public void testSingleReturnComplexQualifier() {
doTestAssertBadReturn();
}
@Override
protected Sdk getProjectJDK() {