From 3bf2434a6918e28e9d9624a1cf1ab481415c7015 Mon Sep 17 00:00:00 2001 From: Sherwin Price Date: Tue, 23 Sep 2025 17:21:41 -0400 Subject: [PATCH] cleanup --- src/java/lodge/reservationsystem/CabinReservation.java | 5 ++--- src/java/lodge/reservationsystem/HotelReservation.java | 4 +--- src/java/lodge/reservationsystem/HouseReservation.java | 4 +--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/java/lodge/reservationsystem/CabinReservation.java b/src/java/lodge/reservationsystem/CabinReservation.java index 9167a00..54be01e 100644 --- a/src/java/lodge/reservationsystem/CabinReservation.java +++ b/src/java/lodge/reservationsystem/CabinReservation.java @@ -30,21 +30,20 @@ public final class CabinReservation extends Reservation { physical_address.getZip())); } + @Override public String ReservationType() { return "CabinReservation"; } @Override public boolean checkValid() throws IllegalArgumentException { - boolean result = false; if (getPhysical_address() == null) { throw new IllegalArgumentException(String.format("not valid, physical_address %s", this.getReservation_number())); } if (getMailing_address() == null) { throw new IllegalArgumentException(String.format("not valid, mailing_address: %s", this.getReservation_number())); } - result = true; - return result; + return true; } @Override diff --git a/src/java/lodge/reservationsystem/HotelReservation.java b/src/java/lodge/reservationsystem/HotelReservation.java index 47c13f8..4e2141a 100644 --- a/src/java/lodge/reservationsystem/HotelReservation.java +++ b/src/java/lodge/reservationsystem/HotelReservation.java @@ -50,7 +50,6 @@ public final class HotelReservation extends Reservation{ @Override public boolean checkValid() throws IllegalArgumentException { - boolean result = false; if (getNumberOfBathRooms() != 1) { throw new IllegalArgumentException("not valid, Baths"); } @@ -66,8 +65,7 @@ public final class HotelReservation extends Reservation{ if (getMailing_address() == null) { throw new IllegalArgumentException(String.format("not valid, mailing_address: %s", this.getReservation_number())); } - result = true; - return result; + return true; } @Override diff --git a/src/java/lodge/reservationsystem/HouseReservation.java b/src/java/lodge/reservationsystem/HouseReservation.java index 8b96db0..5779c22 100644 --- a/src/java/lodge/reservationsystem/HouseReservation.java +++ b/src/java/lodge/reservationsystem/HouseReservation.java @@ -47,15 +47,13 @@ public final class HouseReservation extends Reservation { @Override public boolean checkValid() throws IllegalArgumentException { - boolean result = false; if (getPhysical_address() == null) { throw new IllegalArgumentException(String.format("not valid, physical_address %s", this.getReservation_number())); } if (getMailing_address() == null) { throw new IllegalArgumentException(String.format("not valid, mailing_address: %s", this.getReservation_number())); } - result = true; - return result; + return true; } // House price plus additional flat fee for additional space per day