mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-17 12:01:25 +07:00
anonym -> lambda, method ref: do not suggest replacement when default method is called out of functional interface context
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// "Replace with lambda" "true"
|
||||
class Test {
|
||||
interface InOut {
|
||||
void run() throws IOException;
|
||||
default void foo(){}
|
||||
}
|
||||
|
||||
interface InOutEx extends InOut {
|
||||
InOut bind() {
|
||||
return () -> {
|
||||
foo();
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Replace with lambda" "true"
|
||||
class Test {
|
||||
interface InOut {
|
||||
void run() throws IOException;
|
||||
static void foo(){}
|
||||
}
|
||||
|
||||
InOut bind() {
|
||||
return () -> {
|
||||
InOut.foo();
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Replace with lambda" "false"
|
||||
class Test {
|
||||
interface InOut {
|
||||
void run() throws IOException;
|
||||
default void foo(){}
|
||||
}
|
||||
|
||||
InOut bind() {
|
||||
return new In<caret>Out() {
|
||||
@Override
|
||||
public void run() throws IOException {
|
||||
foo();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// "Replace with lambda" "true"
|
||||
class Test {
|
||||
interface InOut {
|
||||
void run() throws IOException;
|
||||
default void foo(){}
|
||||
}
|
||||
|
||||
interface InOutEx extends InOut {
|
||||
InOut bind() {
|
||||
return new In<caret>Out() {
|
||||
@Override
|
||||
public void run() throws IOException {
|
||||
foo();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Replace with lambda" "true"
|
||||
class Test {
|
||||
interface InOut {
|
||||
void run() throws IOException;
|
||||
static void foo(){}
|
||||
}
|
||||
|
||||
InOut bind() {
|
||||
return new In<caret>Out() {
|
||||
@Override
|
||||
public void run() throws IOException {
|
||||
foo();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user