Skip to content

Comments

Final#1732

Open
obvly wants to merge 2 commits intomate-academy:masterfrom
obvly:master
Open

Final#1732
obvly wants to merge 2 commits intomate-academy:masterfrom
obvly:master

Conversation

@obvly
Copy link

@obvly obvly commented Jan 10, 2026

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

This is a strong submission, and you've correctly implemented most of the core functionality for the custom ArrayList. However, a few changes are needed to fully meet the task requirements based on the checklist.

Here are the required fixes:

  1. Informative Exceptions: The NoSuchElementException thrown in the remove(T element) method must include a descriptive message indicating which element was not found. [CHECKLIST ITEM #10]
  2. Method Naming: The grow() method's name is a bit misleading because it only grows the array under a specific condition. A more accurate name would be growIfFull() or ensureCapacity(). [CHECKLIST ITEM #6]
  3. Variable Naming: The variable name newArray is too generic. Please consider a more descriptive name like expandedElements to better convey its purpose. [CHECKLIST ITEM #6]

Once these points are addressed, your solution will be in great shape. You're very close to completing the task!


✨ 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

return remove(i);
}
}
throw new NoSuchElementException();

Choose a reason for hiding this comment

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

This violates checklist item #10: 'Make your exceptions informative.' This exception should include a message indicating which element was not found in the list.

return size == 0;
}

private void grow() {

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: 'Use informative names for your variables and methods.' The checklist provides an example that directly applies here. Since this method only grows the array under a specific condition (if (size == elementData.length)), a more descriptive name like growIfFull() or ensureCapacity() would better reflect its behavior.

private void grow() {
if (size == elementData.length) {
int newCapacity = elementData.length + (elementData.length >> 1);
T[] newArray = (T[]) new Object[newCapacity];

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: 'Do not use abstract words like string or array as variable names.' The variable name newArray is too generic. Consider a more descriptive name like expandedElements or newElementData to better convey its purpose.

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

Excellent work on this submission! I'm happy to approve it. You've done a great job addressing all the feedback from the previous review. The method and variable names are now much more descriptive, and the exception messages are clear and informative. Your ArrayList implementation is clean, correct, and fully meets all the task requirements. Keep up the fantastic 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