-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
base: master
Are you sure you want to change the base?
overrided methods #1534
Conversation
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
int newCapacity = elements.length + (elements.length >> 1); | ||
elements = Arrays.copyOf(elements, newCapacity); |
There was a problem hiding this comment.
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.
There was a problem hiding this 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! ✨
No description provided.