impl storage class#1919
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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
| public class Pair<K, V> { | ||
| protected K key; | ||
| protected V value; | ||
|
|
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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
| @@ -0,0 +1,23 @@ | |||
| package core.basesyntax.impl; | |||
|
|
|||
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
No description provided.