Skip to content

Commit 741ed62

Browse files
author
Lana Steuck
committed
Merge
2 parents 13821e7 + 37fa4db commit 741ed62

File tree

234 files changed

+13893
-1593
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+13893
-1593
lines changed

jdk/make/launcher/Launcher-jdk.accessibility.gmk

+6-4
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
7373
$$(eval $$(call SetupNativeCompilation, BUILD_JACCESSINSPECTOR$1, \
7474
SRC := $(TOPDIR)/jaccessinspector $(TOPDIR)/common \
7575
$(TOPDIR)/toolscommon $(TOPDIR)/include/bridge, \
76-
CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 /EHsc, \
77-
LDFLAGS := $$(LDFLAGS_JDKEXE) /STACK:655360 Advapi32.lib User32.lib, \
76+
CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
77+
LDFLAGS := $$(LDFLAGS_JDKEXE) -stack:655360, \
78+
LIBS := advapi32.lib user32.lib, \
7879
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccessinspector$1, \
7980
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
8081
PROGRAM := jaccessinspector$1, \
@@ -100,8 +101,9 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
100101
$$(eval $$(call SetupNativeCompilation,BUILD_JACCESSWALKER$1, \
101102
SRC := $(TOPDIR)/jaccesswalker $(TOPDIR)/common \
102103
$(TOPDIR)/toolscommon $(TOPDIR)/include/bridge, \
103-
CFLAGS :== $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 /EHsc, \
104-
LDFLAGS := $$(LDFLAGS_JDKEXE) /STACK:655360 Advapi32.lib Comctl32.lib Gdi32.lib User32.lib, \
104+
CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
105+
LDFLAGS := $$(LDFLAGS_JDKEXE) -stack:655360, \
106+
LIBS := advapi32.lib comctl32.lib gdi32.lib user32.lib, \
105107
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccesswalker$1, \
106108
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
107109
PROGRAM := jaccesswalker$1, \

jdk/src/java.base/linux/classes/sun/nio/ch/EPollSelectorImpl.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import java.nio.channels.*;
3030
import java.nio.channels.spi.*;
3131
import java.util.*;
32-
import sun.misc.*;
3332

3433
/**
3534
* An implementation of Selector for Linux 2.6+ kernels that uses
@@ -50,7 +49,7 @@ class EPollSelectorImpl
5049
private Map<Integer,SelectionKeyImpl> fdToKey;
5150

5251
// True if this Selector has been closed
53-
private volatile boolean closed = false;
52+
private volatile boolean closed;
5453

5554
// Lock for interrupt triggering and clearing
5655
private final Object interruptLock = new Object();

jdk/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public final class SunJCE extends Provider {
9393

9494
// Instance of this provider, so we don't have to call the provider list
9595
// to find ourselves or run the risk of not being in the list.
96-
private static volatile SunJCE instance = null;
96+
private static volatile SunJCE instance;
9797

9898
// lazy initialize SecureRandom to avoid potential recursion if Sun
9999
// provider has not been installed yet

jdk/src/java.base/share/classes/java/io/File.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,11 @@ public File(URI uri) {
420420
String scheme = uri.getScheme();
421421
if ((scheme == null) || !scheme.equalsIgnoreCase("file"))
422422
throw new IllegalArgumentException("URI scheme is not \"file\"");
423-
if (uri.getAuthority() != null)
423+
if (uri.getRawAuthority() != null)
424424
throw new IllegalArgumentException("URI has an authority component");
425-
if (uri.getFragment() != null)
425+
if (uri.getRawFragment() != null)
426426
throw new IllegalArgumentException("URI has a fragment component");
427-
if (uri.getQuery() != null)
427+
if (uri.getRawQuery() != null)
428428
throw new IllegalArgumentException("URI has a query component");
429429
String p = uri.getPath();
430430
if (p.equals(""))

jdk/src/java.base/share/classes/java/io/PipedInputStream.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
* @since 1.0
4949
*/
5050
public class PipedInputStream extends InputStream {
51-
boolean closedByWriter = false;
52-
volatile boolean closedByReader = false;
53-
boolean connected = false;
51+
boolean closedByWriter;
52+
volatile boolean closedByReader;
53+
boolean connected;
5454

5555
/* REMIND: identification of the read and write sides needs to be
5656
more sophisticated. Either using thread groups (but what about

jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
package java.lang;
2727

28-
import sun.misc.FloatingDecimal;
28+
import jdk.internal.math.FloatingDecimal;
2929
import java.util.Arrays;
3030
import java.util.Spliterator;
3131
import java.util.stream.IntStream;

jdk/src/java.base/share/classes/java/lang/Class.java

+15-12
Original file line numberDiff line numberDiff line change
@@ -2518,7 +2518,7 @@ private static class ReflectionData<T> {
25182518

25192519
// Incremented by the VM on each call to JVM TI RedefineClasses()
25202520
// that redefines this class or a superclass.
2521-
private transient volatile int classRedefinedCount = 0;
2521+
private transient volatile int classRedefinedCount;
25222522

25232523
// Lazily create and cache ReflectionData
25242524
private ReflectionData<T> reflectionData() {
@@ -3331,7 +3331,8 @@ public T[] getEnumConstants() {
33313331
* uncloned, cached, and shared by all callers.
33323332
*/
33333333
T[] getEnumConstantsShared() {
3334-
if (enumConstants == null) {
3334+
T[] constants = enumConstants;
3335+
if (constants == null) {
33353336
if (!isEnum()) return null;
33363337
try {
33373338
final Method values = getMethod("values");
@@ -3344,16 +3345,16 @@ public Void run() {
33443345
});
33453346
@SuppressWarnings("unchecked")
33463347
T[] temporaryConstants = (T[])values.invoke(null);
3347-
enumConstants = temporaryConstants;
3348+
enumConstants = constants = temporaryConstants;
33483349
}
33493350
// These can happen when users concoct enum-like classes
33503351
// that don't comply with the enum spec.
33513352
catch (InvocationTargetException | NoSuchMethodException |
33523353
IllegalAccessException ex) { return null; }
33533354
}
3354-
return enumConstants;
3355+
return constants;
33553356
}
3356-
private transient volatile T[] enumConstants = null;
3357+
private transient volatile T[] enumConstants;
33573358

33583359
/**
33593360
* Returns a map from simple name to enum constant. This package-private
@@ -3363,19 +3364,21 @@ public Void run() {
33633364
* created lazily on first use. Typically it won't ever get created.
33643365
*/
33653366
Map<String, T> enumConstantDirectory() {
3366-
if (enumConstantDirectory == null) {
3367+
Map<String, T> directory = enumConstantDirectory;
3368+
if (directory == null) {
33673369
T[] universe = getEnumConstantsShared();
33683370
if (universe == null)
33693371
throw new IllegalArgumentException(
33703372
getName() + " is not an enum type");
3371-
Map<String, T> m = new HashMap<>(2 * universe.length);
3372-
for (T constant : universe)
3373-
m.put(((Enum<?>)constant).name(), constant);
3374-
enumConstantDirectory = m;
3373+
directory = new HashMap<>(2 * universe.length);
3374+
for (T constant : universe) {
3375+
directory.put(((Enum<?>)constant).name(), constant);
3376+
}
3377+
enumConstantDirectory = directory;
33753378
}
3376-
return enumConstantDirectory;
3379+
return directory;
33773380
}
3378-
private transient volatile Map<String, T> enumConstantDirectory = null;
3381+
private transient volatile Map<String, T> enumConstantDirectory;
33793382

33803383
/**
33813384
* Casts an object to the class or interface represented

jdk/src/java.base/share/classes/java/lang/ClassLoader.java

+34-1
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@
4545
import java.util.Set;
4646
import java.util.Stack;
4747
import java.util.Map;
48+
import java.util.NoSuchElementException;
4849
import java.util.Vector;
4950
import java.util.Hashtable;
5051
import java.util.WeakHashMap;
5152
import java.util.concurrent.ConcurrentHashMap;
52-
import sun.misc.CompoundEnumeration;
5353
import sun.misc.Resource;
5454
import sun.misc.URLClassPath;
5555
import sun.reflect.CallerSensitive;
@@ -2206,3 +2206,36 @@ public ClassLoader run() throws Exception {
22062206
return sys;
22072207
}
22082208
}
2209+
2210+
/*
2211+
* A utility class that will enumerate over an array of enumerations.
2212+
*/
2213+
final class CompoundEnumeration<E> implements Enumeration<E> {
2214+
private final Enumeration<E>[] enums;
2215+
private int index;
2216+
2217+
public CompoundEnumeration(Enumeration<E>[] enums) {
2218+
this.enums = enums;
2219+
}
2220+
2221+
private boolean next() {
2222+
while (index < enums.length) {
2223+
if (enums[index] != null && enums[index].hasMoreElements()) {
2224+
return true;
2225+
}
2226+
index++;
2227+
}
2228+
return false;
2229+
}
2230+
2231+
public boolean hasMoreElements() {
2232+
return next();
2233+
}
2234+
2235+
public E nextElement() {
2236+
if (!next()) {
2237+
throw new NoSuchElementException();
2238+
}
2239+
return enums[index].nextElement();
2240+
}
2241+
}

jdk/src/java.base/share/classes/java/lang/Double.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
package java.lang;
2727

28-
import sun.misc.FloatingDecimal;
29-
import sun.misc.DoubleConsts;
28+
import jdk.internal.math.FloatingDecimal;
29+
import jdk.internal.math.DoubleConsts;
3030
import jdk.internal.HotSpotIntrinsicCandidate;
3131

3232
/**

jdk/src/java.base/share/classes/java/lang/Float.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525

2626
package java.lang;
2727

28-
import sun.misc.FloatingDecimal;
29-
import sun.misc.FloatConsts;
30-
import sun.misc.DoubleConsts;
28+
import jdk.internal.math.FloatingDecimal;
29+
import jdk.internal.math.FloatConsts;
30+
import jdk.internal.math.DoubleConsts;
3131
import jdk.internal.HotSpotIntrinsicCandidate;
3232

3333
/**

jdk/src/java.base/share/classes/java/lang/Math.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
package java.lang;
2727

2828
import java.util.Random;
29-
import sun.misc.FloatConsts;
30-
import sun.misc.DoubleConsts;
29+
import jdk.internal.math.FloatConsts;
30+
import jdk.internal.math.DoubleConsts;
3131
import jdk.internal.HotSpotIntrinsicCandidate;
3232

3333
/**

jdk/src/java.base/share/classes/java/lang/StrictMath.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
package java.lang;
2727

2828
import java.util.Random;
29-
import sun.misc.DoubleConsts;
29+
import jdk.internal.math.DoubleConsts;
3030
import jdk.internal.HotSpotIntrinsicCandidate;
3131

3232
/**

jdk/src/java.base/share/classes/java/lang/System.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private System() {
132132

133133
/* The security manager for the system.
134134
*/
135-
private static volatile SecurityManager security = null;
135+
private static volatile SecurityManager security;
136136

137137
/**
138138
* Reassigns the "standard" input stream.
@@ -206,7 +206,7 @@ public static void setErr(PrintStream err) {
206206
setErr0(err);
207207
}
208208

209-
private static volatile Console cons = null;
209+
private static volatile Console cons;
210210
/**
211211
* Returns the unique {@link java.io.Console Console} object associated
212212
* with the current Java virtual machine, if any.
@@ -216,12 +216,13 @@ public static void setErr(PrintStream err) {
216216
* @since 1.6
217217
*/
218218
public static Console console() {
219-
if (cons == null) {
219+
Console c = cons;
220+
if (c == null) {
220221
synchronized (System.class) {
221-
cons = SharedSecrets.getJavaIOAccess().console();
222+
cons = c = SharedSecrets.getJavaIOAccess().console();
222223
}
223224
}
224-
return cons;
225+
return c;
225226
}
226227

227228
/**

jdk/src/java.base/share/classes/java/lang/Thread.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,10 @@ private static synchronized int nextThreadNum() {
207207
/* For generating thread ID */
208208
private static long threadSeqNumber;
209209

210-
/* Java thread status for tools,
211-
* initialized to indicate thread 'not yet started'
210+
/*
211+
* Java thread status for tools, default indicates thread 'not yet started'
212212
*/
213-
214-
private volatile int threadStatus = 0;
215-
213+
private volatile int threadStatus;
216214

217215
private static synchronized long nextThreadID() {
218216
return ++threadSeqNumber;

jdk/src/java.base/share/classes/java/lang/ref/ReferenceQueue.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ boolean enqueue(Reference<? extends S> r) {
5353

5454
private static class Lock { };
5555
private Lock lock = new Lock();
56-
private volatile Reference<? extends T> head = null;
56+
private volatile Reference<? extends T> head;
5757
private long queueLength = 0;
5858

5959
boolean enqueue(Reference<? extends T> r) { /* Called only by Reference class */

jdk/src/java.base/share/classes/java/lang/reflect/Parameter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public Type getParameterizedType() {
205205
return tmp;
206206
}
207207

208-
private transient volatile Type parameterTypeCache = null;
208+
private transient volatile Type parameterTypeCache;
209209

210210
/**
211211
* Returns a {@code Class} object that identifies the
@@ -237,7 +237,7 @@ public AnnotatedType getAnnotatedType() {
237237
return executable.getAnnotatedParameterTypes()[index];
238238
}
239239

240-
private transient volatile Class<?> parameterClassCache = null;
240+
private transient volatile Class<?> parameterClassCache;
241241

242242
/**
243243
* Returns {@code true} if this parameter is implicitly declared

jdk/src/java.base/share/classes/java/math/BigInteger.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
import java.util.Random;
3939
import java.util.concurrent.ThreadLocalRandom;
4040

41-
import sun.misc.DoubleConsts;
42-
import sun.misc.FloatConsts;
41+
import jdk.internal.math.DoubleConsts;
42+
import jdk.internal.math.FloatConsts;
4343
import jdk.internal.HotSpotIntrinsicCandidate;
4444

4545
/**

0 commit comments

Comments
 (0)