mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
convert to diamonds: take care of java 8 inference, check on non-physical elements (IDEA-151559)
This commit is contained in:
+1
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -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
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with <>" "false"
|
||||
// "Replace with <>" "true"
|
||||
class Test {
|
||||
|
||||
void test() {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with <>" "true"
|
||||
// "Replace with <>" "false"
|
||||
class Test {
|
||||
|
||||
void test() {
|
||||
|
||||
+14
@@ -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>());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user