Skip to content

1#1904

Open
VadimN637 wants to merge 2 commits into
mate-academy:masterfrom
VadimN637:branch
Open

1#1904
VadimN637 wants to merge 2 commits into
mate-academy:masterfrom
VadimN637:branch

Conversation

@VadimN637
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment on lines +7 to +8
private Object[] keys;
private Object[] values;
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 #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[...].

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

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

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