constructor reference: don't ignore constructor parameters during method reference inference (IDEA-185578)

GitOrigin-RevId: e836468e05db28157713e9edd3c70382f8ecdebc
This commit is contained in:
Anna Kozlova
2019-06-12 12:40:39 +02:00
committed by intellij-monorepo-bot
parent 89bb3c6fda
commit 91f7445298
12737 changed files with 488037 additions and 160329 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();
}
}