mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
[java-intention] More tests for IDEA-314907
GitOrigin-RevId: 2ca51ee0d02ff7d36cd59efb8ce6b81af2372ea7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
32339d4c71
commit
31990e349d
@@ -16,8 +16,8 @@ class MainController {
|
||||
|
||||
class Wrapper<T> {
|
||||
private T data;
|
||||
public static <T> Wrapper<T> wrap(T t) {
|
||||
Wrapper<T> res = new Wrapper<>();
|
||||
public static <T1> Wrapper<T1> wrap(T1 t) {
|
||||
Wrapper<T1> res = new Wrapper<>();
|
||||
res.data = t;
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// "Create method 'list'" "true-preview"
|
||||
import java.util.*;
|
||||
|
||||
class MainService {
|
||||
public Map<String, Data> list() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class MainController {
|
||||
private final MainService service = new MainService();
|
||||
public Wrapper<Map<String, Optional<Data>>> listData() {
|
||||
return Wrapper.wrap(service.list());
|
||||
}
|
||||
}
|
||||
|
||||
class Wrapper<T> {
|
||||
private T data;
|
||||
public static native <T1, T2> Wrapper<Map<T1, Optional<T2>>> wrap(Map<T1, T2> t);
|
||||
}
|
||||
|
||||
interface Data {}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Create method 'nextFn'" "true-preview"
|
||||
import java.util.function.Function;
|
||||
|
||||
class X {
|
||||
void x() {
|
||||
Function<Double, Character> fn1 = d -> String.valueOf(d)
|
||||
.charAt(0);
|
||||
Function<Double, Integer> fn = fn1.andThen(nextFn());
|
||||
}
|
||||
|
||||
private Function<? super Character, Integer> nextFn() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Create method 'getKey'" "true-preview"
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class X {
|
||||
void x() {
|
||||
Map<Double, List<String>> map = Stream.of("x").collect(Collectors.groupingBy(getKey()));
|
||||
}
|
||||
|
||||
private Function<? super String, Double> getKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Create method 'getKey'" "true-preview"
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class X {
|
||||
void x() {
|
||||
Map<Double, List<String>> map = Stream.of("x").collect(Collectors.groupingBy(k -> getKey(k)));
|
||||
}
|
||||
|
||||
private Double getKey(String k) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,8 @@ class MainController {
|
||||
|
||||
class Wrapper<T> {
|
||||
private T data;
|
||||
public static <T> Wrapper<T> wrap(T t) {
|
||||
Wrapper<T> res = new Wrapper<>();
|
||||
public static <T1> Wrapper<T1> wrap(T1 t) {
|
||||
Wrapper<T1> res = new Wrapper<>();
|
||||
res.data = t;
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
// "Create method 'list'" "true-preview"
|
||||
import java.util.*;
|
||||
|
||||
class MainService {
|
||||
}
|
||||
|
||||
class MainController {
|
||||
private final MainService service = new MainService();
|
||||
public Wrapper<Map<String, Optional<Data>>> listData() {
|
||||
return Wrapper.wrap(service.<caret>list());
|
||||
}
|
||||
}
|
||||
|
||||
class Wrapper<T> {
|
||||
private T data;
|
||||
public static native <T1, T2> Wrapper<Map<T1, Optional<T2>>> wrap(Map<T1, T2> t);
|
||||
}
|
||||
|
||||
interface Data {}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Create method 'nextFn'" "true-preview"
|
||||
import java.util.function.Function;
|
||||
|
||||
class X {
|
||||
void x() {
|
||||
Function<Double, Character> fn1 = d -> String.valueOf(d)
|
||||
.charAt(0);
|
||||
Function<Double, Integer> fn = fn1.andThen(<caret>nextFn());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Create method 'getKey'" "true-preview"
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class X {
|
||||
void x() {
|
||||
Map<Double, List<String>> map = Stream.of("x").collect(Collectors.groupingBy(<caret>getKey()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Create method 'getKey'" "true-preview"
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class X {
|
||||
void x() {
|
||||
Map<Double, List<String>> map = Stream.of("x").collect(Collectors.groupingBy(k -> <caret>getKey(k)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user