Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b69f6147 authored by Neil Fuller's avatar Neil Fuller
Browse files

Add a finalize() method to StrictJarFile

Bug: 25896372
Test: Booted device, installed CTS apps
Test: run cts --class android.util.cts.StrictJarFileTest
Change-Id: I35e238dadd48d2c4ca53ac37a4c5aacdd471a93a
parent e40ab185
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -175,6 +175,18 @@ public final class StrictJarFile {
        }
    }

    @Override
    protected void finalize() throws Throwable {
        try {
            if (guard != null) {
                guard.warnIfOpen();
            }
            close();
        } finally {
            super.finalize();
        }
    }

    private InputStream getZipInputStream(ZipEntry ze) {
        if (ze.getMethod() == ZipEntry.STORED) {
            return new RAFStream(raf, ze.getDataOffset(),