[ 
https://issues.apache.org/jira/browse/IO-868?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17927115#comment-17927115
 ] 

Julian Reschke commented on IO-868:
-----------------------------------

Yes, that looks good to me.

And no, it didn't occur to me that an alternative to "get()" solves the problem 
as well.

> BoundedInputStream builder() can throw IOException
> --------------------------------------------------
>
>                 Key: IO-868
>                 URL: https://issues.apache.org/jira/browse/IO-868
>             Project: Commons IO
>          Issue Type: Wish
>          Components: Streams/Writers
>            Reporter: Julian Reschke
>            Priority: Major
>
> See
>   
> https://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/input/BoundedInputStream.Builder.html#get()
> This proved to be problematic when removing Guava usage from a project. 
> Guava's constructor for CountingInputStream doesn't declare a checked 
> exception, nor do the constructors of commons-io's CountingInputStream or 
> BoundedInputStream.
> Using the recommended builder however does in the "get()" method. Why?
> This makes it harder to convert existing code that does not expect an 
> exception here. What is the recommendation? Catch and wrap into a 
> RuntimeException?
> Minimally it would good if the Javadoc explained under which condition the 
> IOException could occur.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to