mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
Merge
This commit is contained in:
commit
8f528fba93
608 changed files with 7528 additions and 3300 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1995, 2017, 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
|
||||
|
@ -1099,16 +1099,23 @@ public class Runtime {
|
|||
m.group(VersionPattern.OPT_GROUP));
|
||||
|
||||
// empty '+'
|
||||
if ((m.group(VersionPattern.PLUS_GROUP) != null)
|
||||
&& !build.isPresent()) {
|
||||
if (optional.isPresent()) {
|
||||
if (pre.isPresent())
|
||||
throw new IllegalArgumentException("'+' found with"
|
||||
+ " pre-release and optional components:'" + s
|
||||
+ "'");
|
||||
if (!build.isPresent()) {
|
||||
if (m.group(VersionPattern.PLUS_GROUP) != null) {
|
||||
if (optional.isPresent()) {
|
||||
if (pre.isPresent())
|
||||
throw new IllegalArgumentException("'+' found with"
|
||||
+ " pre-release and optional components:'" + s
|
||||
+ "'");
|
||||
} else {
|
||||
throw new IllegalArgumentException("'+' found with neither"
|
||||
+ " build or optional components: '" + s + "'");
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("'+' found with neither"
|
||||
+ " build or optional components: '" + s + "'");
|
||||
if (optional.isPresent() && !pre.isPresent()) {
|
||||
throw new IllegalArgumentException("optional component"
|
||||
+ " must be preceeded by a pre-release component"
|
||||
+ " or '+': '" + s + "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Version(List.of(version), pre, build, optional);
|
||||
|
|
|
@ -1667,6 +1667,7 @@ assertEquals("[three, thee, tee]", asListFix.invoke((Object)argv).toString());
|
|||
/** Craft a LambdaForm customized for this particular MethodHandle */
|
||||
/*non-public*/
|
||||
void customize() {
|
||||
final LambdaForm form = this.form;
|
||||
if (form.customized == null) {
|
||||
LambdaForm newForm = form.customize(this);
|
||||
updateForm(newForm);
|
||||
|
|
|
@ -3766,6 +3766,7 @@ assertEquals("xy", h3.invoke("x", "y", 1, "a", "b", "c"));
|
|||
* specified in the elements of the {@code filters} array.
|
||||
* The first element of the filter array corresponds to the {@code pos}
|
||||
* argument of the target, and so on in sequence.
|
||||
* The filter functions are invoked in left to right order.
|
||||
* <p>
|
||||
* Null arguments in the array are treated as identity functions,
|
||||
* and the corresponding arguments left unchanged.
|
||||
|
@ -3836,11 +3837,12 @@ assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY
|
|||
MethodHandle filterArguments(MethodHandle target, int pos, MethodHandle... filters) {
|
||||
filterArgumentsCheckArity(target, pos, filters);
|
||||
MethodHandle adapter = target;
|
||||
int curPos = pos-1; // pre-incremented
|
||||
for (MethodHandle filter : filters) {
|
||||
curPos += 1;
|
||||
// process filters in reverse order so that the invocation of
|
||||
// the resulting adapter will invoke the filters in left-to-right order
|
||||
for (int i = filters.length - 1; i >= 0; --i) {
|
||||
MethodHandle filter = filters[i];
|
||||
if (filter == null) continue; // ignore null elements of filters
|
||||
adapter = filterArgument(adapter, curPos, filter);
|
||||
adapter = filterArgument(adapter, pos + i, filter);
|
||||
}
|
||||
return adapter;
|
||||
}
|
||||
|
|
|
@ -2521,7 +2521,7 @@ public class ModuleDescriptor
|
|||
* the {@code packageFinder} throws an {@link UncheckedIOException} then
|
||||
* {@link IOException} cause will be re-thrown. </p>
|
||||
*
|
||||
* <p> The module descriptor is read from the buffer stating at index
|
||||
* <p> The module descriptor is read from the buffer starting at index
|
||||
* {@code p}, where {@code p} is the buffer's {@link ByteBuffer#position()
|
||||
* position} when this method is invoked. Upon return the buffer's position
|
||||
* will be equal to {@code p + n} where {@code n} is the number of bytes
|
||||
|
|
|
@ -140,14 +140,6 @@ public abstract class Reference<T> {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* system property to disable clearing before enqueuing.
|
||||
*/
|
||||
private static final class ClearBeforeEnqueue {
|
||||
static final boolean DISABLE =
|
||||
Boolean.getBoolean("jdk.lang.ref.disableClearBeforeEnqueue");
|
||||
}
|
||||
|
||||
/*
|
||||
* Atomically get and clear (set to null) the VM's pending list.
|
||||
*/
|
||||
|
@ -299,8 +291,7 @@ public abstract class Reference<T> {
|
|||
* it was not registered with a queue when it was created
|
||||
*/
|
||||
public boolean enqueue() {
|
||||
if (!ClearBeforeEnqueue.DISABLE)
|
||||
this.referent = null;
|
||||
this.referent = null;
|
||||
return this.queue.enqueue(this);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue