-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AddressBook: remove unused containsTag()
AddressBook#containsTag() checks if the master list of Tags contains a Tag with the same value as the given Tag. AddressBook#containsTag() is not used in the production code. While it is used in test code, its use can be replaced by AddressBookTest#isTagObjectInAddressBookList(). Let's remove AddressBook#containsTag(). Notes: * Why not keep AddressBook#containsTag() and remove AddressBookTest#isTagObjectInAddressBookList() instead? The former does a value equality test while the latter goes further and does a reference equality test. The test code requires a reference equality test to verify Person objects refer to Tag objects in the common tag list instead of keeping its own copies of Tag objects. * Why not change AddressBook#containsTag() to use reference equality and use that in tests? Doing so will make AddressBook#containsTag()'s semantics inconsistent with the rest of our API.
- Loading branch information
1 parent
4e3fac9
commit a6cc952
Showing
2 changed files
with
3 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters