mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
introduce param object: pass substitution around which won't be available after method signature is changed (IDEA-154208)
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
import java.util.List;
|
||||
|
||||
public class Param<T> {
|
||||
private final List<T> y;
|
||||
|
||||
public Param(List<T> y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public List<T> getY() {
|
||||
return y;
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import java.util.List;
|
||||
|
||||
public class Test {
|
||||
public static <T> String foo(Param<T> param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
void bar(List<Integer> list) {
|
||||
System.out.println(foo(new Param<>(list)));
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class Test {
|
||||
public static <T> String foo(List<T> y) {
|
||||
return null;
|
||||
}
|
||||
|
||||
void bar(List<Integer> list) {
|
||||
System.out.println(foo(list));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user