Community
Participate
Working Groups
/** * Whatever you do, eclipse doesn't like it. */ public class Test { /** * Passing a String vararg to a method needing an Object array makes eclipse * either ask for a cast or complain that it is unnecessary. You cannot do it * right. * * @param s */ public static void q(String... s) { System.out.printf("",s); // reports: Varargs argument String[] should be cast // to Object[] when passed to the method // printf(String, Object...) from type PrintStream System.out.printf("",(Object[])s); // reports: Unnecessary cast from String[] // to Object[] } }
Tuned diagnosis for unnecessary cast to be more resilient with varargs method invocation. Added VarargsTest#test029. Fixed
Verified in I20050510-0010