mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-20 11:36:16 +07:00
Inspection to replace Collections.emptyList/Set().stream() with Stream.empty() and Collections.singleton[List](xyz).stream() with Stream.of(xyz) Arrays.<String[]>asList(stringArray).stream() is incorrectly converted to Arrays.<String[]>stream(stringArray)
10 lines
281 B
Java
10 lines
281 B
Java
// "Replace Collections.emptySet().stream() with Stream.empty()" "true"
|
|
|
|
import java.util.*;
|
|
import java.util.stream.Stream;
|
|
|
|
class CollectionEmptySetStream {
|
|
Stream<String> stream(String[] args) {
|
|
return args.length == 1 ? Stream.<String>empty() : Arrays.stream(args);
|
|
}
|
|
} |