mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-17 20:11:25 +07:00
Cleanup: NotNull/Nullable
GitOrigin-RevId: b8e892f32ea84c2115973155dba7127b892cc36e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ce8e10e6c4
commit
39d2d77155
@@ -1,13 +0,0 @@
|
||||
class MyTest {
|
||||
|
||||
static class Foo<X> {
|
||||
<T> void test(X x) { }
|
||||
}
|
||||
static class Bar extends Foo<Integer> {
|
||||
void test(Double x) { }
|
||||
|
||||
void call() {
|
||||
test<error descr="Ambiguous method call: both 'Bar.test(Double)' and 'Foo.test(Integer)' match">(null)</error>;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ class Test {
|
||||
}
|
||||
|
||||
void fooBar(IntStream1 instr){
|
||||
Supplier<Stream<Integer>> si = () -> instr.<error descr="Ambiguous method call: both 'IntStream1.map(IntFunction<Integer>)' and 'IntStream1.map(IntUnaryOperator)' match">map</error> ((i) -> (( <error descr="Operator '%' cannot be applied to '<lambda parameter>', 'int'">i % 2</error>) == 0) ? i : <error descr="Operator '-' cannot be applied to '<lambda parameter>'">-i</error>).boxed();
|
||||
Supplier<Stream<Integer>> si = () -> instr.<error descr="Ambiguous method call: both 'IntStream1.map(IntFunction<Integer>)' and 'IntStream1.map(IntUnaryOperator)' match">map</error> ((i) -> (( <error descr="Operator '%' cannot be applied to '<lambda parameter>', 'int'">i % 2</error>) == 0) ? i : -i).boxed();
|
||||
System.out.println(si);
|
||||
Supplier<Stream<Integer>> si1 = () -> instr.map <error descr="Ambiguous method call: both 'IntStream1.map(IntFunction<Integer>)' and 'IntStream1.map(IntUnaryOperator)' match">(null)</error>.boxed();
|
||||
System.out.println(si1);
|
||||
|
||||
@@ -12,7 +12,7 @@ class MyTest<T> {
|
||||
|
||||
public static class Builder<E> {
|
||||
|
||||
public Builder<E> add(E element) {
|
||||
public Builder<E> add(E <warning descr="Parameter 'element' is never used">element</warning>) {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,6 @@ class Main {
|
||||
}
|
||||
|
||||
public static boolean checkForJdk(String <warning descr="Parameter 'homePath' is never used">homePath</warning>) {return false;}
|
||||
public static boolean checkForJdk(File homePath) {return false;}
|
||||
public static boolean checkForJdk(File <warning descr="Parameter 'homePath' is never used">homePath</warning>) {return false;}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
interface A {
|
||||
void enableInspections(B... providers);
|
||||
void enableInspections(Runnable r, String... inspections);
|
||||
}
|
||||
|
||||
interface B {
|
||||
Class[] get();
|
||||
}
|
||||
|
||||
class C {
|
||||
void foo(A a) {
|
||||
a.enableInspections(() -> new Class[]{});
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
class Main {
|
||||
|
||||
void m(B b) {
|
||||
Function<A<String>, String> f1 = A<String>::getName;
|
||||
Function<A<String>, String> f10 = A::getName;
|
||||
Function<B, String> f2 = B::getName;
|
||||
Function<B, String> f3 = b::<error descr="Cannot resolve method 'getName'">getName</error>;
|
||||
}
|
||||
}
|
||||
|
||||
interface I {
|
||||
String getName();
|
||||
|
||||
static String getName(final I i) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
class A<T> implements I {
|
||||
@Override
|
||||
public String getName() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class B implements I {
|
||||
@Override
|
||||
public String getName() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -12,17 +12,4 @@ interface Test {
|
||||
|
||||
static void of(String... lists) { }
|
||||
|
||||
}
|
||||
|
||||
interface Entry<T> { }
|
||||
interface ClassA<T> {
|
||||
static <T> void f(Iterable<T> values) {
|
||||
}
|
||||
}
|
||||
interface ClassB<T> extends ClassA<Entry<T>> {
|
||||
static <T> void f(Iterable<? extends Entry<? extends T>> values) {}
|
||||
|
||||
static void m(Iterable<Entry<String>> x) {
|
||||
f(x);
|
||||
}
|
||||
}
|
||||
@@ -14,10 +14,10 @@ abstract class Test {
|
||||
foo(x -> {
|
||||
return x += 1;
|
||||
});
|
||||
<error descr="Ambiguous method call: both 'Test.foo(A)' and 'Test.foo(B)' match">foo</error>(x -> <error descr="Incompatible types. Found: 'int', required: '<lambda parameter>'">x += 1</error>);
|
||||
<error descr="Ambiguous method call: both 'Test.foo(A)' and 'Test.foo(B)' match">foo</error>(x -> x += 1);
|
||||
foo(x -> 1);
|
||||
foo(x -> <error descr="Operator '!' cannot be applied to 'int'">!x</error>);
|
||||
<error descr="Ambiguous method call: both 'Test.foo(A)' and 'Test.foo(B)' match">foo</error>(x -> <error descr="Operator '++' cannot be applied to '<lambda parameter>'">++x</error>);
|
||||
<error descr="Ambiguous method call: both 'Test.foo(A)' and 'Test.foo(B)' match">foo</error>(x -> ++x);
|
||||
foo(x -> o instanceof String ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user