From 4558b9a8c5508c4d4f055c9f526325d0133033cd Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Sat, 12 Sep 2020 02:55:44 +0300 Subject: [PATCH] Prefer List over ArrayList type Signed-off-by: Pekka Helenius --- .../chapter2_task3_friendlist/web/FriendController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/chapter_2/chapter2_task3_friendlist/src/main/java/com/fjordtek/chapter2_task3_friendlist/web/FriendController.java b/exercises/chapter_2/chapter2_task3_friendlist/src/main/java/com/fjordtek/chapter2_task3_friendlist/web/FriendController.java index 3295bf2..85d8c2b 100644 --- a/exercises/chapter_2/chapter2_task3_friendlist/src/main/java/com/fjordtek/chapter2_task3_friendlist/web/FriendController.java +++ b/exercises/chapter_2/chapter2_task3_friendlist/src/main/java/com/fjordtek/chapter2_task3_friendlist/web/FriendController.java @@ -11,6 +11,7 @@ import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; import java.util.ArrayList; +import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; @@ -25,7 +26,7 @@ public class FriendController { private HttpServerLogger httpServerLogger = new HttpServerLogger(); private HttpExceptionHandler httpExceptionHandler = new HttpExceptionHandler(); - private ArrayList friendList = new ArrayList<>(); + private List friendList = new ArrayList<>(); // NOTE NOTE // We could alternatively use two attributes (firstName & lastName) for names.