garydgregory commented on pull request #173:
URL: https://github.com/apache/commons-io/pull/173#issuecomment-739577418


   Hi All:
   
   I'm not a fan of the factory method name `dontClose()` as I usually only use 
static imports for JUnit methods, and this it's also weird to me to read code 
that says "don't do something", so `CloseShieldInputStream.dontClose(...)` is 
particularly odd to my ear, YMMV of course.
   
   The following reads better to me:
   ```
   try (InputStream inputStream = CloseShieldInputStream.on(new 
FileInputStream(file))) {
       // use inputStream
   }
   ```
   or:
   ```
   try (InputStream inputStream = CloseShieldInputStream.with(new 
FileInputStream(file))) {
       // use inputStream
   }
   ```
   WDYT?
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to