test/java/util/zip/ZipFile/TestZipFile.java

Print this page

        

*** 21,31 **** * questions. */ /* * @test ! * @bug 8142508 * @summary Tests various ZipFile apis * @run main/manual TestZipFile */ import java.io.*; --- 21,31 ---- * questions. */ /* * @test ! * @bug 8142508 8146431 * @summary Tests various ZipFile apis * @run main/manual TestZipFile */ import java.io.*;
*** 214,223 **** --- 214,230 ---- throw new RuntimeException(t); } } static void doTest0(Zip zip, ZipFile zf) throws Throwable { + // (0) check zero-length entry name, no AIOOBE + try { + check(zf.getEntry("") == null);; + } catch (Throwable t) { + unexpected(t); + } + List<ZipEntry> list = new ArrayList(zip.entries.keySet()); // (1) check entry list, in expected order if (!check(Arrays.equals( list.stream().map( e -> e.getName()).toArray(String[]::new), zf.stream().map( e -> e.getName()).toArray(String[]::new)))) {