Browse Source

Prefer List over ArrayList type

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
master
Pekka Helenius 4 years ago
parent
commit
4558b9a8c5
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      exercises/chapter_2/chapter2_task3_friendlist/src/main/java/com/fjordtek/chapter2_task3_friendlist/web/FriendController.java

+ 2
- 1
exercises/chapter_2/chapter2_task3_friendlist/src/main/java/com/fjordtek/chapter2_task3_friendlist/web/FriendController.java View File

@ -11,6 +11,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.ResponseStatus;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid; import javax.validation.Valid;
@ -25,7 +26,7 @@ public class FriendController {
private HttpServerLogger httpServerLogger = new HttpServerLogger(); private HttpServerLogger httpServerLogger = new HttpServerLogger();
private HttpExceptionHandler httpExceptionHandler = new HttpExceptionHandler(); private HttpExceptionHandler httpExceptionHandler = new HttpExceptionHandler();
private ArrayList<Friend> friendList = new ArrayList<>();
private List<Friend> friendList = new ArrayList<>();
// NOTE NOTE // NOTE NOTE
// We could alternatively use two attributes (firstName & lastName) for names. // We could alternatively use two attributes (firstName & lastName) for names.


Loading…
Cancel
Save