mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-17 20:11:25 +07:00
method refs: process local classes (IDEA-100452)
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
public class IDEA100452 {
|
||||
public static <T> MatchOp<T> match(MatchOp.MatchKind matchKind) {
|
||||
class MatchSink extends BooleanTerminalSink<T> {
|
||||
|
||||
private MatchSink() {
|
||||
super(matchKind);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(T t) {
|
||||
}
|
||||
}
|
||||
|
||||
Supplier<BooleanTerminalSink<T>> s = MatchSink::new;
|
||||
return new MatchOp<>(1, matchKind, s);
|
||||
}
|
||||
|
||||
static abstract class BooleanTerminalSink<T> {
|
||||
public BooleanTerminalSink(MatchOp.MatchKind matchKind) {
|
||||
|
||||
}
|
||||
|
||||
public abstract void accept(T t);
|
||||
}
|
||||
static interface Supplier<T> {
|
||||
public T get();
|
||||
}
|
||||
|
||||
static class MatchOp<H> {
|
||||
public MatchOp(int i, MatchKind matchKind, Supplier<BooleanTerminalSink<H>> s) {
|
||||
//To change body of created methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
static enum MatchKind {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
public class IDEA100452 {
|
||||
public static <T> MatchOp<T> match(MatchOp.MatchKind matchKind) {
|
||||
class MatchSink extends BooleanTerminalSink<T> {
|
||||
|
||||
private MatchSink() {
|
||||
super(matchKind);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(T t) {
|
||||
}
|
||||
}
|
||||
|
||||
Supplier<BooleanTerminalSink<T>> s = () -> new Match<caret>Sink();
|
||||
return new MatchOp<>(1, matchKind, s);
|
||||
}
|
||||
|
||||
static abstract class BooleanTerminalSink<T> {
|
||||
public BooleanTerminalSink(MatchOp.MatchKind matchKind) {
|
||||
|
||||
}
|
||||
|
||||
public abstract void accept(T t);
|
||||
}
|
||||
static interface Supplier<T> {
|
||||
public T get();
|
||||
}
|
||||
|
||||
static class MatchOp<H> {
|
||||
public MatchOp(int i, MatchKind matchKind, Supplier<BooleanTerminalSink<H>> s) {
|
||||
//To change body of created methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
static enum MatchKind {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user