lambda -> method ref: forbid inside anonymous; qualify this (IDEA-126750)

This commit is contained in:
Anna Kozlova
2014-07-01 19:31:10 +02:00
parent 60c18e802f
commit b524d609c1
4 changed files with 73 additions and 4 deletions

View File

@@ -0,0 +1,18 @@
// "Replace lambda with method reference" "true"
class Example {
class Bar {
void foo() {
}
class Foo {
void bar() {
new Object() {
void baz() {
Runnable runnable = Bar.this::foo;
}
};
}
}
}
}

View File

@@ -0,0 +1,17 @@
// "Replace lambda with method reference" "false"
class Example {
{
new Object() {
void foo() {
}
void bar() {
new Object() {
void baz() {
Runnable runnable = () -> fo<caret>o();
}
};
}
};
}
}

View File

@@ -0,0 +1,18 @@
// "Replace lambda with method reference" "true"
class Example {
class Bar {
void foo() {
}
class Foo {
void bar() {
new Object() {
void baz() {
Runnable runnable = () -> fo<caret>o();
}
};
}
}
}
}