mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
IDEA-191690 Inline method: less restrictions on tail call
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
class A {
|
||||
void foo() {
|
||||
if(Math.random() > 2) {
|
||||
System.out.println("xyz");
|
||||
return;
|
||||
}
|
||||
System.out.println("oops");
|
||||
}
|
||||
|
||||
void bar(int x) {
|
||||
if (x > 0) {
|
||||
f<caret>oo();
|
||||
}
|
||||
System.out.println("x < 0");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
class A {
|
||||
void foo() {
|
||||
if(Math.random() > 2) {
|
||||
System.out.println("xyz");
|
||||
return;
|
||||
}
|
||||
System.out.println("oops");
|
||||
}
|
||||
|
||||
void bar(int x) {
|
||||
if (x > 0) {
|
||||
f<caret>oo();
|
||||
} else {
|
||||
System.out.println("x < 0");
|
||||
}
|
||||
}
|
||||
|
||||
void baz(int x) {
|
||||
if (x > 0)
|
||||
if (x < 10) {
|
||||
foo();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
class A {
|
||||
|
||||
void bar(int x) {
|
||||
if (x > 0) {
|
||||
if(Math.random() > 2) {
|
||||
System.out.println("xyz");
|
||||
return;
|
||||
}
|
||||
System.out.println("oops");
|
||||
} else {
|
||||
System.out.println("x < 0");
|
||||
}
|
||||
}
|
||||
|
||||
void baz(int x) {
|
||||
if (x > 0)
|
||||
if (x < 10) {
|
||||
if(Math.random() > 2) {
|
||||
System.out.println("xyz");
|
||||
return;
|
||||
}
|
||||
System.out.println("oops");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
class A {
|
||||
void foo() {
|
||||
if(Math.random() > 2) {
|
||||
System.out.println("xyz");
|
||||
return;
|
||||
}
|
||||
System.out.println("oops");
|
||||
}
|
||||
|
||||
void bar(int x) {
|
||||
Runnable r = () -> {
|
||||
System.out.println("hi");
|
||||
f<caret>oo();
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class A {
|
||||
|
||||
void bar(int x) {
|
||||
Runnable r = () -> {
|
||||
System.out.println("hi");
|
||||
if(Math.random() > 2) {
|
||||
System.out.println("xyz");
|
||||
return;
|
||||
}
|
||||
System.out.println("oops");
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user