am e869b398: am 20272bec: am c207c943: am c5283927: Close ZipFiles correctly in WebViewFactory.
* commit 'e869b3981506537dabbd1011df94f1e69ce84495':
Close ZipFiles correctly in WebViewFactory.
diff --git a/core/java/android/webkit/WebViewFactory.java b/core/java/android/webkit/WebViewFactory.java
index 3b9aca8..584deff 100644
--- a/core/java/android/webkit/WebViewFactory.java
+++ b/core/java/android/webkit/WebViewFactory.java
@@ -314,8 +314,7 @@
if (path.contains("!/")) {
String[] split = TextUtils.split(path, "!/");
if (split.length == 2) {
- try {
- ZipFile z = new ZipFile(split[0]);
+ try (ZipFile z = new ZipFile(split[0])) {
ZipEntry e = z.getEntry(split[1]);
if (e != null && e.getMethod() == ZipEntry.STORED) {
newVmSize = Math.max(newVmSize, e.getSize());
@@ -355,8 +354,7 @@
String[] abiList,
String nativeLibFileName) {
// Search the APK for a native library conforming to a listed ABI.
- try {
- ZipFile z = new ZipFile(apkPath);
+ try (ZipFile z = new ZipFile(apkPath)) {
for (String abi : abiList) {
final String entry = "lib/" + abi + "/" + nativeLibFileName;
ZipEntry e = z.getEntry(entry);