Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix issue with DataTransferHashMap handling missing data #3141

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Basmala27
Copy link

  • Added null checks in getData and removeData methods to handle cases where the key does not exist.
  • Updated tests for addData, getData, and removeData to ensure proper functionality.
  • Improved the displayData method to provide clearer output.
  • Fixed minor formatting and documentation issues in the DataTransferHashMap class.

Closes #1269 (if the issue is related to an existing issue on GitHub)

What problem does this PR solve?

The DataTransferHashMap class was not handling cases where the key does not exist when calling getData and removeData. This caused potential NullPointerExceptions. The tests were also did not cover all edge cases related to missing data. Uncomment the following line if this PR closes some issues -->

Basmala. and others added 2 commits December 8, 2024 20:56
- Added null checks in `getData` and `removeData` methods to handle cases where the key does not exist.
- Updated tests for `addData`, `getData`, and `removeData` to ensure proper functionality.
- Improved the `displayData` method to provide clearer output.
- Fixed minor formatting and documentation issues in the `DataTransferHashMap` class.

Closes iluwatar#1269 (if the issue is related to an existing issue on GitHub)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data Transfer Hash pattern
1 participant