Skip to content

impl storage class#1919

Open
zibi-dev wants to merge 3 commits into
mate-academy:masterfrom
zibi-dev:develop
Open

impl storage class#1919
zibi-dev wants to merge 3 commits into
mate-academy:masterfrom
zibi-dev:develop

Conversation

@zibi-dev
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

Your implementation is functionally correct and meets all core requirements for the Storage class with generics and array-based operations. However, there is a critical checklist violation that must be fixed: both files have constants missing the final keyword. In StorageImpl.java line 6, change private static int MAX_SIZE = 10; to private static final int MAX_SIZE = 10;. Similarly, in Pair.java, change private static int MAX_ELEMENTS_AMOUNT = 10; to private static final int MAX_ELEMENTS_AMOUNT = 10;. According to checklist item #3, magic numbers must be constants with static final modifiers to actually qualify as constants. There is also a medium issue with the findPair method in Pair.java where the type parameter <K> shadows the class-level type parameter - remove <K> from the method signature to use the class-level parameter instead. These are learning opportunities around proper constant declarations and generic type handling in Java.


✨ 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

public class Pair<K, V> {
protected K key;
protected V value;

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 constant is missing the final keyword. According to checklist item #3, magic numbers should be constants with informative names, but a constant must be declared as final to actually be a constant. Change to: private static final int MAX_ELEMENTS_AMOUNT = 10;

import core.basesyntax.Storage;

public class StorageImpl<K, V> implements Storage<K, V> {
private static int MAX_SIZE = 10;
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 #3: 'Any magic numbers should be constants'. The field MAX_SIZE should be declared as private static final int MAX_SIZE = 10; to properly qualify as a constant.

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

Line 21 in StorageImpl.java is 101 characters, which exceeds the 100-character maximum enforced by Checkstyle. Shorten this line or break it across multiple lines to comply with the style guide.


✨ 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

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

Your solution is approved with an educational override to help you progress while learning. The core functionality is excellent - your array-based Storage implementation with generics, proper key replacement logic, and MAX_SIZE constant are all well done. However, there are redundant empty lines at the beginning of your class declarations that need attention: Pair.java line 2 and StorageImpl.java line 4 have empty lines before the class declaration. According to the checklist, you should not begin class or method implementations with empty lines. Simply remove those leading empty lines to clean up your code structure. Great work overall!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

@@ -0,0 +1,23 @@
package core.basesyntax.impl;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Redundant empty line at the start of class declaration. The checklist requires removing all redundant empty lines - do not begin class implementation with an empty line.

package core.basesyntax.impl;

public class Pair<K, V> {
private K key;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Redundant empty line at the start of class declaration. The checklist requires removing all redundant empty lines - do not begin class implementation with an empty line.

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