set SPACE_BEFORE_COLON_IN_FOREACH true by default, fix tests

This commit is contained in:
Roman.Ivanov
2018-06-25 15:57:08 +07:00
parent c59f936afc
commit 5076e08145
110 changed files with 304 additions and 304 deletions

View File

@@ -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);
}