mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-19 01:50:56 +07:00
Copied enum was created always at top-level. In fact, as we copy the whole file anyway, there's no need to do something additional with enum. Just find it in copy and return. GitOrigin-RevId: d85c21acfc879c02be0ef85eff4264faf0c99ffb
23 lines
468 B
Java
23 lines
468 B
Java
// "Replace lambda with method reference" "true-preview"
|
|
import java.util.function.Function;
|
|
|
|
public abstract class x {
|
|
|
|
public enum E {
|
|
A(Object::toString),
|
|
B(n -> { return n.toString();}),
|
|
C(Number::toString);
|
|
|
|
E(Function<Number, Object> iFunc) {}
|
|
}
|
|
|
|
public void dothis(Function<Number, Object> iFunc) { }
|
|
|
|
public void trythis() {
|
|
dothis(n -> n.toString());
|
|
}
|
|
|
|
public void trythis2() {
|
|
dothis(n -> { return n.toString(); });
|
|
}
|
|
} |