mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 13:39:36 +07:00
new inference: caching resolve result during getTargetType inference (IDEA-142733; IDEA-140035; IDEA-133385)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
class Test {
|
||||
|
||||
static class A {
|
||||
static class Row {
|
||||
public String get(int index) {
|
||||
return "test";
|
||||
}
|
||||
}
|
||||
|
||||
void foo(List<Row> list) {
|
||||
list.stream().collect(Collectors.toMap(a -> String.valueOf(a.ge<caret>t(0)),
|
||||
a -> String.valueOf(a.get(1))));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collector;
|
||||
|
||||
class Test {
|
||||
|
||||
void f() {
|
||||
JSONObject deviceTokenJson = new ArrayList<DeviceToken>()
|
||||
.stream()
|
||||
.collect(JSON.toObject(
|
||||
token -> Hex.encodeHexString(token.get<caret>Token()) ,
|
||||
token -> new JSONObject()
|
||||
.put("application_id", token.getAppId())
|
||||
.put("sandbox", token.isSandbox())));
|
||||
|
||||
}
|
||||
|
||||
static class JSONObject {
|
||||
public JSONObject put(String var1, Object var2) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
static class JSON {
|
||||
static <T, R> Collector<T, ?, R> toObject(Function<DeviceToken, String> f, Function<T, R> ff) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static private class Hex {
|
||||
static String encodeHexString(byte[] t) {
|
||||
return new String(t);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class DeviceToken {
|
||||
public byte[] getToken() {
|
||||
return null;
|
||||
}
|
||||
public String getAppId() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public boolean isSandbox() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user