convert static method to instance method of the same class without corresponding parameter (IDEA-64834)

This commit is contained in:
Anna.Kozlova
2017-04-12 14:09:10 +02:00
parent 3f7a67cdfc
commit d9c6dfc42c
12 changed files with 228 additions and 92 deletions
@@ -0,0 +1,26 @@
class Bar {
static void f<caret>oo() {
}
void m(){
Bar.foo();
}
{
Runnable r = Bar::foo;
}
static {
Runnable r = Bar::foo;
}
}
class Bar1 {
void m() {
Bar.foo();
}
{
Runnable r = Bar::foo;
}
}
@@ -0,0 +1,26 @@
class Bar {
void foo() {
}
void m(){
foo();
}
{
Runnable r = this::foo;
}
static {
Runnable r = new Bar()::foo;
}
}
class Bar1 {
void m() {
new Bar().foo();
}
{
Runnable r = new Bar()::foo;
}
}
@@ -0,0 +1,26 @@
class Bar<T> {
static void f<caret>oo() {
}
void m(){
Bar.foo();
}
{
Runnable r = Bar::foo;
}
static {
Runnable r = Bar::foo;
}
}
class Bar1 {
void m() {
Bar.foo();
}
{
Runnable r = Bar::foo;
}
}