mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
method refs: search for potentially applicable members in supers (IDEA-121737)
This commit is contained in:
+39
@@ -0,0 +1,39 @@
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
interface Base {
|
||||
int getInt(String a);
|
||||
int getInt();
|
||||
|
||||
void foo();
|
||||
}
|
||||
|
||||
abstract class ABase implements Base {
|
||||
@Override
|
||||
public int getInt(String a) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
class Impl extends ABase {
|
||||
@Override
|
||||
public int getInt() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void foo() {
|
||||
List<String> strs = Arrays.asList("one", "two");
|
||||
|
||||
List<Integer> withMethodRef = strs
|
||||
.stream()
|
||||
.map(this::getInt)
|
||||
.collect( Collectors.toList());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user