Skip to content

Commit

Permalink
Merge pull request #181 from dasha3412/branch-fixCaseSensitivity
Browse files Browse the repository at this point in the history
Fix name case sensitivity
  • Loading branch information
riccoljy authored Oct 31, 2024
2 parents 33418fe + 5b06229 commit 8ab0191
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Name.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public boolean equals(Object other) {
}

Name otherName = (Name) other;
return fullName.equals(otherName.fullName);
return fullName.equalsIgnoreCase(otherName.fullName);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/tag/TagName.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public boolean equals(Object other) {
}

TagName otherName = (TagName) other;
return tagName.equals(otherName.tagName);
return tagName.equalsIgnoreCase(otherName.tagName);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/task/Description.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public boolean equals(Object other) {
}

Description otherDescription = (Description) other;
return value.equals(otherDescription.value);
return value.equalsIgnoreCase(otherDescription.value);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/wedding/WeddingName.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public boolean equals(Object obj) {
}

WeddingName otherWeddingName = (WeddingName) obj;
return this.weddingName.equals(otherWeddingName.weddingName);
return this.weddingName.equalsIgnoreCase(otherWeddingName.weddingName);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/seedu/address/model/person/PersonTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public void isSamePerson() {
editedAlice = new PersonBuilder(ALICE).withName(VALID_NAME_BOB).build();
assertFalse(ALICE.isSamePerson(editedAlice));

// name differs in case, all other attributes same -> returns false
// name is same but differs in case -> returns true
Person editedBob = new PersonBuilder(BOB).withName(VALID_NAME_BOB.toLowerCase()).build();
assertFalse(BOB.isSamePerson(editedBob));
assertTrue(BOB.isSamePerson(editedBob));

// name has trailing spaces, all other attributes same -> returns false
String nameWithTrailingSpaces = VALID_NAME_BOB + " ";
Expand Down

0 comments on commit 8ab0191

Please sign in to comment.