diff --git a/src/main/java/seedu/address/logic/commands/AddPlanCommand.java b/src/main/java/seedu/address/logic/commands/AddPlanCommand.java index 786bde42b0e..440791edd1a 100644 --- a/src/main/java/seedu/address/logic/commands/AddPlanCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddPlanCommand.java @@ -87,9 +87,7 @@ public boolean equals(Object other) { } AddPlanCommand otherAddPlanCommand = (AddPlanCommand) other; - String thisPlan = planName.toString().toLowerCase(); - String otherPlan = otherAddPlanCommand.planName.toString().toLowerCase(); - return thisPlan.equals(otherPlan) + return planName.equals(otherAddPlanCommand.planName) && planDateTime.equals(otherAddPlanCommand.planDateTime) && friendName.equals(otherAddPlanCommand.friendName); } diff --git a/src/main/java/seedu/address/model/plan/Plan.java b/src/main/java/seedu/address/model/plan/Plan.java index 69563471a90..51cb9b3abd0 100644 --- a/src/main/java/seedu/address/model/plan/Plan.java +++ b/src/main/java/seedu/address/model/plan/Plan.java @@ -73,10 +73,8 @@ public boolean isSamePlan(Plan otherPlan) { return true; } - String thisPlanName = planName.toString().toLowerCase(); - return otherPlan != null - && thisPlanName.equals(otherPlan.planName.toString().toLowerCase()) + && otherPlan.getPlanName().equals(getPlanName()) && otherPlan.getPlanFriend().equals(getPlanFriend()) && otherPlan.getPlanDateTime().equals(getPlanDateTime()); } @@ -107,9 +105,7 @@ public boolean equals(Object other) { } Plan otherPlan = (Plan) other; - String thisPlanName = planName.toString().toLowerCase(); - String otherPlanName = otherPlan.planName.toString().toLowerCase(); - return thisPlanName.equals(otherPlanName) + return planName.equals(otherPlan.planName) && dateTime.equals(otherPlan.dateTime) && friend.equals(otherPlan.friend); } diff --git a/src/main/java/seedu/address/model/plan/PlanName.java b/src/main/java/seedu/address/model/plan/PlanName.java index 809dc26c51d..a15a946a263 100644 --- a/src/main/java/seedu/address/model/plan/PlanName.java +++ b/src/main/java/seedu/address/model/plan/PlanName.java @@ -56,7 +56,7 @@ public boolean equals(Object other) { } seedu.address.model.plan.PlanName otherName = (seedu.address.model.plan.PlanName) other; - return planName.equals(otherName.planName); + return planName.equalsIgnoreCase(otherName.planName); } @Override