Bug 1356693 - Pre: use IOUtils.safeStreamClose() in IOUtils r=walkingice
☠☠ backed out by deed2d6f0eff ☠ ☠
authorAndrzej Hunt <ahunt@mozilla.com>
Fri, 14 Apr 2017 15:24:45 -0700
changeset 569324 0ca9044bb930f0ae2e7e6196565586366edf1f30
parent 569323 7964174edf5fd9bae581ee98a257cb6a83faa78e
child 569325 76c560e8d908e1640f4781c34df7f5a0c0dd592e
push id56143
push userbmo:jeremychen@mozilla.com
push dateThu, 27 Apr 2017 10:17:21 +0000
reviewerswalkingice
bugs1356693
milestone55.0a1
Bug 1356693 - Pre: use IOUtils.safeStreamClose() in IOUtils r=walkingice MozReview-Commit-ID: 3dikakcAKqI
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/IOUtils.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/IOUtils.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/IOUtils.java
@@ -85,21 +85,17 @@ public class IOUtils {
                     buffer = newBuffer;
                 }
             }
 
             return new ConsumedInputStream(bPointer + 1, buffer);
         } catch (IOException e) {
             Log.e(LOGTAG, "Error consuming input stream.", e);
         } finally {
-            try {
-                iStream.close();
-            } catch (IOException e) {
-                Log.e(LOGTAG, "Error closing input stream.", e);
-            }
+            IOUtils.safeStreamClose(iStream);
         }
 
         return null;
     }
 
     /**
      * Truncate a given byte[] to a given length. Returns a new byte[] with the first length many
      * bytes of the input.