mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
Merge
This commit is contained in:
commit
414e05f6d7
1018 changed files with 27214 additions and 7501 deletions
|
@ -1876,14 +1876,15 @@ public abstract class ClassLoader {
|
|||
* value until the system is fully initialized.
|
||||
*
|
||||
* <p> The name of the built-in system class loader is {@code "app"}.
|
||||
* The class path used by the built-in system class loader is determined
|
||||
* by the system property "{@code java.class.path}" during early
|
||||
* initialization of the VM. If the system property is not defined,
|
||||
* or its value is an empty string, then there is no class path
|
||||
* when the initial module is a module on the application module path,
|
||||
* i.e. <em>a named module</em>. If the initial module is not on
|
||||
* the application module path then the class path defaults to
|
||||
* the current working directory.
|
||||
* The system property "{@code java.class.path}" is read during early
|
||||
* initialization of the VM to determine the class path.
|
||||
* An empty value of "{@code java.class.path}" property is interpreted
|
||||
* differently depending on whether the initial module (the module
|
||||
* containing the main class) is named or unnamed:
|
||||
* If named, the built-in system class loader will have no class path and
|
||||
* will search for classes and resources using the application module path;
|
||||
* otherwise, if unnamed, it will set the class path to the current
|
||||
* working directory.
|
||||
*
|
||||
* @return The system {@code ClassLoader}
|
||||
*
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -631,7 +631,8 @@ public final class System {
|
|||
* <tr><th scope="row"><code>java.class.version</code></th>
|
||||
* <td>Java class format version number</td></tr>
|
||||
* <tr><th scope="row"><code>java.class.path</code></th>
|
||||
* <td>Java class path</td></tr>
|
||||
* <td>Java class path (refer to
|
||||
* {@link ClassLoader#getSystemClassLoader()} for details)</td></tr>
|
||||
* <tr><th scope="row"><code>java.library.path</code></th>
|
||||
* <td>List of paths to search when loading libraries</td></tr>
|
||||
* <tr><th scope="row"><code>java.io.tmpdir</code></th>
|
||||
|
|
|
@ -166,15 +166,8 @@ class VersionProps {
|
|||
* Print version info.
|
||||
*/
|
||||
private static void print(boolean err, boolean newln) {
|
||||
boolean isHeadless = false;
|
||||
PrintStream ps = err ? System.err : System.out;
|
||||
|
||||
/* Report that we're running headless if the property is true */
|
||||
String headless = System.getProperty("java.awt.headless");
|
||||
if ( (headless != null) && (headless.equalsIgnoreCase("true")) ) {
|
||||
isHeadless = true;
|
||||
}
|
||||
|
||||
/* First line: platform version. */
|
||||
if (err) {
|
||||
ps.println(launcher_name + " version \"" + java_version + "\""
|
||||
|
|
|
@ -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