convert to diamonds: take care of java 8 inference, check on non-physical elements (IDEA-151559)

This commit is contained in:
Anna Kozlova
2016-02-22 15:59:38 +01:00
parent 4394119945
commit f9d49fa1f4
8 changed files with 188 additions and 108 deletions
@@ -7,6 +7,6 @@ class Foo<T> {
class Constructors {
public static void main(String[] args) {
Foo<Number> foo2 = new Foo<Number>(1);
Foo<Number> foo2 = new Foo<>(1);
}
}
@@ -0,0 +1,16 @@
// "Replace with <>" "true"
class Test {
void test() {
class Foo<X extends Number> {
Foo() {}
Foo(X x) {}
}
Foo<Number> f1 = new Foo<>(1);
Foo<?> f2 = new Foo<Number>();
Foo<?> f3 = new Foo<Integer>();
Foo<Number> f4 = new Foo<Number>(1) {};
Foo<?> f5 = new Foo<Number>() {};
Foo<?> f6 = new Foo<Integer>() {};
}
}
@@ -1,4 +1,4 @@
// "Replace with <>" "false"
// "Replace with <>" "true"
class Test {
void test() {
@@ -1,4 +1,4 @@
// "Replace with <>" "true"
// "Replace with <>" "false"
class Test {
void test() {
@@ -0,0 +1,14 @@
// "Replace with <>" "false"
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
import java.util.function.IntToLongFunction;
abstract class SimplePlanet {
void a(IntToLongFunction r, List<String> l) {}
void a(Function<Integer, Integer> f, List<Number> l) {}
{
a(a -> a, new ArrayList<Str<caret>ing>());
}
}