jdk/src/java.base/share/classes/java/util/zip/ZipUtils.java
author alanb
Wed, 19 Jul 2017 19:30:08 +0100
changeset 45924 8bbd04c0791e
parent 39772 c2a5d2de5253
child 46154 fcef65412084
permissions -rw-r--r--
8184917: System.initPhase1 does not need to pre-load libzip Reviewed-by: redestad
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
     1
/*
45924
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
     2
 * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
     4
 *
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    10
 *
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    15
 * accompanied this code).
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    16
 *
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    20
 *
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    23
 * questions.
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    24
 */
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    25
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    26
package java.util.zip;
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    27
19374
6773349693eb 8015666: test/tools/pack200/TimeStamp.java failing
sherman
parents: 17910
diff changeset
    28
import java.nio.file.attribute.FileTime;
45924
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
    29
import java.security.AccessController;
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
    30
import java.security.PrivilegedAction;
33405
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
    31
import java.time.Instant;
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
    32
import java.time.LocalDateTime;
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
    33
import java.time.ZoneId;
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    34
import java.util.concurrent.TimeUnit;
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    35
34686
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
    36
import static java.util.zip.ZipConstants.ENDHDR;
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
    37
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    38
class ZipUtils {
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    39
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    40
    // used to adjust values between Windows and java epoch
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    41
    private static final long WINDOWS_EPOCH_IN_MICROSECONDS = -11644473600000000L;
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    42
39772
c2a5d2de5253 8161942: java.util.zip.ZipEntry.java not covering UpperLimit range of DOS epoch
sherman
parents: 34686
diff changeset
    43
    // used to indicate the corresponding windows time is not available
c2a5d2de5253 8161942: java.util.zip.ZipEntry.java not covering UpperLimit range of DOS epoch
sherman
parents: 34686
diff changeset
    44
    public static final long WINDOWS_TIME_NOT_AVAILABLE = Long.MIN_VALUE;
c2a5d2de5253 8161942: java.util.zip.ZipEntry.java not covering UpperLimit range of DOS epoch
sherman
parents: 34686
diff changeset
    45
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    46
    /**
19374
6773349693eb 8015666: test/tools/pack200/TimeStamp.java failing
sherman
parents: 17910
diff changeset
    47
     * Converts Windows time (in microseconds, UTC/GMT) time to FileTime.
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    48
     */
19374
6773349693eb 8015666: test/tools/pack200/TimeStamp.java failing
sherman
parents: 17910
diff changeset
    49
    public static final FileTime winTimeToFileTime(long wtime) {
6773349693eb 8015666: test/tools/pack200/TimeStamp.java failing
sherman
parents: 17910
diff changeset
    50
        return FileTime.from(wtime / 10 + WINDOWS_EPOCH_IN_MICROSECONDS,
6773349693eb 8015666: test/tools/pack200/TimeStamp.java failing
sherman
parents: 17910
diff changeset
    51
                             TimeUnit.MICROSECONDS);
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    52
    }
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    53
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    54
    /**
19374
6773349693eb 8015666: test/tools/pack200/TimeStamp.java failing
sherman
parents: 17910
diff changeset
    55
     * Converts FileTime to Windows time.
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    56
     */
19374
6773349693eb 8015666: test/tools/pack200/TimeStamp.java failing
sherman
parents: 17910
diff changeset
    57
    public static final long fileTimeToWinTime(FileTime ftime) {
6773349693eb 8015666: test/tools/pack200/TimeStamp.java failing
sherman
parents: 17910
diff changeset
    58
        return (ftime.to(TimeUnit.MICROSECONDS) - WINDOWS_EPOCH_IN_MICROSECONDS) * 10;
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    59
    }
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    60
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    61
    /**
39772
c2a5d2de5253 8161942: java.util.zip.ZipEntry.java not covering UpperLimit range of DOS epoch
sherman
parents: 34686
diff changeset
    62
     * The upper bound of the 32-bit unix time, the "year 2038 problem".
c2a5d2de5253 8161942: java.util.zip.ZipEntry.java not covering UpperLimit range of DOS epoch
sherman
parents: 34686
diff changeset
    63
     */
c2a5d2de5253 8161942: java.util.zip.ZipEntry.java not covering UpperLimit range of DOS epoch
sherman
parents: 34686
diff changeset
    64
    public static final long UPPER_UNIXTIME_BOUND = 0x7fffffff;
c2a5d2de5253 8161942: java.util.zip.ZipEntry.java not covering UpperLimit range of DOS epoch
sherman
parents: 34686
diff changeset
    65
c2a5d2de5253 8161942: java.util.zip.ZipEntry.java not covering UpperLimit range of DOS epoch
sherman
parents: 34686
diff changeset
    66
    /**
19374
6773349693eb 8015666: test/tools/pack200/TimeStamp.java failing
sherman
parents: 17910
diff changeset
    67
     * Converts "standard Unix time"(in seconds, UTC/GMT) to FileTime
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    68
     */
19374
6773349693eb 8015666: test/tools/pack200/TimeStamp.java failing
sherman
parents: 17910
diff changeset
    69
    public static final FileTime unixTimeToFileTime(long utime) {
6773349693eb 8015666: test/tools/pack200/TimeStamp.java failing
sherman
parents: 17910
diff changeset
    70
        return FileTime.from(utime, TimeUnit.SECONDS);
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    71
    }
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    72
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    73
    /**
19374
6773349693eb 8015666: test/tools/pack200/TimeStamp.java failing
sherman
parents: 17910
diff changeset
    74
     * Converts FileTime to "standard Unix time".
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    75
     */
19374
6773349693eb 8015666: test/tools/pack200/TimeStamp.java failing
sherman
parents: 17910
diff changeset
    76
    public static final long fileTimeToUnixTime(FileTime ftime) {
6773349693eb 8015666: test/tools/pack200/TimeStamp.java failing
sherman
parents: 17910
diff changeset
    77
        return ftime.to(TimeUnit.SECONDS);
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    78
    }
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    79
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    80
    /**
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    81
     * Converts DOS time to Java time (number of milliseconds since epoch).
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    82
     */
33405
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
    83
    public static long dosToJavaTime(long dtime) {
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
    84
        LocalDateTime ldt = LocalDateTime.of(
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
    85
                (int) (((dtime >> 25) & 0x7f) + 1980),
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
    86
                (int) ((dtime >> 21) & 0x0f),
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
    87
                (int) ((dtime >> 16) & 0x1f),
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
    88
                (int) ((dtime >> 11) & 0x1f),
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
    89
                (int) ((dtime >> 5) & 0x3f),
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
    90
                (int) ((dtime << 1) & 0x3e));
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
    91
        return TimeUnit.MILLISECONDS.convert(ldt.toEpochSecond(
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
    92
                ZoneId.systemDefault().getRules().getOffset(ldt)), TimeUnit.SECONDS);
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    93
    }
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    94
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
    95
    /**
29226
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
    96
     * Converts extended DOS time to Java time, where up to 1999 milliseconds
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
    97
     * might be encoded into the upper half of the returned long.
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
    98
     *
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
    99
     * @param xdostime the extended DOS time value
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   100
     * @return milliseconds since epoch
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   101
     */
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   102
    public static long extendedDosToJavaTime(long xdostime) {
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   103
        long time = dosToJavaTime(xdostime);
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   104
        return time + (xdostime >> 32);
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   105
    }
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   106
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   107
    /**
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   108
     * Converts Java time to DOS time.
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   109
     */
29226
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   110
    private static long javaToDosTime(long time) {
33405
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
   111
        Instant instant = Instant.ofEpochMilli(time);
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
   112
        LocalDateTime ldt = LocalDateTime.ofInstant(
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
   113
                instant, ZoneId.systemDefault());
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
   114
        int year = ldt.getYear() - 1980;
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
   115
        if (year < 0) {
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
   116
            return (1 << 21) | (1 << 16);
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   117
        }
33405
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
   118
        return (year << 25 |
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
   119
            ldt.getMonthValue() << 21 |
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
   120
            ldt.getDayOfMonth() << 16 |
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
   121
            ldt.getHour() << 11 |
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
   122
            ldt.getMinute() << 5 |
24ee3a0ba28f 8066644: Fix deprecation warnings in jdk.zipfs module
redestad
parents: 31820
diff changeset
   123
            ldt.getSecond() >> 1) & 0xffffffffL;
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   124
    }
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   125
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   126
    /**
29226
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   127
     * Converts Java time to DOS time, encoding any milliseconds lost
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   128
     * in the conversion into the upper half of the returned long.
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   129
     *
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   130
     * @param time milliseconds since epoch
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   131
     * @return DOS time with 2s remainder encoded into upper half
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   132
     */
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   133
    public static long javaToExtendedDosTime(long time) {
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   134
        if (time < 0) {
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   135
            return ZipEntry.DOSTIME_BEFORE_1980;
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   136
        }
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   137
        long dostime = javaToDosTime(time);
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   138
        return (dostime != ZipEntry.DOSTIME_BEFORE_1980)
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   139
                ? dostime + ((time % 2000) << 32)
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   140
                : ZipEntry.DOSTIME_BEFORE_1980;
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   141
    }
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   142
b675016fabfd 8073497: Lazy conversion of ZipEntry time
redestad
parents: 25859
diff changeset
   143
    /**
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   144
     * Fetches unsigned 16-bit value from byte array at specified offset.
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   145
     * The bytes are assumed to be in Intel (little-endian) byte order.
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   146
     */
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   147
    public static final int get16(byte b[], int off) {
34686
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   148
        return (b[off] & 0xff) | ((b[off + 1] & 0xff) << 8);
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   149
    }
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   150
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   151
    /**
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   152
     * Fetches unsigned 32-bit value from byte array at specified offset.
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   153
     * The bytes are assumed to be in Intel (little-endian) byte order.
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   154
     */
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   155
    public static final long get32(byte b[], int off) {
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   156
        return (get16(b, off) | ((long)get16(b, off+2) << 16)) & 0xffffffffL;
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   157
    }
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   158
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   159
    /**
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   160
     * Fetches signed 64-bit value from byte array at specified offset.
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   161
     * The bytes are assumed to be in Intel (little-endian) byte order.
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   162
     */
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   163
    public static final long get64(byte b[], int off) {
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   164
        return get32(b, off) | (get32(b, off+4) << 32);
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   165
    }
31819
ba7cde5a611a 8075526: Need a way to read and write ZipEntry timestamp using local date/time without tz conversion
sherman
parents: 29226
diff changeset
   166
ba7cde5a611a 8075526: Need a way to read and write ZipEntry timestamp using local date/time without tz conversion
sherman
parents: 29226
diff changeset
   167
    /**
ba7cde5a611a 8075526: Need a way to read and write ZipEntry timestamp using local date/time without tz conversion
sherman
parents: 29226
diff changeset
   168
     * Fetches signed 32-bit value from byte array at specified offset.
ba7cde5a611a 8075526: Need a way to read and write ZipEntry timestamp using local date/time without tz conversion
sherman
parents: 29226
diff changeset
   169
     * The bytes are assumed to be in Intel (little-endian) byte order.
ba7cde5a611a 8075526: Need a way to read and write ZipEntry timestamp using local date/time without tz conversion
sherman
parents: 29226
diff changeset
   170
     *
ba7cde5a611a 8075526: Need a way to read and write ZipEntry timestamp using local date/time without tz conversion
sherman
parents: 29226
diff changeset
   171
     */
ba7cde5a611a 8075526: Need a way to read and write ZipEntry timestamp using local date/time without tz conversion
sherman
parents: 29226
diff changeset
   172
    public static final int get32S(byte b[], int off) {
ba7cde5a611a 8075526: Need a way to read and write ZipEntry timestamp using local date/time without tz conversion
sherman
parents: 29226
diff changeset
   173
        return (get16(b, off) | (get16(b, off+2) << 16));
ba7cde5a611a 8075526: Need a way to read and write ZipEntry timestamp using local date/time without tz conversion
sherman
parents: 29226
diff changeset
   174
    }
34686
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   175
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   176
    // fields access methods
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   177
    static final int CH(byte[] b, int n) {
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   178
        return b[n] & 0xff ;
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   179
    }
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   180
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   181
    static final int SH(byte[] b, int n) {
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   182
        return (b[n] & 0xff) | ((b[n + 1] & 0xff) << 8);
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   183
    }
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   184
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   185
    static final long LG(byte[] b, int n) {
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   186
        return ((SH(b, n)) | (SH(b, n + 2) << 16)) & 0xffffffffL;
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   187
    }
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   188
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   189
    static final long LL(byte[] b, int n) {
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   190
        return (LG(b, n)) | (LG(b, n + 4) << 32);
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   191
    }
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   192
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   193
    static final long GETSIG(byte[] b) {
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   194
        return LG(b, 0);
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   195
    }
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   196
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   197
    // local file (LOC) header fields
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   198
    static final long LOCSIG(byte[] b) { return LG(b, 0); } // signature
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   199
    static final int  LOCVER(byte[] b) { return SH(b, 4); } // version needed to extract
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   200
    static final int  LOCFLG(byte[] b) { return SH(b, 6); } // general purpose bit flags
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   201
    static final int  LOCHOW(byte[] b) { return SH(b, 8); } // compression method
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   202
    static final long LOCTIM(byte[] b) { return LG(b, 10);} // modification time
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   203
    static final long LOCCRC(byte[] b) { return LG(b, 14);} // crc of uncompressed data
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   204
    static final long LOCSIZ(byte[] b) { return LG(b, 18);} // compressed data size
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   205
    static final long LOCLEN(byte[] b) { return LG(b, 22);} // uncompressed data size
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   206
    static final int  LOCNAM(byte[] b) { return SH(b, 26);} // filename length
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   207
    static final int  LOCEXT(byte[] b) { return SH(b, 28);} // extra field length
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   208
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   209
    // extra local (EXT) header fields
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   210
    static final long EXTCRC(byte[] b) { return LG(b, 4);}  // crc of uncompressed data
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   211
    static final long EXTSIZ(byte[] b) { return LG(b, 8);}  // compressed size
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   212
    static final long EXTLEN(byte[] b) { return LG(b, 12);} // uncompressed size
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   213
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   214
    // end of central directory header (END) fields
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   215
    static final int  ENDSUB(byte[] b) { return SH(b, 8); }  // number of entries on this disk
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   216
    static final int  ENDTOT(byte[] b) { return SH(b, 10);}  // total number of entries
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   217
    static final long ENDSIZ(byte[] b) { return LG(b, 12);}  // central directory size
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   218
    static final long ENDOFF(byte[] b) { return LG(b, 16);}  // central directory offset
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   219
    static final int  ENDCOM(byte[] b) { return SH(b, 20);}  // size of zip file comment
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   220
    static final int  ENDCOM(byte[] b, int off) { return SH(b, off + 20);}
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   221
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   222
    // zip64 end of central directory recoder fields
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   223
    static final long ZIP64_ENDTOD(byte[] b) { return LL(b, 24);}  // total number of entries on disk
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   224
    static final long ZIP64_ENDTOT(byte[] b) { return LL(b, 32);}  // total number of entries
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   225
    static final long ZIP64_ENDSIZ(byte[] b) { return LL(b, 40);}  // central directory size
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   226
    static final long ZIP64_ENDOFF(byte[] b) { return LL(b, 48);}  // central directory offset
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   227
    static final long ZIP64_LOCOFF(byte[] b) { return LL(b, 8);}   // zip64 end offset
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   228
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   229
    // central directory header (CEN) fields
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   230
    static final long CENSIG(byte[] b, int pos) { return LG(b, pos + 0); }
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   231
    static final int  CENVEM(byte[] b, int pos) { return SH(b, pos + 4); }
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   232
    static final int  CENVER(byte[] b, int pos) { return SH(b, pos + 6); }
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   233
    static final int  CENFLG(byte[] b, int pos) { return SH(b, pos + 8); }
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   234
    static final int  CENHOW(byte[] b, int pos) { return SH(b, pos + 10);}
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   235
    static final long CENTIM(byte[] b, int pos) { return LG(b, pos + 12);}
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   236
    static final long CENCRC(byte[] b, int pos) { return LG(b, pos + 16);}
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   237
    static final long CENSIZ(byte[] b, int pos) { return LG(b, pos + 20);}
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   238
    static final long CENLEN(byte[] b, int pos) { return LG(b, pos + 24);}
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   239
    static final int  CENNAM(byte[] b, int pos) { return SH(b, pos + 28);}
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   240
    static final int  CENEXT(byte[] b, int pos) { return SH(b, pos + 30);}
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   241
    static final int  CENCOM(byte[] b, int pos) { return SH(b, pos + 32);}
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   242
    static final int  CENDSK(byte[] b, int pos) { return SH(b, pos + 34);}
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   243
    static final int  CENATT(byte[] b, int pos) { return SH(b, pos + 36);}
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   244
    static final long CENATX(byte[] b, int pos) { return LG(b, pos + 38);}
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   245
    static final long CENOFF(byte[] b, int pos) { return LG(b, pos + 42);}
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   246
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   247
    // The END header is followed by a variable length comment of size < 64k.
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   248
    static final long END_MAXLEN = 0xFFFF + ENDHDR;
29ea8310a27a 8145260: To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk [2]
sherman
parents: 34526
diff changeset
   249
    static final int READBLOCKSZ = 128;
45924
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
   250
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
   251
    /**
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
   252
     * Loads zip native library, if not already laoded
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
   253
     */
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
   254
    static void loadLibrary() {
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
   255
        SecurityManager sm = System.getSecurityManager();
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
   256
        if (sm == null) {
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
   257
            System.loadLibrary("zip");
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
   258
        } else {
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
   259
            PrivilegedAction<Void> pa = () -> { System.loadLibrary("zip"); return null; };
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
   260
            AccessController.doPrivileged(pa);
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
   261
        }
8bbd04c0791e 8184917: System.initPhase1 does not need to pre-load libzip
alanb
parents: 39772
diff changeset
   262
    }
17910
82d10099a8a6 4759491: method ZipEntry.setTime(long) works incorrectly
sherman
parents:
diff changeset
   263
}