This code:
public static void f(String[] args) {} public static void f(Integer[] args) {} public static void main(String[] args) { f(Stream.of("xxx").toArray(i -> new String[i])); } compiles success with jdk8u45 but jdk8u60 prints the following error:
Error:(17, 9) java: reference to f is ambiguous both method f(java.lang.String[]) in type_infer.Test and method f(java.lang.Integer[]) in type_infer.Test match Does it follow the JSL, Why compiler can not resolve overloaded methods? Was it a fixed bug in jdk8u45?
i -> new String[i]withString[]::newfixes the problem in javac 1.9.0-ea-b72.i -> new String[i]toString[]::newfixes the problem and so does(int i) -> new String[i]so at least there is a recognizable pattern…