mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 02:09:59 +07:00
set SPACE_BEFORE_COLON_IN_FOREACH true by default, fix tests
This commit is contained in:
@@ -7,7 +7,7 @@ import java.util.stream.Collectors;
|
||||
public class Main {
|
||||
public static Map<Integer, String> test(List<String> strings) {
|
||||
Map<Integer, String> mapping = new HashMap<>();
|
||||
for (String str: strings) {
|
||||
for (String str : strings) {
|
||||
if (mapping.put(str.length(), str) != null) {
|
||||
throw new IllegalStateException("Duplicate key");
|
||||
}
|
||||
@@ -17,7 +17,7 @@ public class Main {
|
||||
|
||||
public static Map<Integer, String> testMerge(List<String> strings) {
|
||||
Map<Integer, String> map = new HashMap<>();
|
||||
for (String s: strings) {
|
||||
for (String s : strings) {
|
||||
if (!s.isEmpty()) {
|
||||
map.merge(s.length(), s, String::concat);
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public class Main {
|
||||
|
||||
public static TreeMap<Integer, String> testPut(List<String> strings) {
|
||||
TreeMap<Integer, String> map = new TreeMap<>();
|
||||
for (String s1: strings) {
|
||||
for (String s1 : strings) {
|
||||
if (!s1.isEmpty()) {
|
||||
map.put(s1.length(), s1.trim());
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public class Main {
|
||||
|
||||
public static TreeMap<Integer, String> testSupplier(List<String> strings) {
|
||||
TreeMap<Integer, String> map = new TreeMap<>();
|
||||
for (String s1: strings) {
|
||||
for (String s1 : strings) {
|
||||
if (!s1.isEmpty()) {
|
||||
map.putIfAbsent(s1.length(), s1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user