From c9116be944fe3856658805697444ee103fb18075 Mon Sep 17 00:00:00 2001 From: sherman Date: Fri, 7 Jun 2013 13:49:37 -0700 Subject: [PATCH] 8015728: (zipfs) demo/zipfs/basic.sh failing Summary: to return the correct loc entry size from wirteLOC(); Reviewed-by: alanb --- .../nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java | 4 +--- test/demo/zipfs/ZipFSTester.java | 7 +++---- test/demo/zipfs/basic.sh | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java index dc5ccfc2d..e9fb82abf 100644 --- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java +++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java @@ -1940,7 +1940,6 @@ public class ZipFileSystem extends FileSystem { if (elen64 != 0) { elen64 += 4; // header and data sz 4 bytes } - while (eoff + 4 < elen) { int tag = SH(extra, eoff); int sz = SH(extra, eoff + 2); @@ -1995,7 +1994,6 @@ public class ZipFileSystem extends FileSystem { writeLong(os, locoff); } if (elenNTFS != 0) { - // System.out.println("writing NTFS:" + elenNTFS); writeShort(os, EXTID_NTFS); writeShort(os, elenNTFS - 4); writeInt(os, 0); // reserved @@ -2197,7 +2195,7 @@ public class ZipFileSystem extends FileSystem { if (extra != null) { writeBytes(os, extra); } - return LOCHDR + name.length + elen + elen64 + elenEXTT; + return LOCHDR + name.length + elen + elen64 + elenNTFS + elenEXTT; } // Data Descriptior diff --git a/test/demo/zipfs/ZipFSTester.java b/test/demo/zipfs/ZipFSTester.java index 9d0bb04a0..c6bd389c9 100644 --- a/test/demo/zipfs/ZipFSTester.java +++ b/test/demo/zipfs/ZipFSTester.java @@ -341,6 +341,9 @@ public class ZipFSTester { // test file stamp static void testTime(Path src) throws Exception { + BasicFileAttributes attrs = Files + .getFileAttributeView(src, BasicFileAttributeView.class) + .readAttributes(); // create a new filesystem, copy this file into it Map env = new HashMap(); env.put("create", "true"); @@ -352,10 +355,6 @@ public class ZipFSTester { Path dst = getPathWithParents(fs, "me"); Files.copy(src, dst, COPY_ATTRIBUTES); checkEqual(src, dst); - - BasicFileAttributes attrs = Files - .getFileAttributeView(src, BasicFileAttributeView.class) - .readAttributes(); System.out.println("mtime: " + attrs.lastModifiedTime()); System.out.println("ctime: " + attrs.creationTime()); System.out.println("atime: " + attrs.lastAccessTime()); diff --git a/test/demo/zipfs/basic.sh b/test/demo/zipfs/basic.sh index c36f286ef..9dc852158 100644 --- a/test/demo/zipfs/basic.sh +++ b/test/demo/zipfs/basic.sh @@ -22,7 +22,7 @@ # # @test # @bug 6990846 7009092 7009085 7015391 7014948 7005986 7017840 7007596 -# 7157656 8002390 7012868 7012856 +# 7157656 8002390 7012868 7012856 8015728 # @summary Test ZipFileSystem demo # @build Basic PathOps ZipFSTester # @run shell basic.sh -- GitLab