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

Work around bugs in java.util.Spliterator#estimateSize #141

Closed
seanf opened this issue Sep 6, 2022 · 2 comments
Closed

Work around bugs in java.util.Spliterator#estimateSize #141

seanf opened this issue Sep 6, 2022 · 2 comments

Comments

@seanf
Copy link
Contributor

seanf commented Sep 6, 2022

Some Spliterators have bugs in their estimateSize methods, and introducing ProgressBar can trigger these bugs when it tries to determine the initialMax value. It would be good to have ProgressBar.wrap catch any exceptions and do its best to continue. This of courses raises the question of exception logging.

Would you be open to a PR which makes this change?

@ctongfei
Copy link
Owner

ctongfei commented Sep 10, 2022

It sounds interesting -- how should we handle the exception? Just ignore it and continue as if it is indefinite?
This is already the behavior for InputStreams. I'll do the same for Spliterators. Thanks!

@ctongfei ctongfei mentioned this issue Sep 10, 2022
@seanf
Copy link
Contributor Author

seanf commented Sep 12, 2022

Thank you!

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

No branches or pull requests

2 participants