mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-22 23:20:57 +07:00
25 lines
383 B
Java
25 lines
383 B
Java
package extractMethod;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
class Zzz<R> {
|
|
|
|
protected void doAction(C c, boolean b) {
|
|
if (b) {
|
|
c.foo(newMethod(c));
|
|
}
|
|
else {
|
|
c.foo(newMethod(c));
|
|
}
|
|
}
|
|
|
|
@NotNull
|
|
private Runnable newMethod(C c) {
|
|
return () -> c.bar();
|
|
}
|
|
|
|
private class C {
|
|
void foo(Runnable r) {}
|
|
void bar() {}
|
|
}
|
|
} |