From 0d0030e52f15dfecb02f3e8687caf9dfb42aad6e Mon Sep 17 00:00:00 2001 From: filippo-ferrari Date: Sun, 15 Sep 2024 15:13:21 +0200 Subject: [PATCH] fix: removed generic runtime exception --- .../com/application/munera/views/categories/CategoriesView.java | 2 +- .../com/application/munera/views/expenses/ExpensesView.java | 2 +- .../java/com/application/munera/views/people/PeopleView.java | 2 +- src/main/java/com/application/munera/views/users/UsersView.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/application/munera/views/categories/CategoriesView.java b/src/main/java/com/application/munera/views/categories/CategoriesView.java index 94f0292..a358e11 100644 --- a/src/main/java/com/application/munera/views/categories/CategoriesView.java +++ b/src/main/java/com/application/munera/views/categories/CategoriesView.java @@ -121,7 +121,7 @@ public class CategoriesView extends Div implements BeforeEnterObserver { delete.addClickListener(e -> { try { - if (this.category == null) throw new RuntimeException("Category is null!"); //TODO: create proper exception + if (this.category == null) throw new IllegalStateException("Category is null!"); categoryService.delete(this.category); clearForm(); refreshGrid(); diff --git a/src/main/java/com/application/munera/views/expenses/ExpensesView.java b/src/main/java/com/application/munera/views/expenses/ExpensesView.java index 2c6ae27..b8ea8a3 100644 --- a/src/main/java/com/application/munera/views/expenses/ExpensesView.java +++ b/src/main/java/com/application/munera/views/expenses/ExpensesView.java @@ -203,7 +203,7 @@ public class ExpensesView extends Div implements BeforeEnterObserver { delete.addClickListener(e -> { try { - if (Objects.isNull(this.expense)) throw new RuntimeException("Expense is null!"); //TODO: create proper exception + if (Objects.isNull(this.expense)) throw new IllegalStateException("Expense is null!"); expenseService.delete(this.expense.getId()); clearForm(); refreshGrid(); diff --git a/src/main/java/com/application/munera/views/people/PeopleView.java b/src/main/java/com/application/munera/views/people/PeopleView.java index e1e6ccb..5408cb1 100644 --- a/src/main/java/com/application/munera/views/people/PeopleView.java +++ b/src/main/java/com/application/munera/views/people/PeopleView.java @@ -168,7 +168,7 @@ public class PeopleView extends Div implements BeforeEnterObserver { delete.addClickListener(e -> { try { - if (this.person == null) throw new RuntimeException("The person is null!"); //TODO: create proper exception + if (this.person == null) throw new IllegalStateException("The person is null!"); personFacade.delete(this.person.getId()); clearForm(); refreshGrid(); diff --git a/src/main/java/com/application/munera/views/users/UsersView.java b/src/main/java/com/application/munera/views/users/UsersView.java index 010b712..40a046f 100644 --- a/src/main/java/com/application/munera/views/users/UsersView.java +++ b/src/main/java/com/application/munera/views/users/UsersView.java @@ -130,7 +130,7 @@ public class UsersView extends Div implements BeforeEnterObserver { delete.addClickListener(e -> { try { - if (this.user == null) throw new RuntimeException("The user is null!"); //TODO: create proper exception + if (this.user == null) throw new IllegalStateException("The user is null!"); userService.delete(this.user); clearForm(); refreshGrid();