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

Check for IndexOutOfBounds when calculating foreground percentage #625

Merged
merged 1 commit into from
Jan 3, 2018

Conversation

danesfeder
Copy link
Contributor

Closes #621

@electrostat I ended up putting the check in the for loop. The issue looks like what you described in #621 (comment)

mismatch in resumes v pauses size

But maybe it should be:

if (tempResumes.size() < pauses.size() && pauses.size() > 0) {
     tempResumes.add(currentTime);
} else if (pauses.size() < tempResumes.size()) {
     pauses.add(currentTime);
}

Instead of returning 100 like we originally discussed - as the crash is a result of the pauses being smaller than the resumes. Thanks for the help on this!

@danesfeder danesfeder added the bug Defect to be fixed. label Jan 3, 2018
@danesfeder danesfeder added this to the v0.9.0 milestone Jan 3, 2018
@danesfeder danesfeder self-assigned this Jan 3, 2018
@danesfeder danesfeder merged commit 9989673 into master Jan 3, 2018
@danesfeder danesfeder deleted the dan-foreground-bug branch January 3, 2018 16:54
This was referenced Jan 17, 2018
@palto-ccadoret
Copy link

Hi @danesfeder
"pauses" is an ArrayList and by definition is not synchronized, I think that it's not a good way to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defect to be fixed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants