Inline inner: check when possible to inline this ref only (IDEA-39274)

This commit is contained in:
anna
2010-01-29 17:07:23 +03:00
parent 22353e8a58
commit de02933e05
14 changed files with 220 additions and 18 deletions
@@ -0,0 +1,7 @@
public class Simple {}
class Usage {
void foo() {
String s = new Si<caret>mple().toString();
}
}
@@ -0,0 +1,11 @@
public class Simple implements Runnable {
public void run(){}
}
class Usage {
void foo() {
bar(new Si<caret>mple());
}
void bar(Runnable r){}
}
@@ -0,0 +1,11 @@
public class Simple<T> implements Comparable<T> {
public int compareTo(T o){}
}
class Usage {
void foo() {
bar(new Si<caret>mple<String>());
}
void bar(Comparable<String>... r){}
}
@@ -0,0 +1,11 @@
public class Simple<T> implements Comparable<T> {
public int compareTo(T o){}
}
class Usage<S> {
void foo() {
bar(new Si<caret>mple<S>());
}
void bar(Comparable<S>... r){}
}
@@ -0,0 +1,9 @@
public class Simple {}
class Usage {
void foo() {
synchronized (new Si<caret>mple()) {
//dosmth
}
}
}
@@ -0,0 +1,11 @@
public class Simple implements Runnable {
public void run(){}
}
class Usage {
void foo() {
bar(new Si<caret>mple());
}
void bar(Runnable... r){}
}
@@ -0,0 +1,7 @@
public class Simple {}
class Usage {
void foo() {
Simple s = new Si<caret>mple();
}
}
@@ -0,0 +1,11 @@
public class Simple implements Runnable {
public void run(){}
}
class Usage {
void foo() {
bar(new Si<caret>mple());
}
void bar(Simple s){}
}
@@ -0,0 +1,7 @@
public class Simple {}
class Usage {
Simple foo() {
return new Si<caret>mple();
}
}
@@ -0,0 +1,9 @@
import java.lang.Exception;
public class Simple extends Exception{}
class Usage {
void foo() throws Simple {
throw new Si<caret>mple();
}
}