Community
Participate
Working Groups
HEAD We could add a code style problem for an invocation of a varargs method with unnecessary "new Type[] {..}" right in the arguments list. Example: public class Try { public static void main(String[] args) { foo("x", "1", "1"); foo("x", 1); foo("x", "a", "b"); // add a problem for these two: foo("x", new String[] {"a"}); foo("x", new Object[] {"a", "b"}); } static void foo(String first, Object... o) { System.out.println(o.getClass()); } } JDT/UI can then add a quick fix to remove the unnecessary explicit array creation. The quick fix should also work in the 'new String[] {"a"}' case in the example, although there's another problem reported there.