From 5d4d8ff977bf16874e475f9b7dc537140391a23f Mon Sep 17 00:00:00 2001 From: Simon Massey Date: Tue, 30 Oct 2018 23:06:12 +0000 Subject: [PATCH] may as well use final --- .../com/baeldung/thymeleaf/controller/BookController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java index f30ae6e049..d10caee9e7 100644 --- a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java +++ b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java @@ -26,8 +26,8 @@ public class BookController { @RequestMapping(value = "/listBooks", method = RequestMethod.GET) public String listBooks(Model model, @RequestParam("page") Optional page, @RequestParam("size") Optional size) { - int currentPage = page.orElse(1); - int pageSize = size.orElse(5); + final int currentPage = page.orElse(1); + final int pageSize = size.orElse(5); Page bookPage = bookService.findPaginated(PageRequest.of(currentPage - 1, pageSize));