Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Lana Steuck committed Dec 24, 2015
2 parents 13821e7 + 37fa4db commit 741ed62
Show file tree
Hide file tree
Showing 234 changed files with 13,893 additions and 1,593 deletions.
10 changes: 6 additions & 4 deletions jdk/make/launcher/Launcher-jdk.accessibility.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
$$(eval $$(call SetupNativeCompilation, BUILD_JACCESSINSPECTOR$1, \
SRC := $(TOPDIR)/jaccessinspector $(TOPDIR)/common \
$(TOPDIR)/toolscommon $(TOPDIR)/include/bridge, \
CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 /EHsc, \
LDFLAGS := $$(LDFLAGS_JDKEXE) /STACK:655360 Advapi32.lib User32.lib, \
CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
LDFLAGS := $$(LDFLAGS_JDKEXE) -stack:655360, \
LIBS := advapi32.lib user32.lib, \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccessinspector$1, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
PROGRAM := jaccessinspector$1, \
Expand All @@ -100,8 +101,9 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
$$(eval $$(call SetupNativeCompilation,BUILD_JACCESSWALKER$1, \
SRC := $(TOPDIR)/jaccesswalker $(TOPDIR)/common \
$(TOPDIR)/toolscommon $(TOPDIR)/include/bridge, \
CFLAGS :== $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 /EHsc, \
LDFLAGS := $$(LDFLAGS_JDKEXE) /STACK:655360 Advapi32.lib Comctl32.lib Gdi32.lib User32.lib, \
CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
LDFLAGS := $$(LDFLAGS_JDKEXE) -stack:655360, \
LIBS := advapi32.lib comctl32.lib gdi32.lib user32.lib, \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccesswalker$1, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
PROGRAM := jaccesswalker$1, \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.nio.channels.*;
import java.nio.channels.spi.*;
import java.util.*;
import sun.misc.*;

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

// True if this Selector has been closed
private volatile boolean closed = false;
private volatile boolean closed;

// Lock for interrupt triggering and clearing
private final Object interruptLock = new Object();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public final class SunJCE extends Provider {

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

// lazy initialize SecureRandom to avoid potential recursion if Sun
// provider has not been installed yet
Expand Down
6 changes: 3 additions & 3 deletions jdk/src/java.base/share/classes/java/io/File.java
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,11 @@ public File(URI uri) {
String scheme = uri.getScheme();
if ((scheme == null) || !scheme.equalsIgnoreCase("file"))
throw new IllegalArgumentException("URI scheme is not \"file\"");
if (uri.getAuthority() != null)
if (uri.getRawAuthority() != null)
throw new IllegalArgumentException("URI has an authority component");
if (uri.getFragment() != null)
if (uri.getRawFragment() != null)
throw new IllegalArgumentException("URI has a fragment component");
if (uri.getQuery() != null)
if (uri.getRawQuery() != null)
throw new IllegalArgumentException("URI has a query component");
String p = uri.getPath();
if (p.equals(""))
Expand Down
6 changes: 3 additions & 3 deletions jdk/src/java.base/share/classes/java/io/PipedInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
* @since 1.0
*/
public class PipedInputStream extends InputStream {
boolean closedByWriter = false;
volatile boolean closedByReader = false;
boolean connected = false;
boolean closedByWriter;
volatile boolean closedByReader;
boolean connected;

/* REMIND: identification of the read and write sides needs to be
more sophisticated. Either using thread groups (but what about
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

package java.lang;

import sun.misc.FloatingDecimal;
import jdk.internal.math.FloatingDecimal;
import java.util.Arrays;
import java.util.Spliterator;
import java.util.stream.IntStream;
Expand Down
27 changes: 15 additions & 12 deletions jdk/src/java.base/share/classes/java/lang/Class.java
Original file line number Diff line number Diff line change
Expand Up @@ -2518,7 +2518,7 @@ private static class ReflectionData<T> {

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

// Lazily create and cache ReflectionData
private ReflectionData<T> reflectionData() {
Expand Down Expand Up @@ -3331,7 +3331,8 @@ public T[] getEnumConstants() {
* uncloned, cached, and shared by all callers.
*/
T[] getEnumConstantsShared() {
if (enumConstants == null) {
T[] constants = enumConstants;
if (constants == null) {
if (!isEnum()) return null;
try {
final Method values = getMethod("values");
Expand All @@ -3344,16 +3345,16 @@ public Void run() {
});
@SuppressWarnings("unchecked")
T[] temporaryConstants = (T[])values.invoke(null);
enumConstants = temporaryConstants;
enumConstants = constants = temporaryConstants;
}
// These can happen when users concoct enum-like classes
// that don't comply with the enum spec.
catch (InvocationTargetException | NoSuchMethodException |
IllegalAccessException ex) { return null; }
}
return enumConstants;
return constants;
}
private transient volatile T[] enumConstants = null;
private transient volatile T[] enumConstants;

/**
* Returns a map from simple name to enum constant. This package-private
Expand All @@ -3363,19 +3364,21 @@ public Void run() {
* created lazily on first use. Typically it won't ever get created.
*/
Map<String, T> enumConstantDirectory() {
if (enumConstantDirectory == null) {
Map<String, T> directory = enumConstantDirectory;
if (directory == null) {
T[] universe = getEnumConstantsShared();
if (universe == null)
throw new IllegalArgumentException(
getName() + " is not an enum type");
Map<String, T> m = new HashMap<>(2 * universe.length);
for (T constant : universe)
m.put(((Enum<?>)constant).name(), constant);
enumConstantDirectory = m;
directory = new HashMap<>(2 * universe.length);
for (T constant : universe) {
directory.put(((Enum<?>)constant).name(), constant);
}
enumConstantDirectory = directory;
}
return enumConstantDirectory;
return directory;
}
private transient volatile Map<String, T> enumConstantDirectory = null;
private transient volatile Map<String, T> enumConstantDirectory;

/**
* Casts an object to the class or interface represented
Expand Down
35 changes: 34 additions & 1 deletion jdk/src/java.base/share/classes/java/lang/ClassLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
import java.util.Set;
import java.util.Stack;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Vector;
import java.util.Hashtable;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
import sun.misc.CompoundEnumeration;
import sun.misc.Resource;
import sun.misc.URLClassPath;
import sun.reflect.CallerSensitive;
Expand Down Expand Up @@ -2206,3 +2206,36 @@ public ClassLoader run() throws Exception {
return sys;
}
}

/*
* A utility class that will enumerate over an array of enumerations.
*/
final class CompoundEnumeration<E> implements Enumeration<E> {
private final Enumeration<E>[] enums;
private int index;

public CompoundEnumeration(Enumeration<E>[] enums) {
this.enums = enums;
}

private boolean next() {
while (index < enums.length) {
if (enums[index] != null && enums[index].hasMoreElements()) {
return true;
}
index++;
}
return false;
}

public boolean hasMoreElements() {
return next();
}

public E nextElement() {
if (!next()) {
throw new NoSuchElementException();
}
return enums[index].nextElement();
}
}
4 changes: 2 additions & 2 deletions jdk/src/java.base/share/classes/java/lang/Double.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

package java.lang;

import sun.misc.FloatingDecimal;
import sun.misc.DoubleConsts;
import jdk.internal.math.FloatingDecimal;
import jdk.internal.math.DoubleConsts;
import jdk.internal.HotSpotIntrinsicCandidate;

/**
Expand Down
6 changes: 3 additions & 3 deletions jdk/src/java.base/share/classes/java/lang/Float.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

package java.lang;

import sun.misc.FloatingDecimal;
import sun.misc.FloatConsts;
import sun.misc.DoubleConsts;
import jdk.internal.math.FloatingDecimal;
import jdk.internal.math.FloatConsts;
import jdk.internal.math.DoubleConsts;
import jdk.internal.HotSpotIntrinsicCandidate;

/**
Expand Down
4 changes: 2 additions & 2 deletions jdk/src/java.base/share/classes/java/lang/Math.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
package java.lang;

import java.util.Random;
import sun.misc.FloatConsts;
import sun.misc.DoubleConsts;
import jdk.internal.math.FloatConsts;
import jdk.internal.math.DoubleConsts;
import jdk.internal.HotSpotIntrinsicCandidate;

/**
Expand Down
2 changes: 1 addition & 1 deletion jdk/src/java.base/share/classes/java/lang/StrictMath.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
package java.lang;

import java.util.Random;
import sun.misc.DoubleConsts;
import jdk.internal.math.DoubleConsts;
import jdk.internal.HotSpotIntrinsicCandidate;

/**
Expand Down
11 changes: 6 additions & 5 deletions jdk/src/java.base/share/classes/java/lang/System.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private System() {

/* The security manager for the system.
*/
private static volatile SecurityManager security = null;
private static volatile SecurityManager security;

/**
* Reassigns the "standard" input stream.
Expand Down Expand Up @@ -206,7 +206,7 @@ public static void setErr(PrintStream err) {
setErr0(err);
}

private static volatile Console cons = null;
private static volatile Console cons;
/**
* Returns the unique {@link java.io.Console Console} object associated
* with the current Java virtual machine, if any.
Expand All @@ -216,12 +216,13 @@ public static void setErr(PrintStream err) {
* @since 1.6
*/
public static Console console() {
if (cons == null) {
Console c = cons;
if (c == null) {
synchronized (System.class) {
cons = SharedSecrets.getJavaIOAccess().console();
cons = c = SharedSecrets.getJavaIOAccess().console();
}
}
return cons;
return c;
}

/**
Expand Down
8 changes: 3 additions & 5 deletions jdk/src/java.base/share/classes/java/lang/Thread.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,10 @@ private static synchronized int nextThreadNum() {
/* For generating thread ID */
private static long threadSeqNumber;

/* Java thread status for tools,
* initialized to indicate thread 'not yet started'
/*
* Java thread status for tools, default indicates thread 'not yet started'
*/

private volatile int threadStatus = 0;

private volatile int threadStatus;

private static synchronized long nextThreadID() {
return ++threadSeqNumber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ boolean enqueue(Reference<? extends S> r) {

private static class Lock { };
private Lock lock = new Lock();
private volatile Reference<? extends T> head = null;
private volatile Reference<? extends T> head;
private long queueLength = 0;

boolean enqueue(Reference<? extends T> r) { /* Called only by Reference class */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public Type getParameterizedType() {
return tmp;
}

private transient volatile Type parameterTypeCache = null;
private transient volatile Type parameterTypeCache;

/**
* Returns a {@code Class} object that identifies the
Expand Down Expand Up @@ -237,7 +237,7 @@ public AnnotatedType getAnnotatedType() {
return executable.getAnnotatedParameterTypes()[index];
}

private transient volatile Class<?> parameterClassCache = null;
private transient volatile Class<?> parameterClassCache;

/**
* Returns {@code true} if this parameter is implicitly declared
Expand Down
4 changes: 2 additions & 2 deletions jdk/src/java.base/share/classes/java/math/BigInteger.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;

import sun.misc.DoubleConsts;
import sun.misc.FloatConsts;
import jdk.internal.math.DoubleConsts;
import jdk.internal.math.FloatConsts;
import jdk.internal.HotSpotIntrinsicCandidate;

/**
Expand Down
Loading

0 comments on commit 741ed62

Please sign in to comment.