Skip to content

Comments

I did#1749

Open
Yehor0820 wants to merge 1 commit intomate-academy:masterfrom
Yehor0820:hw-10
Open

I did#1749
Yehor0820 wants to merge 1 commit intomate-academy:masterfrom
Yehor0820:hw-10

Conversation

@Yehor0820
Copy link

No description provided.

Copy link

@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

I am approving your solution as an educational override so you can continue progressing while you refine a few style details. Functionally, your ArrayList implementation is strong: it uses the correct default capacity, grows the internal array by ~1.5x with System.arraycopy, performs index checks via helper methods, and throws the required custom exceptions with generally informative messages. The remaining issues are minor style violations related to the checklist rule about redundant empty lines [CHECKLIST ITEM #1]: there is an extra blank line right before the constructor, another one before the add(T value) method, and a redundant blank line before the add(T value, int index) area. These should be removed so that each constructor or method starts directly after the previous code block, with at most a single separating blank line where appropriate. Fixing these will make your code cleaner and fully aligned with the style checklist. Overall, you’ve done a very good job on the core logic—treat these formatting tweaks as a final polish step to reach production-quality style.


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

Footnotes

  1. Rate AI review example

private static final int GROWTH_DIVISOR = 2;
private Object[] elements;
private int size;

Choose a reason for hiding this comment

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

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" — there is a redundant empty line immediately before the constructor. Remove the empty line so the constructor starts directly after prior code.

this.elements = new Object[DEFAULT_CAPACITY];
this.size = 0;
}

Choose a reason for hiding this comment

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

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" — there is a redundant empty line before the add(T value) method. Remove it so the method declaration is not preceded by an empty line.

ensureCapacity();
this.elements[size++] = value;
}

Choose a reason for hiding this comment

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

This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" — there is a redundant empty line before the add(T value, int index) method area. Remove redundant empty lines between method blocks.

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.

3 participants