Skip to content

Commit

Permalink
changes made in PlanName class
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannice committed Nov 11, 2023
1 parent d755310 commit a74cff1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/seedu/address/model/plan/Plan.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/plan/PlanName.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a74cff1

Please sign in to comment.