1#1904
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great job on implementing the core logic for the storage! The methods for putting and getting values work correctly.
However, one change is needed before this can be approved. The internal arrays keys and values are currently declared as Object[], which violates a specific technical constraint of the task [CHECKLIST ITEM #6].
To align with the requirements, please declare the fields with their generic types, for example: private K[] keys;. You can then initialize them in the constructor by casting an Object array, like this: keys = (K[]) new Object[MAX_CAPACITY];. This adjustment is important for maintaining better type safety within your class.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
| private Object[] keys; | ||
| private Object[] values; |
There was a problem hiding this comment.
This violates checklist item #6: 'Don't use class Objects'. The keys and values arrays should be declared with their respective generic types, K[] and V[], to improve type safety. Although you cannot instantiate a generic array directly (e.g., new K[...]), the common practice is to create an Object array and cast it, like (K[]) new Object[...].
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on this iteration! I am approving your solution. You've done a fantastic job addressing the previous feedback by correctly parameterizing the internal arrays with generics, which significantly improves the type safety of your code. The implementation is now clean, robust, and fully aligns with all the task requirements. Keep up the great work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.