diff options
author | Cary Clark <cary@android.com> | 2009-08-11 17:40:45 -0400 |
---|---|---|
committer | Cary Clark <cary@android.com> | 2009-08-12 11:05:04 -0400 |
commit | 722f755c14ea05ddaf041b282ab68c30a6ed05e6 (patch) | |
tree | df5598bc2ef4fa049ddcc31529f039699a4a3d4f /src | |
parent | a977124eb29b195127fd161120ebbc58b255fb48 (diff) | |
download | packages_apps_Browser-722f755c14ea05ddaf041b282ab68c30a6ed05e6.zip packages_apps_Browser-722f755c14ea05ddaf041b282ab68c30a6ed05e6.tar.gz packages_apps_Browser-722f755c14ea05ddaf041b282ab68c30a6ed05e6.tar.bz2 |
close streams when done
found by findbugs
http://b/issue?id=1856630
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/BrowserActivity.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index 769f54d..5c4a63d 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -431,16 +431,34 @@ public class BrowserActivity extends Activity * BUILD_INFOS_FILE in the plugins directory. */ public void copyBuildInfos() { + FileInputStream iStream = null; + FileOutputStream oStream = null; try { if (LOGV_ENABLED) { Log.v(TAG, "Copy build infos to the plugins directory"); } File buildInfoFile = new File(SYSTEM_BUILD_INFOS_FILE); File buildInfoPlugins = new File(pluginsPath, BUILD_INFOS_FILE); - copyStreams(new FileInputStream(buildInfoFile), - new FileOutputStream(buildInfoPlugins)); + iStream = new FileInputStream(buildInfoFile); + oStream = new FileOutputStream(buildInfoPlugins); + copyStreams(iStream, oStream); } catch (IOException e) { Log.e(TAG, "Exception while copying the build infos: " + e); + } finally { + try { + if (iStream != null) { + iStream.close(); + } + } catch (IOException e2) { + Log.e(TAG, "Exception while closing the input stream: " + e2); + } + try { + if (oStream != null) { + oStream.close(); + } + } catch (IOException e3) { + Log.e(TAG, "Exception while closing the output stream: " + e3); + } } } |