mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
Merge
This commit is contained in:
commit
d92c6042fe
351 changed files with 2669 additions and 3430 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -455,7 +455,7 @@ public class Object {
|
|||
"nanosecond timeout value out of range");
|
||||
}
|
||||
|
||||
if (nanos > 0) {
|
||||
if (nanos > 0 && timeoutMillis < Long.MAX_VALUE) {
|
||||
timeoutMillis++;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ import java.util.Map;
|
|||
import java.util.HashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.LockSupport;
|
||||
|
||||
import jdk.internal.misc.TerminatingThreadLocal;
|
||||
|
@ -332,7 +333,7 @@ class Thread implements Runnable {
|
|||
"nanosecond timeout value out of range");
|
||||
}
|
||||
|
||||
if (nanos >= 500000 || (nanos != 0 && millis == 0)) {
|
||||
if (nanos > 0 && millis < Long.MAX_VALUE) {
|
||||
millis++;
|
||||
}
|
||||
|
||||
|
@ -1291,28 +1292,23 @@ class Thread implements Runnable {
|
|||
* <i>interrupted status</i> of the current thread is
|
||||
* cleared when this exception is thrown.
|
||||
*/
|
||||
public final synchronized void join(long millis)
|
||||
public final synchronized void join(final long millis)
|
||||
throws InterruptedException {
|
||||
long base = System.currentTimeMillis();
|
||||
long now = 0;
|
||||
|
||||
if (millis < 0) {
|
||||
throw new IllegalArgumentException("timeout value is negative");
|
||||
}
|
||||
|
||||
if (millis == 0) {
|
||||
if (millis > 0) {
|
||||
if (isAlive()) {
|
||||
final long startTime = System.nanoTime();
|
||||
long delay = millis;
|
||||
do {
|
||||
wait(delay);
|
||||
} while (isAlive() && (delay = millis -
|
||||
TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTime)) > 0);
|
||||
}
|
||||
} else if (millis == 0) {
|
||||
while (isAlive()) {
|
||||
wait(0);
|
||||
}
|
||||
} else {
|
||||
while (isAlive()) {
|
||||
long delay = millis - now;
|
||||
if (delay <= 0) {
|
||||
break;
|
||||
}
|
||||
wait(delay);
|
||||
now = System.currentTimeMillis() - base;
|
||||
}
|
||||
throw new IllegalArgumentException("timeout value is negative");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1353,7 +1349,7 @@ class Thread implements Runnable {
|
|||
"nanosecond timeout value out of range");
|
||||
}
|
||||
|
||||
if (nanos >= 500000 || (nanos != 0 && millis == 0)) {
|
||||
if (nanos > 0 && millis < Long.MAX_VALUE) {
|
||||
millis++;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,8 @@ public final class Paths {
|
|||
* Converts the given URI to a {@link Path} object.
|
||||
*
|
||||
* @implSpec
|
||||
* This method simply invokes {@link Path#of(URI) * Path.of(URI)} with the given parameter.
|
||||
* This method simply invokes {@link Path#of(URI) Path.of(URI)} with the
|
||||
* given parameter.
|
||||
*
|
||||
* @param uri
|
||||
* the URI to convert
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -351,7 +351,7 @@ public abstract class Identity implements Principal, Serializable {
|
|||
|
||||
/**
|
||||
* Tests for equality between the specified identity and this identity.
|
||||
* This method should be overriden by subclasses to test for equality.
|
||||
* This method should be overridden by subclasses to test for equality.
|
||||
* The default behavior is to return true if the names and public keys
|
||||
* are equal.
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -1318,7 +1318,7 @@ public abstract class Provider extends Properties {
|
|||
* {@code "putProviderProperty."+name}, where {@code name} is
|
||||
* the provider name, to see if it's ok to set this provider's property
|
||||
* values. If the default implementation of {@code checkSecurityAccess}
|
||||
* is used (that is, that method is not overriden), then this results in
|
||||
* is used (that is, that method is not overridden), then this results in
|
||||
* a call to the security manager's {@code checkPermission} method with
|
||||
* a {@code SecurityPermission("putProviderProperty."+name)}
|
||||
* permission.
|
||||
|
@ -1410,7 +1410,7 @@ public abstract class Provider extends Properties {
|
|||
* the provider name, to see if it's ok to remove this provider's
|
||||
* properties. If the default implementation of
|
||||
* {@code checkSecurityAccess} is used (that is, that method is not
|
||||
* overriden), then this results in a call to the security manager's
|
||||
* overridden), then this results in a call to the security manager's
|
||||
* {@code checkPermission} method with a
|
||||
* {@code SecurityPermission("removeProviderProperty."+name)}
|
||||
* permission.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -422,7 +422,7 @@ public final class Security {
|
|||
* method is called with the string {@code "removeProvider."+name}
|
||||
* to see if it's ok to remove the provider.
|
||||
* If the default implementation of {@code checkSecurityAccess}
|
||||
* is used (i.e., that method is not overriden), then this will result in
|
||||
* is used (i.e., that method is not overridden), then this will result in
|
||||
* a call to the security manager's {@code checkPermission} method
|
||||
* with a {@code SecurityPermission("removeProvider."+name)}
|
||||
* permission.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -348,7 +348,7 @@ public class RuleBasedCollator extends Collator{
|
|||
* Compares the character data stored in two different strings based on the
|
||||
* collation rules. Returns information about whether a string is less
|
||||
* than, greater than or equal to another string in a language.
|
||||
* This can be overriden in a subclass.
|
||||
* This can be overridden in a subclass.
|
||||
*
|
||||
* @exception NullPointerException if <code>source</code> or <code>target</code> is null.
|
||||
*/
|
||||
|
@ -567,7 +567,7 @@ public class RuleBasedCollator extends Collator{
|
|||
/**
|
||||
* Transforms the string into a series of characters that can be compared
|
||||
* with CollationKey.compareTo. This overrides java.text.Collator.getCollationKey.
|
||||
* It can be overriden in a subclass.
|
||||
* It can be overridden in a subclass.
|
||||
*/
|
||||
public synchronized CollationKey getCollationKey(String source)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -136,7 +136,7 @@ class Random implements java.io.Serializable {
|
|||
if (getClass() == Random.class)
|
||||
this.seed = new AtomicLong(initialScramble(seed));
|
||||
else {
|
||||
// subclass might have overriden setSeed
|
||||
// subclass might have overridden setSeed
|
||||
this.seed = new AtomicLong();
|
||||
setSeed(seed);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -77,7 +77,7 @@ public final class StringJoiner {
|
|||
private int len;
|
||||
|
||||
/**
|
||||
* When overriden by the user to be non-null via {@link setEmptyValue}, the
|
||||
* When overridden by the user to be non-null via {@link setEmptyValue}, the
|
||||
* string returned by toString() when no elements have yet been added.
|
||||
* When null, prefix + suffix is used as the empty value.
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -52,7 +52,7 @@ import javax.crypto.IllegalBlockSizeException;
|
|||
* method counts only data that have been processed by the encapsulated Cipher.
|
||||
*
|
||||
* <p> It is crucial for a programmer using this class not to use
|
||||
* methods that are not defined or overriden in this class (such as a
|
||||
* methods that are not defined or overridden in this class (such as a
|
||||
* new method or constructor that is later added to one of the super
|
||||
* classes), because the design and implementation of those methods
|
||||
* are unlikely to have considered security impact with regard to
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -53,7 +53,7 @@ import java.io.*;
|
|||
* alternative to using this class.
|
||||
*
|
||||
* <p> It is crucial for a programmer using this class not to use
|
||||
* methods that are not defined or overriden in this class (such as a
|
||||
* methods that are not defined or overridden in this class (such as a
|
||||
* new method or constructor that is later added to one of the super
|
||||
* classes), because the design and implementation of those methods
|
||||
* are unlikely to have considered security impact with regard to
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -46,7 +46,7 @@ import java.security.cert.X509Certificate;
|
|||
* However, the implementations can be replaced on a per-class (static) or
|
||||
* per-instance basis. All new <code>HttpsURLConnection</code>s instances
|
||||
* will be assigned
|
||||
* the "default" static values at instance creation, but they can be overriden
|
||||
* the "default" static values at instance creation, but they can be overridden
|
||||
* by calling the appropriate per-instance set method(s) before
|
||||
* <code>connect</code>ing.
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -48,7 +48,7 @@ import java.net.*;
|
|||
* authentication is necessary, and whether created sockets should
|
||||
* begin handshaking in client or server mode. The state
|
||||
* inherited by the created <code>SSLSocket</code> can be
|
||||
* overriden by calling the appropriate methods.
|
||||
* overridden by calling the appropriate methods.
|
||||
*
|
||||
* @see java.net.ServerSocket
|
||||
* @see SSLSocket
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -31,7 +31,7 @@ import java.security.Principal;
|
|||
* Abstract class that provides for extension of the X509KeyManager
|
||||
* interface.
|
||||
* <P>
|
||||
* Methods in this class should be overriden to provide actual
|
||||
* Methods in this class should be overridden to provide actual
|
||||
* implementations.
|
||||
*
|
||||
* @since 1.5
|
||||
|
|
|
@ -27,7 +27,6 @@ package sun.security.ssl;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.security.AccessController;
|
||||
import java.security.AlgorithmConstraints;
|
||||
import java.security.AlgorithmParameters;
|
||||
import java.security.CryptoPrimitive;
|
||||
|
@ -672,6 +671,11 @@ final class SupportedGroupsExtension {
|
|||
}
|
||||
|
||||
AlgorithmParameters params = namedGroupParams.get(namedGroup);
|
||||
if (params == null) {
|
||||
throw new RuntimeException(
|
||||
"Not a supported EC named group: " + namedGroup);
|
||||
}
|
||||
|
||||
try {
|
||||
return params.getParameterSpec(ECGenParameterSpec.class);
|
||||
} catch (InvalidParameterSpecException ipse) {
|
||||
|
@ -687,6 +691,11 @@ final class SupportedGroupsExtension {
|
|||
}
|
||||
|
||||
AlgorithmParameters params = namedGroupParams.get(namedGroup);
|
||||
if (params == null) {
|
||||
throw new RuntimeException(
|
||||
"Not a supported DH named group: " + namedGroup);
|
||||
}
|
||||
|
||||
try {
|
||||
return params.getParameterSpec(DHParameterSpec.class);
|
||||
} catch (InvalidParameterSpecException ipse) {
|
||||
|
@ -739,7 +748,7 @@ final class SupportedGroupsExtension {
|
|||
namedGroupParams.get(namedGroup));
|
||||
}
|
||||
|
||||
// Is there any supported group permitted by the constraints?
|
||||
// Is the named group supported?
|
||||
static boolean isSupported(NamedGroup namedGroup) {
|
||||
for (NamedGroup group : supportedNamedGroups) {
|
||||
if (namedGroup.id == group.id) {
|
||||
|
@ -757,6 +766,7 @@ final class SupportedGroupsExtension {
|
|||
for (NamedGroup namedGroup : requestedNamedGroups) {
|
||||
if ((namedGroup.type == type) &&
|
||||
namedGroup.isAvailable(negotiatedProtocol) &&
|
||||
isSupported(namedGroup) &&
|
||||
constraints.permits(
|
||||
EnumSet.of(CryptoPrimitive.KEY_AGREEMENT),
|
||||
namedGroup.algorithm,
|
||||
|
|
|
@ -281,7 +281,7 @@ public class CLDRTimeZoneNameProviderImpl extends TimeZoneNameProviderImpl {
|
|||
.replaceFirst("H+", (isShort ? "\\%1\\$d" : "\\%1\\$02d"))
|
||||
.replaceFirst("m+", "\\%2\\$02d");
|
||||
return MessageFormat.format(gmtFormat,
|
||||
String.format(hourFormat, offset / 60, offset % 60));
|
||||
String.format(l, hourFormat, offset / 60, offset % 60));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue