Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update isSamePerson() equality for Person class
The person equality check returns true if the name or the email matches. The OR condition complicates the equality check done when editing a person as it assumes isSamePerson() to have a transitive relation. Alternative 1: Improve the way the equality check is done in the edit command to prevent the above bug. (PRs nus-cs2103-AY2122S2#68, nus-cs2103-AY2122S2#69) Alternative 2: Simplify the equality check by removing the OR condition. This is simpler but possibly too strict for the address book domain i.e., increases the risk of duplicate entries for the same person creeping into the address book We decided to go with the alternative 2 because, * It is important to keep the code base simple, to reduce the initial learning curve of the students at the start of their project * Students can introduce a more sophisticated equality check that matches their product domain later. Also, let's change the default name in PersonBuilder utility class. This is because AddCommandIntegrationTest populates its model using getTypicalPersons() which contains a person with the default name. This test then creates another person using the default name, to be added into the model, which is expected to pass. However, the above update in equality causes this test to fail. Thus we need to change the default name to a unique name that is not inside getTypicalPersons(). Also, the default email is changed for consistency in naming the default values, it does not affect current test cases.
- Loading branch information