mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
guava type migration: convert anonymous Function-s with runtime retention policy annotations to anonymous classes except @javax.annotations.Nullable (can be configured in settings)
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.FluentIterable;
|
||||
import javax.annotations.Nullable;
|
||||
import static com.google.common.collect.FluentIterable.from
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
class A {
|
||||
|
||||
void m(List<String> l) {
|
||||
Function<String, String> function = new Function<String, String>() {
|
||||
@Nullable
|
||||
@Override
|
||||
public String apply(@Nullable String x) {
|
||||
return x;
|
||||
}
|
||||
};
|
||||
|
||||
boolean strings = FluentIterable.from(l).transform(new Function<String, String>() {
|
||||
@Nullable
|
||||
@Override
|
||||
public String apply(@Nullable String x) {
|
||||
return x;
|
||||
}
|
||||
}).first().isPresent();
|
||||
}
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.FluentIterable;
|
||||
import javax.annotations.Nullable;
|
||||
import static com.google.common.collect.FluentIterable.from
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
class A {
|
||||
|
||||
void m(List<String> l) {
|
||||
Function<String, String> function = new Function<String, String>() {
|
||||
@Nullable
|
||||
@Override
|
||||
public String apply(@Nullable String x) {
|
||||
return x;
|
||||
}
|
||||
};
|
||||
|
||||
boolean strings = FluentIterable.from(l).transform(new Function<String, String>() {
|
||||
@Nullable
|
||||
@Override
|
||||
public String apply(@Nullable String x) {
|
||||
return x;
|
||||
}
|
||||
}).first().isPresent();
|
||||
}
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
class A {
|
||||
|
||||
void m(List<String> l) {
|
||||
Function<String, String> function = x -> x;
|
||||
|
||||
boolean strings = l.stream().map(x -> x).findFirst().isPresent();
|
||||
}
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
class A {
|
||||
|
||||
void m(List<String> l) {
|
||||
Function<String, String> function = x -> x;
|
||||
|
||||
boolean strings = l.stream().map(x -> x).findFirst().isPresent();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user