Skip to content

ready for check#1709

Open
acidden wants to merge 2 commits into
mate-academy:masterfrom
acidden:master
Open

ready for check#1709
acidden wants to merge 2 commits into
mate-academy:masterfrom
acidden:master

Conversation

@acidden

@acidden acidden commented May 31, 2026

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

}
}

private Node<K, V>[] table;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment on lines +7 to +18
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;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants