mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8220249: fix headings in java.compiler
Reviewed-by: erikj, darcy
This commit is contained in:
parent
7bb74f80da
commit
2df0f4b4dd
52 changed files with 250 additions and 250 deletions
|
@ -44,7 +44,7 @@ import jdk.internal.misc.VM;
|
|||
* and for converting characters from uppercase to lowercase and vice
|
||||
* versa.
|
||||
*
|
||||
* <h3><a id="conformance">Unicode Conformance</a></h3>
|
||||
* <h2><a id="conformance">Unicode Conformance</a></h2>
|
||||
* <p>
|
||||
* The fields and methods of class {@code Character} are defined in terms
|
||||
* of character information from the Unicode Standard, specifically the
|
||||
|
@ -59,7 +59,7 @@ import jdk.internal.misc.VM;
|
|||
* {@code U+32FF}, from the first version of the Unicode Standard
|
||||
* after 11.0 that assigns the code point.
|
||||
*
|
||||
* <h3><a id="unicode">Unicode Character Representations</a></h3>
|
||||
* <h2><a id="unicode">Unicode Character Representations</a></h2>
|
||||
*
|
||||
* <p>The {@code char} data type (and therefore the value that a
|
||||
* {@code Character} object encapsulates) are based on the
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2019, 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
|
||||
|
@ -126,7 +126,7 @@ import sun.security.util.SecurityConstants;
|
|||
* duration of the class loading process (see {@link #loadClass
|
||||
* loadClass} methods).
|
||||
*
|
||||
* <h3> <a id="builtinLoaders">Run-time Built-in Class Loaders</a></h3>
|
||||
* <h2> <a id="builtinLoaders">Run-time Built-in Class Loaders</a></h2>
|
||||
*
|
||||
* The Java run-time has the following built-in class loaders:
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2019, 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
|
||||
|
@ -120,7 +120,7 @@ import sun.security.util.SecurityConstants;
|
|||
* in this class causes a {@link NullPointerException NullPointerException} to
|
||||
* be thrown. </p>
|
||||
*
|
||||
* <h3> Example usage: </h3>
|
||||
* <h2> Example usage: </h2>
|
||||
*
|
||||
* <p> This example creates a configuration by resolving a module named
|
||||
* "{@code myapp}" with the configuration for the boot layer as the parent. It
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
|
||||
</head>
|
||||
<body>
|
||||
<h2 id="ValueBased">Value-based Classes</h2>
|
||||
<h1 id="ValueBased">Value-based Classes</h1>
|
||||
|
||||
Some classes, such as <code>java.util.Optional</code> and
|
||||
<code>java.time.LocalDateTime</code>, are <em>value-based</em>. Instances of a
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2005, 2019, 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
|
||||
|
@ -29,9 +29,9 @@
|
|||
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
|
||||
</head>
|
||||
<body>
|
||||
<h2>Java Thread Primitive Deprecation</h2>
|
||||
<h1>Java Thread Primitive Deprecation</h1>
|
||||
<hr>
|
||||
<h3>Why is <code>Thread.stop</code> deprecated?</h3>
|
||||
<h2>Why is <code>Thread.stop</code> deprecated?</h2>
|
||||
<p>Because it is inherently unsafe. Stopping a thread causes it to
|
||||
unlock all the monitors that it has locked. (The monitors are
|
||||
unlocked as the <code>ThreadDeath</code> exception propagates up
|
||||
|
@ -46,8 +46,8 @@ no warning that his program may be corrupted. The corruption can
|
|||
manifest itself at any time after the actual damage occurs, even
|
||||
hours or days in the future.</p>
|
||||
<hr>
|
||||
<h3>Couldn't I just catch the <code>ThreadDeath</code> exception
|
||||
and fix the damaged object?</h3>
|
||||
<h2>Couldn't I just catch the <code>ThreadDeath</code> exception
|
||||
and fix the damaged object?</h2>
|
||||
<p>In theory, perhaps, but it would <em>vastly</em> complicate the
|
||||
task of writing correct multithreaded code. The task would be
|
||||
nearly insurmountable for two reasons:</p>
|
||||
|
@ -62,7 +62,7 @@ it succeeded. The code to ensure this would be quite complex.</li>
|
|||
</ol>
|
||||
In sum, it just isn't practical.
|
||||
<hr>
|
||||
<h3>What should I use instead of <code>Thread.stop</code>?</h3>
|
||||
<h2>What should I use instead of <code>Thread.stop</code>?</h2>
|
||||
<p>Most uses of <code>stop</code> should be replaced by code that
|
||||
simply modifies some variable to indicate that the target thread
|
||||
should stop running. The target thread should check this variable
|
||||
|
@ -117,8 +117,8 @@ applet's <code>stop</code> and <code>run</code> methods with:
|
|||
}
|
||||
</pre>
|
||||
<hr>
|
||||
<h3>How do I stop a thread that waits for long periods (e.g., for
|
||||
input)?</h3>
|
||||
<h2>How do I stop a thread that waits for long periods (e.g., for
|
||||
input)?</h2>
|
||||
<p>That's what the <code>Thread.interrupt</code> method is for. The
|
||||
same "state based" signaling mechanism shown above can be used, but
|
||||
the state change (<code>blinker = null</code>, in the previous
|
||||
|
@ -145,8 +145,8 @@ following incantation:
|
|||
This ensures that the Thread will reraise the
|
||||
<code>InterruptedException</code> as soon as it is able.
|
||||
<hr>
|
||||
<h3>What if a thread doesn't respond to
|
||||
<code>Thread.interrupt</code>?</h3>
|
||||
<h2>What if a thread doesn't respond to
|
||||
<code>Thread.interrupt</code>?</h2>
|
||||
<p>In some cases, you can use application specific tricks. For
|
||||
example, if a thread is waiting on a known socket, you can close
|
||||
the socket to cause the thread to return immediately.
|
||||
|
@ -158,8 +158,8 @@ cases include deliberate denial-of-service attacks, and I/O
|
|||
operations for which thread.stop and thread.interrupt do not work
|
||||
properly.</p>
|
||||
<hr>
|
||||
<h3>Why are <code>Thread.suspend</code> and
|
||||
<code>Thread.resume</code> deprecated?</h3>
|
||||
<h2>Why are <code>Thread.suspend</code> and
|
||||
<code>Thread.resume</code> deprecated?</h2>
|
||||
<p><code>Thread.suspend</code> is inherently deadlock-prone. If the
|
||||
target thread holds a lock on the monitor protecting a critical
|
||||
system resource when it is suspended, no thread can access this
|
||||
|
@ -168,8 +168,8 @@ would resume the target thread attempts to lock this monitor prior
|
|||
to calling <code>resume</code>, deadlock results. Such deadlocks
|
||||
typically manifest themselves as "frozen" processes.</p>
|
||||
<hr>
|
||||
<h3>What should I use instead of <code>Thread.suspend</code> and
|
||||
<code>Thread.resume</code>?</h3>
|
||||
<h2>What should I use instead of <code>Thread.suspend</code> and
|
||||
<code>Thread.resume</code>?</h2>
|
||||
<p>As with <code>Thread.stop</code>, the prudent approach is to
|
||||
have the "target thread" poll a variable indicating the desired
|
||||
state of the thread (active or suspended). When the desired state
|
||||
|
@ -283,8 +283,8 @@ The resulting <code>run</code> method is:
|
|||
}
|
||||
</pre>
|
||||
<hr size="3" noshade="noshade" />
|
||||
<h3>Can I combine the two techniques to produce a thread that may
|
||||
be safely "stopped" or "suspended"?</h3>
|
||||
<h2>Can I combine the two techniques to produce a thread that may
|
||||
be safely "stopped" or "suspended"?</h2>
|
||||
Yes, it's reasonably straightforward. The one subtlety is that the
|
||||
target thread may already be suspended at the time that another
|
||||
thread tries to stop it. If the <code>stop</code> method merely sets
|
||||
|
|
|
@ -52,7 +52,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
|||
* {@linkplain java.lang.invoke.MethodHandles#dropArguments deletion},
|
||||
* and {@linkplain java.lang.invoke.MethodHandles#filterArguments substitution}.
|
||||
*
|
||||
* <h1>Method handle contents</h1>
|
||||
* <h2>Method handle contents</h2>
|
||||
* Method handles are dynamically and strongly typed according to their parameter and return types.
|
||||
* They are not distinguished by the name or the defining class of their underlying methods.
|
||||
* A method handle must be invoked using a symbolic type descriptor which matches
|
||||
|
@ -89,7 +89,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
|||
* from its specific class, as the method handle class hierarchy (if any)
|
||||
* may change from time to time or across implementations from different vendors.
|
||||
*
|
||||
* <h1>Method handle compilation</h1>
|
||||
* <h2>Method handle compilation</h2>
|
||||
* A Java method call expression naming {@code invokeExact} or {@code invoke}
|
||||
* can invoke a method handle from Java source code.
|
||||
* From the viewpoint of source code, these methods can take any arguments
|
||||
|
@ -121,7 +121,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
|||
* The ambiguity with the type {@code Void} is harmless, since there are no references of type
|
||||
* {@code Void} except the null reference.
|
||||
*
|
||||
* <h1>Method handle invocation</h1>
|
||||
* <h2>Method handle invocation</h2>
|
||||
* The first time an {@code invokevirtual} instruction is executed
|
||||
* it is linked by symbolically resolving the names in the instruction
|
||||
* and verifying that the method call is statically legal.
|
||||
|
@ -164,7 +164,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
|||
* (<em>Note:</em> The adjusted method handle {@code M2} is not directly observable,
|
||||
* and implementations are therefore not required to materialize it.)
|
||||
*
|
||||
* <h1>Invocation checking</h1>
|
||||
* <h2>Invocation checking</h2>
|
||||
* In typical programs, method handle type matching will usually succeed.
|
||||
* But if a match fails, the JVM will throw a {@link WrongMethodTypeException},
|
||||
* either directly (in the case of {@code invokeExact}) or indirectly as if
|
||||
|
@ -205,7 +205,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
|||
* They should not be passed to untrusted code unless their use from
|
||||
* the untrusted code would be harmless.
|
||||
*
|
||||
* <h1>Method handle creation</h1>
|
||||
* <h2>Method handle creation</h2>
|
||||
* Java code can create a method handle that directly accesses
|
||||
* any method, constructor, or field that is accessible to that code.
|
||||
* This is done via a reflective, capability-based API called
|
||||
|
@ -263,7 +263,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
|||
* of an {@code invokevirtual} or {@code invokeinterface} instruction on
|
||||
* a private method (as applicable).
|
||||
*
|
||||
* <h1>Usage examples</h1>
|
||||
* <h2>Usage examples</h2>
|
||||
* Here are some examples of usage:
|
||||
* <blockquote><pre>{@code
|
||||
Object x, y; String s; int i;
|
||||
|
@ -309,7 +309,7 @@ mh.invokeExact(System.out, "Hello, world.");
|
|||
* be a method which calls {@link java.util.Objects#equals(Object,Object) Objects.equals}
|
||||
* on its arguments, and asserts that the result is true.
|
||||
*
|
||||
* <h1>Exceptions</h1>
|
||||
* <h2>Exceptions</h2>
|
||||
* The methods {@code invokeExact} and {@code invoke} are declared
|
||||
* to throw {@link java.lang.Throwable Throwable},
|
||||
* which is to say that there is no static restriction on what a method handle
|
||||
|
@ -322,7 +322,7 @@ mh.invokeExact(System.out, "Hello, world.");
|
|||
* throwables locally, rethrowing only those which are legal in the context,
|
||||
* and wrapping ones which are illegal.
|
||||
*
|
||||
* <h1><a id="sigpoly"></a>Signature polymorphism</h1>
|
||||
* <h2><a id="sigpoly"></a>Signature polymorphism</h2>
|
||||
* The unusual compilation and linkage behavior of
|
||||
* {@code invokeExact} and plain {@code invoke}
|
||||
* is referenced by the term <em>signature polymorphism</em>.
|
||||
|
@ -347,7 +347,7 @@ mh.invokeExact(System.out, "Hello, world.");
|
|||
* Tools which determine symbolic linkage are required to accept such
|
||||
* untransformed descriptors, without reporting linkage errors.
|
||||
*
|
||||
* <h1>Interoperation between method handles and the Core Reflection API</h1>
|
||||
* <h2>Interoperation between method handles and the Core Reflection API</h2>
|
||||
* Using factory methods in the {@link java.lang.invoke.MethodHandles.Lookup Lookup} API,
|
||||
* any class member represented by a Core Reflection API object
|
||||
* can be converted to a behaviorally equivalent method handle.
|
||||
|
@ -389,7 +389,7 @@ mh.invokeExact(System.out, "Hello, world.");
|
|||
* to call {@code invokeExact} or plain {@code invoke},
|
||||
* for any specified type descriptor .
|
||||
*
|
||||
* <h1>Interoperation between method handles and Java generics</h1>
|
||||
* <h2>Interoperation between method handles and Java generics</h2>
|
||||
* A method handle can be obtained on a method, constructor, or field
|
||||
* which is declared with Java generic types.
|
||||
* As with the Core Reflection API, the type of the method handle
|
||||
|
@ -416,7 +416,7 @@ mh.invokeExact(System.out, "Hello, world.");
|
|||
* genericity with a Java type parameter.</li>
|
||||
* </ul>
|
||||
*
|
||||
* <h1><a id="maxarity"></a>Arity limits</h1>
|
||||
* <h2><a id="maxarity"></a>Arity limits</h2>
|
||||
* The JVM imposes on all methods and constructors of any kind an absolute
|
||||
* limit of 255 stacked arguments. This limit can appear more restrictive
|
||||
* in certain cases:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2019, 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
|
||||
|
@ -35,7 +35,7 @@ import static java.lang.invoke.MethodHandleStatics.*;
|
|||
* A symbolic reference obtained by cracking a direct method handle
|
||||
* into its consitutent symbolic parts.
|
||||
* To crack a direct method handle, call {@link Lookup#revealDirect Lookup.revealDirect}.
|
||||
* <h1><a id="directmh"></a>Direct Method Handles</h1>
|
||||
* <h2><a id="directmh"></a>Direct Method Handles</h2>
|
||||
* A <em>direct method handle</em> represents a method, constructor, or field without
|
||||
* any intervening argument bindings or other transformations.
|
||||
* The method, constructor, or field referred to by a direct method handle is called
|
||||
|
@ -58,7 +58,7 @@ import static java.lang.invoke.MethodHandleStatics.*;
|
|||
* to convert a {@link Field} into a method handle.
|
||||
* </ul>
|
||||
*
|
||||
* <h1>Restrictions on Cracking</h1>
|
||||
* <h2>Restrictions on Cracking</h2>
|
||||
* Given a suitable {@code Lookup} object, it is possible to crack any direct method handle
|
||||
* to recover a symbolic reference for the underlying method, constructor, or field.
|
||||
* Cracking must be done via a {@code Lookup} object equivalent to that which created
|
||||
|
@ -77,7 +77,7 @@ import static java.lang.invoke.MethodHandleStatics.*;
|
|||
* handle with symbolic information (or caller binding) from an unexpected scope.
|
||||
* Use {@link java.lang.invoke.MethodHandles#reflectAs} to override this limitation.
|
||||
*
|
||||
* <h1><a id="refkinds"></a>Reference kinds</h1>
|
||||
* <h2><a id="refkinds"></a>Reference kinds</h2>
|
||||
* The <a href="MethodHandles.Lookup.html#lookups">Lookup Factory Methods</a>
|
||||
* correspond to all major use cases for methods, constructors, and fields.
|
||||
* These use cases may be distinguished using small integers as follows:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2019, 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
|
||||
|
@ -268,7 +268,7 @@ public class MethodHandles {
|
|||
* This includes all methods, constructors, and fields which are allowed to the lookup class,
|
||||
* even private ones.
|
||||
*
|
||||
* <h1><a id="lookups"></a>Lookup Factory Methods</h1>
|
||||
* <h2><a id="lookups"></a>Lookup Factory Methods</h2>
|
||||
* The factory methods on a {@code Lookup} object correspond to all major
|
||||
* use cases for methods, constructors, and fields.
|
||||
* Each method handle created by a factory method is the functional
|
||||
|
@ -395,7 +395,7 @@ public class MethodHandles {
|
|||
* <a href="MethodHandle.html#maxarity">too many parameters.</a>
|
||||
* </ul>
|
||||
*
|
||||
* <h1><a id="access"></a>Access checking</h1>
|
||||
* <h2><a id="access"></a>Access checking</h2>
|
||||
* Access checks are applied in the factory methods of {@code Lookup},
|
||||
* when a method handle is created.
|
||||
* This is a key difference from the Core Reflection API, since
|
||||
|
@ -529,7 +529,7 @@ public class MethodHandles {
|
|||
* whose <a href="MethodHandles.Lookup.html#equiv">bytecode behaviors</a> and Java language access permissions
|
||||
* can be reliably determined and emulated by method handles.
|
||||
*
|
||||
* <h1><a id="secmgr"></a>Security manager interactions</h1>
|
||||
* <h2><a id="secmgr"></a>Security manager interactions</h2>
|
||||
* Although bytecode instructions can only refer to classes in
|
||||
* a related class loader, this API can search for methods in any
|
||||
* class, as long as a reference to its {@code Class} object is
|
||||
|
@ -588,7 +588,7 @@ public class MethodHandles {
|
|||
* or else that is being accessed from a lookup class that has
|
||||
* rights to access the member or class.
|
||||
*
|
||||
* <h1><a id="callsens"></a>Caller sensitive methods</h1>
|
||||
* <h2><a id="callsens"></a>Caller sensitive methods</h2>
|
||||
* A small number of Java methods have a special property called caller sensitivity.
|
||||
* A <em>caller-sensitive</em> method can behave differently depending on the
|
||||
* identity of its immediate caller.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2019, 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
|
||||
|
@ -197,7 +197,7 @@ public class MutableCallSite extends CallSite {
|
|||
* processed before the method returns abnormally.
|
||||
* Which elements these are (if any) is implementation-dependent.
|
||||
*
|
||||
* <h1>Java Memory Model details</h1>
|
||||
* <h4>Java Memory Model details</h4>
|
||||
* In terms of the Java Memory Model, this operation performs a synchronization
|
||||
* action which is comparable in effect to the writing of a volatile variable
|
||||
* by the current thread, and an eventual volatile read by every other thread
|
||||
|
|
|
@ -234,7 +234,7 @@ import static java.lang.invoke.MethodHandleStatics.UNSAFE;
|
|||
* precise phrasing of the specification of access mode methods and memory fence
|
||||
* methods may accompany future updates of the Java Language Specification.
|
||||
*
|
||||
* <h1>Compiling invocation of access mode methods</h1>
|
||||
* <h2>Compiling invocation of access mode methods</h2>
|
||||
* A Java method call expression naming an access mode method can invoke a
|
||||
* VarHandle from Java source code. From the viewpoint of source code, these
|
||||
* methods can take any arguments and their polymorphic result (if expressed)
|
||||
|
@ -266,7 +266,7 @@ import static java.lang.invoke.MethodHandleStatics.UNSAFE;
|
|||
* except the null reference.
|
||||
*
|
||||
*
|
||||
* <h1><a id="invoke">Performing invocation of access mode methods</a></h1>
|
||||
* <h2><a id="invoke">Performing invocation of access mode methods</a></h2>
|
||||
* The first time an {@code invokevirtual} instruction is executed it is linked
|
||||
* by symbolically resolving the names in the instruction and verifying that
|
||||
* the method call is statically legal. This also holds for calls to access mode
|
||||
|
@ -329,7 +329,7 @@ import static java.lang.invoke.MethodHandleStatics.UNSAFE;
|
|||
* Where, in this case, the method handle is bound to the VarHandle instance.
|
||||
*
|
||||
*
|
||||
* <h1>Invocation checking</h1>
|
||||
* <h2>Invocation checking</h2>
|
||||
* In typical programs, VarHandle access mode type matching will usually
|
||||
* succeed. But if a match fails, the JVM will throw a
|
||||
* {@link WrongMethodTypeException}.
|
||||
|
@ -364,7 +364,7 @@ import static java.lang.invoke.MethodHandleStatics.UNSAFE;
|
|||
* untrusted code unless their use from the untrusted code would be harmless.
|
||||
*
|
||||
*
|
||||
* <h1>VarHandle creation</h1>
|
||||
* <h2>VarHandle creation</h2>
|
||||
* Java code can create a VarHandle that directly accesses any field that is
|
||||
* accessible to that code. This is done via a reflective, capability-based
|
||||
* API called {@link java.lang.invoke.MethodHandles.Lookup
|
||||
|
@ -383,7 +383,7 @@ import static java.lang.invoke.MethodHandleStatics.UNSAFE;
|
|||
* class outside the current package, the receiver argument will be narrowed to
|
||||
* the type of the accessing class.
|
||||
*
|
||||
* <h1>Interoperation between VarHandles and the Core Reflection API</h1>
|
||||
* <h2>Interoperation between VarHandles and the Core Reflection API</h2>
|
||||
* Using factory methods in the {@link java.lang.invoke.MethodHandles.Lookup
|
||||
* Lookup} API, any field represented by a Core Reflection API object
|
||||
* can be converted to a behaviorally equivalent VarHandle.
|
||||
|
@ -428,7 +428,7 @@ import static java.lang.invoke.MethodHandleStatics.UNSAFE;
|
|||
* any specified access mode type and is equivalent in behaviour to
|
||||
* {@link java.lang.invoke.MethodHandles#varHandleInvoker}.
|
||||
*
|
||||
* <h1>Interoperation between VarHandles and Java generics</h1>
|
||||
* <h2>Interoperation between VarHandles and Java generics</h2>
|
||||
* A VarHandle can be obtained for a variable, such as a field, which is
|
||||
* declared with Java generic types. As with the Core Reflection API, the
|
||||
* VarHandle's variable type will be constructed from the erasure of the
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2019, 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,12 +53,12 @@
|
|||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* <h1><a id="jvm_mods"></a>Dynamic resolution of call sites and constants</h1>
|
||||
* <h2><a id="jvm_mods"></a>Dynamic resolution of call sites and constants</h2>
|
||||
* The following low-level information summarizes relevant parts of the
|
||||
* Java Virtual Machine specification. For full details, please see the
|
||||
* current version of that specification.
|
||||
*
|
||||
* <h2><a id="indyinsn"></a>Dynamically-computed call sites</h2>
|
||||
* <h3><a id="indyinsn"></a>Dynamically-computed call sites</h3>
|
||||
* An {@code invokedynamic} instruction is originally in an unlinked state.
|
||||
* In this state, there is no target method for the instruction to invoke.
|
||||
* <p>
|
||||
|
@ -74,7 +74,7 @@
|
|||
* The constant pool reference also specifies the invocation's name and method type descriptor,
|
||||
* just like {@code invokestatic} and the other invoke instructions.
|
||||
*
|
||||
* <h2><a id="condycon"></a>Dynamically-computed constants</h2>
|
||||
* <h3><a id="condycon"></a>Dynamically-computed constants</h3>
|
||||
* The constant pool may contain constants tagged {@code CONSTANT_Dynamic},
|
||||
* equipped with bootstrap methods which perform their resolution.
|
||||
* Such a <em>dynamic constant</em> is originally in an unresolved state.
|
||||
|
@ -90,7 +90,7 @@
|
|||
* (Roughly speaking, a dynamically-computed constant is to a dynamically-computed call site
|
||||
* as a {@code CONSTANT_Fieldref} is to a {@code CONSTANT_Methodref}.)
|
||||
*
|
||||
* <h2><a id="bsm"></a>Execution of bootstrap methods</h2>
|
||||
* <h3><a id="bsm"></a>Execution of bootstrap methods</h3>
|
||||
* Resolving a dynamically-computed call site or constant
|
||||
* starts with resolving constants from the constant pool for the
|
||||
* following items:
|
||||
|
@ -136,7 +136,7 @@
|
|||
* subsequent attempts to execute the {@code invokedynamic} instruction or load the
|
||||
* dynamically-computed constant.
|
||||
*
|
||||
* <h2>Timing of resolution</h2>
|
||||
* <h3>Timing of resolution</h3>
|
||||
* An {@code invokedynamic} instruction is linked just before its first execution.
|
||||
* A dynamically-computed constant is resolved just before the first time it is used
|
||||
* (by pushing it on the stack or linking it as a bootstrap method parameter).
|
||||
|
@ -171,7 +171,7 @@
|
|||
* just before its first invocation.
|
||||
* There is no way to undo the effect of a completed bootstrap method call.
|
||||
*
|
||||
* <h2>Types of bootstrap methods</h2>
|
||||
* <h3>Types of bootstrap methods</h3>
|
||||
* For a dynamically-computed call site, the bootstrap method is invoked with parameter
|
||||
* types {@code MethodHandles.Lookup}, {@code String}, {@code MethodType}, and the types
|
||||
* of any static arguments; the return type is {@code CallSite}.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2019, 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
|
||||
|
@ -75,7 +75,7 @@ import jdk.internal.vm.annotation.Stable;
|
|||
* ModuleLayer.boot().configuration()}. The configuration for the boot layer
|
||||
* will often be the parent when creating new configurations. </p>
|
||||
*
|
||||
* <h3> Example </h3>
|
||||
* <h2> Example </h2>
|
||||
*
|
||||
* <p> The following example uses the {@link
|
||||
* #resolve(ModuleFinder,ModuleFinder,Collection) resolve} method to resolve a
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2019, 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
|
||||
|
@ -34,7 +34,7 @@
|
|||
* will cause a {@code NullPointerException}, unless otherwise specified. </p>
|
||||
*
|
||||
*
|
||||
* <h1><a id="resolution"></a>{@index "Module Resolution"}</h1>
|
||||
* <h2><a id="resolution"></a>{@index "Module Resolution"}</h2>
|
||||
*
|
||||
* <p> Resolution is the process of computing how modules depend on each other.
|
||||
* The process occurs at compile time and run time. </p>
|
||||
|
@ -45,7 +45,7 @@
|
|||
* The readability graph embodies how modules depend on each other, which in
|
||||
* turn controls access across module boundaries. </p>
|
||||
*
|
||||
* <h2> Step 1: Recursive enumeration </h2>
|
||||
* <h3> Step 1: Recursive enumeration </h3>
|
||||
*
|
||||
* <p> Recursive enumeration takes a set of module names, looks up each of their
|
||||
* module declarations, and for each module declaration, recursively enumerates:
|
||||
|
@ -91,7 +91,7 @@
|
|||
*
|
||||
* <p> Otherwise, resolution proceeds to step 2. </p>
|
||||
*
|
||||
* <h2> Step 2: Computing the readability graph </h2>
|
||||
* <h3> Step 2: Computing the readability graph </h3>
|
||||
*
|
||||
* <p> A 'requires' directive (irrespective of 'transitive') expresses that
|
||||
* one module depends on some other module. The effect of the 'transitive'
|
||||
|
@ -147,7 +147,7 @@
|
|||
* <p> Otherwise, resolution succeeds, and the result of resolution is the
|
||||
* readability graph.
|
||||
*
|
||||
* <h2> Root modules </h2>
|
||||
* <h3> Root modules </h3>
|
||||
*
|
||||
* <p> The set of root modules at compile-time is usually the set of modules
|
||||
* being compiled. At run-time, the set of root modules is usually the
|
||||
|
@ -158,7 +158,7 @@
|
|||
* that is observable on the upgrade module path or among the system modules,
|
||||
* and that exports at least one package without qualification. </p>
|
||||
*
|
||||
* <h2> Observable modules </h2>
|
||||
* <h3> Observable modules </h3>
|
||||
*
|
||||
* <p> The set of observable modules at both compile-time and run-time is
|
||||
* determined by searching several different paths, and also by searching
|
||||
|
@ -183,7 +183,7 @@
|
|||
*
|
||||
* </ol>
|
||||
*
|
||||
* <h2> 'requires' directives with 'static' modifier </h2>
|
||||
* <h3> 'requires' directives with 'static' modifier </h3>
|
||||
*
|
||||
* <p> 'requires' directives that have the 'static' modifier express an optional
|
||||
* dependence at run time. If a module declares that it 'requires static M' then
|
||||
|
@ -191,7 +191,7 @@
|
|||
* However, if M is recursively enumerated at step 1 then all modules that are
|
||||
* enumerated and `requires static M` will read M. </p>
|
||||
*
|
||||
* <h2> Completeness </h2>
|
||||
* <h3> Completeness </h3>
|
||||
*
|
||||
* <p> Resolution may be partial at compile-time in that the complete transitive
|
||||
* closure may not be required to compile a set of modules. Minimally, the
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2019, 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
|
||||
|
@ -156,7 +156,7 @@ import static java.lang.module.ModuleDescriptor.Modifier.SYNTHETIC;
|
|||
* like they do for instances of {@code java.lang.Object}.
|
||||
* </ul>
|
||||
*
|
||||
* <h3><a id="membership">Package and Module Membership of Proxy Class</a></h3>
|
||||
* <h2><a id="membership">Package and Module Membership of Proxy Class</a></h2>
|
||||
*
|
||||
* The package and module to which a proxy class belongs are chosen such that
|
||||
* the accessibility of the proxy class is in line with the accessibility of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue