mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
make method static: convert method reference to lambda (IDEA-191425)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import java.util.function.Function;
|
||||
|
||||
class Foo {
|
||||
Bar frobnitz(Function<Foo, Bar> f) {
|
||||
return f.apply(this);
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
static Bar frob(Bar anObject, Foo foo) {
|
||||
return anObject;
|
||||
}
|
||||
}
|
||||
|
||||
class Baz {
|
||||
public static void main(String[] args) {
|
||||
Bar bar = new Bar();
|
||||
new Foo().frobnitz(foo -> Bar.frob(bar, foo));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user