ready for check#1709
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation has two checklist violations that need to be fixed before approval. First, the table field is missing an explicit access modifier (violates [CHECKLIST ITEM #7] - all fields must have explicit access modifiers). Add private before the Node[] table declaration. Second, the private Node class is positioned at lines 7-18 before the public methods like put(), getValue(), and getSize() (violates [CHECKLIST ITEM #5] - private methods and classes should be placed after public ones). Move the Node class definition to the bottom of the file after all public methods. These are explicit checklist requirements, so they need to be corrected before the task can be approved.
✨ 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 Node<K, V>[] table; |
There was a problem hiding this comment.
This violates checklist item #7: All fields and methods must have explicit access modifiers. The table field is missing an access modifier (uses package-private default).
| private static class Node<K, V> { | ||
| private final int hash; | ||
| private final K key; | ||
| private V value; | ||
| private Node<K, V> next; | ||
|
|
||
| public Node(int hash, K key, V value, Node<K, V> next) { | ||
| this.hash = hash; | ||
| this.key = key; | ||
| this.value = value; | ||
| this.next = next; | ||
| } |
There was a problem hiding this comment.
This violates checklist item #5: Private methods and classes should be placed after public ones. The private Node class (lines 7-18) should come after the public methods like put(), getValue(), and getSize().
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your MyHashMap implementation successfully meets all requirements. The code correctly implements the core put, getValue, and getSize methods with proper collision handling through chaining, and the resize functionality works as expected with the load factor threshold. All encapsulation requirements are satisfied: the table field has an explicit private modifier, utility methods are properly scoped as private, and the Node class is positioned at the end of the file. Magic numbers have been converted to named constants (DEFAULT_CAPACITY, LOAD_FACTOR), and the Node class is correctly parameterized with <K, V> types. Well done on addressing all the previous review comments and delivering a clean, standards-compliant implementation.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.