OSDN Git Service

Fix crashing StrictJarFile due to doubled closing.
authorTomasz Mikolajewski <mtomasz@google.com>
Tue, 6 Dec 2016 01:05:05 +0000 (10:05 +0900)
committerTomasz Mikolajewski <mtomasz@google.com>
Tue, 6 Dec 2016 01:05:05 +0000 (10:05 +0900)
commitb061fc2bb5b6e8397c7f3a40be521badad91e9af
treea269d368a1612f165bfbf518d002c31f350aa56c
parent19fc36fa336c65405f88dbcef907ecc0feace7e7
Fix crashing StrictJarFile due to doubled closing.

If the constuctor throws, then the handles would be closed without
setting "closed" to true. As a result, the finalizer would close
the handles again, which would cause a crash on the native side.

Test: Unit tests are no longer flaky.
Bug: 33301253
Change-Id: I527ba38d5d65ce844258d894441d4fe16bac6e23
core/java/android/util/jar/StrictJarFile.java