mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-31 04:07:30 +07:00
GitOrigin-RevId: be9df24e4c0be4f37ec59dad2e67e2af8dc92d12
31 lines
786 B
Java
31 lines
786 B
Java
import org.jetbrains.annotations.NotNull;
|
|
|
|
import java.util.*;
|
|
|
|
class AssignmentInsideLamda {
|
|
|
|
private final List<Comparator<String>> comparators = new ArrayList<>();
|
|
|
|
public void test(String[] args) {
|
|
Arrays.sort(args, newMethod());
|
|
}
|
|
|
|
private @NotNull Comparator<String> newMethod() {
|
|
return (o1, o2) -> {
|
|
int result = compareForNull(o1, o2);
|
|
if (result == 0) {
|
|
for (Comparator<String> comparator : comparators) {
|
|
result = comparator.compare(o1, o2);
|
|
if (result != 0) {
|
|
return result;
|
|
}
|
|
}
|
|
}
|
|
return result;
|
|
};
|
|
}
|
|
|
|
private int compareForNull(String o1, String o2) {
|
|
return 0;
|
|
}
|
|
} |