Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overrided methods #1534

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

overrided methods #1534

wants to merge 2 commits into from

Conversation

xli1iax
Copy link

@xli1iax xli1iax commented Dec 17, 2024

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.

Thank you for your hard work on the ArrayList implementation! 😊 There are a couple of critical issues that need to be addressed before we can approve the pull request. Firstly, the task requires a custom ArrayListIndexOutOfBoundsException to be thrown for invalid indices, but this is not currently implemented. Secondly, the use of Arrays.copyOf in the grow method goes against the task's requirement to avoid utility classes like Arrays. Please address these issues to align with the task requirements. Once these changes are made, your solution will be much closer to meeting the task's core requirements. Keep up the great work, and don't hesitate to reach out if you need any help! 🚀

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

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

}

@Override
public T remove(int index) {
return null;
validateIndex(index);

Choose a reason for hiding this comment

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

The task requires throwing a custom ArrayListIndexOutOfBoundsException for invalid indices. Ensure that this exception is defined and used here instead of any standard exceptions.

Comment on lines 86 to 87
int newCapacity = elements.length + (elements.length >> 1);
elements = Arrays.copyOf(elements, newCapacity);

Choose a reason for hiding this comment

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

The checklist specifies not to use utility classes like Arrays. Consider implementing the array copying logic manually to comply with this requirement.

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.

Great job on implementing the ArrayList class! 🎉 You've successfully addressed the core task requirements, particularly by correctly using the ArrayListIndexOutOfBoundsException for index validation and manually copying elements in the grow method, avoiding utility classes like Arrays. These improvements align well with the task specifications.

While the implementation meets the core requirements, remember to review the comments provided to refine your code further. Addressing these points will enhance your coding skills and help you avoid similar issues in the future. Keep up the good work, and continue learning from each experience! 🚀

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

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