In Intellij, how can I get a List on the left hand side when I extract a variable that's an ArrayList?
- by tieTYT
As an example, if I extract a variable from this:
return new ArrayList<CrudTestData<Foo>>();
It will turn the code into this:
ArrayList<CrudTestData<Foo>> list = new ArrayList<CrudTestData<Foo>>();
return list;
How can I automatically get a list on the left hand side like this?
List<CrudTestData<Foo>> list = new ArrayList<CrudTestData<Foo>>();
return list;
Theoretically, Intellij should know to use a List instead of a Collection because the method returns a List.