mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
CollectionUtils#isCollectionOrMapSize
Used in ToArrayCallWithZeroLengthArrayArgumentInspection and StreamApiMigrationInspection
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// "Replace with toArray" "true"
|
||||
import java.util.*;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
public class Main {
|
||||
public String[] test(Map<String, String> map) {
|
||||
String[] array = IntStream.range(0, map.size()).mapToObj(String::valueOf).toArray(String[]::new);
|
||||
return array;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with toArray" "true"
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
public String[] test(Map<String, String> map) {
|
||||
String[] array = new String[map.size()];
|
||||
for(int<caret> i=0; i<map.keySet().size(); i++) {
|
||||
array[i] = String.valueOf(i);
|
||||
}
|
||||
return array;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user