darshanparajuli / LogcatReader

A simple app for viewing logs on an android device.
MIT License
580 stars 103 forks source link

[FixedCircularArray] Fix shifting 'next' variable to a negative value in removeAt() method #38

Closed proninyaroslav closed 4 years ago

proninyaroslav commented 4 years ago

Hi. If the next pointer is in the 0 position, then when you remove element, you must shift it into the size - 1 position. The error was that it shifts into a negative value and raised an IndexOutOfBoundsException, if i added a new element to the array. I made a test that reproduces the error, and also made a patch that fixes it.

darshanparajuli commented 4 years ago

Great catch! Thanks!