mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
|
||||
abstract class Test {
|
||||
|
||||
{
|
||||
Consumer<? extends Double> bar = bar(instanceOf(Integer.class), i -> i + 2);
|
||||
Consumer<? extends String> bar1 = bar(instanceOf(Integer.class), i -> i + 2);
|
||||
}
|
||||
|
||||
|
||||
abstract <T, R> Consumer<T> bar(Predicate<? super T> predicate, Function<T, R> f);
|
||||
abstract <P> Predicate<P> instanceOf(Class<? extends P> type);
|
||||
}
|
||||
+1
-1
@@ -14,7 +14,7 @@ class Test {
|
||||
|
||||
class Test2 {
|
||||
|
||||
static void m(Integer i) { }
|
||||
static void m(Integer <warning descr="Parameter 'i' is never used">i</warning>) { }
|
||||
|
||||
interface I1 {
|
||||
void m(int x);
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ abstract class AbstractCollection<E> implements Collection<E> {
|
||||
public boolean add(E e) {
|
||||
return true;
|
||||
}
|
||||
public boolean addAll(Collection<? extends E> c) {
|
||||
public boolean addAll(Collection<? extends E> <warning descr="Parameter 'c' is never used">c</warning>) {
|
||||
boolean modified = false;
|
||||
return modified;
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,11 +6,11 @@ class Test {
|
||||
Test m(List<Integer> l1, List<Integer> l2);
|
||||
}
|
||||
|
||||
static Test meth(List<Integer>... lli) {
|
||||
static Test meth(List<Integer>... <warning descr="Parameter 'lli' is never used">lli</warning>) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Test(List<Integer>... lli) {}
|
||||
Test(List<Integer>... <warning descr="Parameter 'lli' is never used">lli</warning>) {}
|
||||
|
||||
{
|
||||
I <warning descr="Variable 'i1' is never used">i1</warning> = <warning descr="Unchecked generics array creation for varargs parameter">Test::meth</warning>;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class A {
|
||||
private void test5(Integer i, String... strings) {}
|
||||
private void test5(Integer <warning descr="Parameter 'i' is never used">i</warning>, String... <warning descr="Parameter 'strings' is never used">strings</warning>) {}
|
||||
private void <warning descr="Private method 'test5(java.lang.Integer, java.lang.Integer, java.lang.String...)' is never used">test5</warning>(Integer i, Integer b, String... strings) {
|
||||
System.out.println(i);
|
||||
System.out.println(b);
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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;}
|
||||
|
||||
}
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// "Replace with lambda" "true"
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static java.util.Collections.emptyList;
|
||||
|
||||
class Ambiguous {
|
||||
public void setRoots(List<String> roots) {}
|
||||
|
||||
public static <T> List<T> concat(Iterable<? extends Collection<T>> list) {
|
||||
return new ArrayList<T>();
|
||||
}
|
||||
|
||||
public static <T> List<T> concat(List<List<? extends T>> lists) {
|
||||
return new ArrayList<T>();
|
||||
}
|
||||
|
||||
public static <T,V> List<V> map(Collection<? extends T> iterable, Function<T, V> mapping) {
|
||||
return emptyList();
|
||||
}
|
||||
|
||||
public void anonymousToLambda(HashSet<String> modules) {
|
||||
setRoots(Ambiguous.concat(Ambiguous.map(modules, (Function<String, List<String>>) s -> null)
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// "Replace with lambda" "true"
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static java.util.Collections.emptyList;
|
||||
|
||||
class Ambiguous {
|
||||
public void setRoots(List<String> roots) {}
|
||||
|
||||
public static <T> List<T> concat(Iterable<? extends Collection<T>> list) {
|
||||
return new ArrayList<T>();
|
||||
}
|
||||
|
||||
public static <T> List<T> concat(List<List<? extends T>> lists) {
|
||||
return new ArrayList<T>();
|
||||
}
|
||||
|
||||
public static <T,V> List<V> map(Collection<? extends T> iterable, Function<T, V> mapping) {
|
||||
return emptyList();
|
||||
}
|
||||
|
||||
public void anonymousToLambda(HashSet<String> modules) {
|
||||
setRoots(Ambiguous.concat(Ambiguous.map(modules, (Function<String, List<String>>) s -> Arrays.asList(""))
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with lambda" "false"
|
||||
// "Replace with lambda" "true"
|
||||
class A {
|
||||
{
|
||||
bar(new Throwabl<caret>eComputable<String, Exception>() {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with lambda" "false"
|
||||
// "Replace with lambda" "true"
|
||||
import java.util.*;
|
||||
class Test2 {
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with lambda" "false"
|
||||
// "Replace with lambda" "true"
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with lambda" "false"
|
||||
// "Replace with lambda" "true"
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
Reference in New Issue
Block a user