EditorConfig documentation test

GitOrigin-RevId: fd52ace3d7a32ecd02c2c5ab90e077967604c15e
This commit is contained in:
Rustam Vishnyakov
2019-06-08 15:31:49 +03:00
committed by intellij-monorepo-bot
parent e6e3eaa09d
commit 123242c4b2
11726 changed files with 314331 additions and 158049 deletions

View File

@@ -0,0 +1,17 @@
// "Replace Stream API chain with loop" "true"
import java.util.StringJoiner;
import java.util.stream.*;
public class Test {
private static final String ARRAY_ELEMENT_SEPARATOR = ", ", ARRAY_START = "[", ARRAY_END = "]";
public static String nullSafeToString(byte[] array) {
StringJoiner joiner = new StringJoiner(ARRAY_ELEMENT_SEPARATOR, ARRAY_START, ARRAY_END);
for (int i = 0; i < array.length; i++) {
String s = String.valueOf(array[i]);
joiner.add(s);
}
return joiner.toString();
}
}

View File

@@ -43,4 +43,14 @@ public class Main {
interface Visitor { }
}
class X implements Iterable<String> {
class Y {
void test() {
for (String s : X.this) {
System.out.println(s);
}
}
}
}
}

View File

@@ -31,4 +31,15 @@ public class Main {
}
}
class X implements Map<String, String> {
class Y {
void test() {
for (Entry<String, String> entry : X.this.entrySet()) {
String k = entry.getKey();
String v = entry.getValue();
System.out.println(k + "-" + v);
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
// "Replace Stream API chain with loop" "true"
import java.util.stream.*;
public class Test {
private static final String ARRAY_ELEMENT_SEPARATOR = ", ", ARRAY_START = "[", ARRAY_END = "]";
public static String nullSafeToString(byte[] array) {
return IntStream.range(0, array.length).mapToObj(i -> String.valueOf(array[i]))
.collec<caret>t(Collectors.joining(ARRAY_ELEMENT_SEPARATOR, ARRAY_START, ARRAY_END));
}
}

View File

@@ -33,4 +33,12 @@ public class Main {
interface Visitor { }
}
class X implements Iterable<String> {
class Y {
void test() {
forEach(System.out::println);
}
}
}
}

View File

@@ -21,4 +21,11 @@ public class Main {
map.forEach(otherMap::putIfAbsent);
}
class X implements Map<String, String> {
class Y {
void test() {
forEach((k, v) -> System.out.println(k + "-" + v));
}
}
}
}