Skip to content

2 Persons with the same name, yet different phone number, email and address, cannot be added to the address book #1

@brianchoon

Description

@brianchoon

Firstly, I added a new person with this command:

add p n/Sam p/123 e/[email protected] a/Sam Street

This appears in the address book, which is intended behaviour:

image.png

Next, I tried to add another person with name "Sam" but with different phone number, email, and address. For example, I did this:

add p n/Sam p/12345 e/[email protected] a/Sam Lane

image.png

This person could not be added.

I believe this may be a flaw in the feature as realistically, there may be persons with the same name stored in your address book.

One suggestion I have is to review the definition of Person equality in your code. Perhaps, you may want to redefine the equals function in your app to allow for multiple people of the same name, as long as they differ in some other fields.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions