public class Temp { private String[] strings = { "Hello", "World" }; public Temp() { System.out.println(strings); } }
When I select "Move initializer to constructor" on "strings", I get the following:
public class Temp { private String[] strings; public Temp() { strings = { "Hello", "World" }; System.out.println(strings); } }
Obviously the array initialization is now incorrect - it should be "new String[] { ...".