mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8237508: Simplify JarFile.isInitializing
Reviewed-by: dfuchs, coffeys, lancea
This commit is contained in:
parent
4aab3078a2
commit
fdbea219a1
3 changed files with 15 additions and 10 deletions
|
@ -146,11 +146,13 @@ import java.util.zip.ZipFile;
|
|||
* @since 1.2
|
||||
*/
|
||||
public class JarFile extends ZipFile {
|
||||
private final static Runtime.Version BASE_VERSION;
|
||||
private final static int BASE_VERSION_FEATURE;
|
||||
private final static Runtime.Version RUNTIME_VERSION;
|
||||
private final static boolean MULTI_RELEASE_ENABLED;
|
||||
private final static boolean MULTI_RELEASE_FORCED;
|
||||
private static final Runtime.Version BASE_VERSION;
|
||||
private static final int BASE_VERSION_FEATURE;
|
||||
private static final Runtime.Version RUNTIME_VERSION;
|
||||
private static final boolean MULTI_RELEASE_ENABLED;
|
||||
private static final boolean MULTI_RELEASE_FORCED;
|
||||
private static final ThreadLocal<Boolean> isInitializing = new ThreadLocal<>();
|
||||
|
||||
private SoftReference<Manifest> manRef;
|
||||
private JarEntry manEntry;
|
||||
private JarVerifier jv;
|
||||
|
@ -159,8 +161,6 @@ public class JarFile extends ZipFile {
|
|||
private final Runtime.Version version; // current version
|
||||
private final int versionFeature; // version.feature()
|
||||
private boolean isMultiRelease; // is jar multi-release?
|
||||
static final ThreadLocal<Boolean> isInitializing =
|
||||
ThreadLocal.withInitial(() -> Boolean.FALSE);
|
||||
|
||||
// indicates if Class-Path attribute present
|
||||
private boolean hasClassPathAttribute;
|
||||
|
@ -1043,6 +1043,11 @@ public class JarFile extends ZipFile {
|
|||
}
|
||||
}
|
||||
|
||||
static boolean isInitializing() {
|
||||
Boolean value = isInitializing.get();
|
||||
return (value == null) ? false : value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns a versioned {@code JarFileEntry} for the given entry,
|
||||
* if there is one. Otherwise returns the original entry. This
|
||||
|
|
|
@ -69,7 +69,7 @@ class JavaUtilJarAccessImpl implements JavaUtilJarAccess {
|
|||
jar.ensureInitialization();
|
||||
}
|
||||
|
||||
public Boolean isInitializing() {
|
||||
return JarFile.isInitializing.get();
|
||||
public boolean isInitializing() {
|
||||
return JarFile.isInitializing();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue