mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-21 22:11:40 +07:00
lambda -> method ref: forbid inside anonymous; qualify this (IDEA-126750)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user