mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8134356: {@code} tag contains < and > sequences
Reviewed-by: martin
This commit is contained in:
parent
572aef810c
commit
9073b652b3
8 changed files with 49 additions and 49 deletions
|
@ -9356,7 +9356,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
|
||||||
* <td>{@code FORM FEED}</td></tr>
|
* <td>{@code FORM FEED}</td></tr>
|
||||||
* <tr><td>{@code '\r'}</td> <td>{@code U+000D}</td>
|
* <tr><td>{@code '\r'}</td> <td>{@code U+000D}</td>
|
||||||
* <td>{@code CARRIAGE RETURN}</td></tr>
|
* <td>{@code CARRIAGE RETURN}</td></tr>
|
||||||
* <tr><td>{@code ' '}</td> <td>{@code U+0020}</td>
|
* <tr><td>{@code ' '}</td> <td>{@code U+0020}</td>
|
||||||
* <td>{@code SPACE}</td></tr>
|
* <td>{@code SPACE}</td></tr>
|
||||||
* </table>
|
* </table>
|
||||||
*
|
*
|
||||||
|
|
|
@ -93,7 +93,7 @@ import java.util.Objects;
|
||||||
/** Return the simple name of this member.
|
/** Return the simple name of this member.
|
||||||
* For a type, it is the same as {@link Class#getSimpleName}.
|
* For a type, it is the same as {@link Class#getSimpleName}.
|
||||||
* For a method or field, it is the simple name of the member.
|
* For a method or field, it is the simple name of the member.
|
||||||
* For a constructor, it is always {@code "<init>"}.
|
* For a constructor, it is always {@code "<init>"}.
|
||||||
*/
|
*/
|
||||||
public String getName() {
|
public String getName() {
|
||||||
if (name == null) {
|
if (name == null) {
|
||||||
|
@ -727,7 +727,7 @@ import java.util.Objects;
|
||||||
}
|
}
|
||||||
/** Create a method or constructor name from the given components:
|
/** Create a method or constructor name from the given components:
|
||||||
* Declaring class, name, type, reference kind.
|
* Declaring class, name, type, reference kind.
|
||||||
* It will be a constructor if and only if the name is {@code "<init>"}.
|
* It will be a constructor if and only if the name is {@code "<init>"}.
|
||||||
* The declaring class may be supplied as null if this is to be a bare name and type.
|
* The declaring class may be supplied as null if this is to be a bare name and type.
|
||||||
* The last argument is optional, a boolean which requests REF_invokeSpecial.
|
* The last argument is optional, a boolean which requests REF_invokeSpecial.
|
||||||
* The resulting name will in an unresolved state.
|
* The resulting name will in an unresolved state.
|
||||||
|
|
|
@ -155,7 +155,7 @@ interface MethodHandleInfo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name of the cracked method handle's underlying member.
|
* Returns the name of the cracked method handle's underlying member.
|
||||||
* This is {@code "<init>"} if the underlying member was a constructor,
|
* This is {@code "<init>"} if the underlying member was a constructor,
|
||||||
* else it is a simple method name or field name.
|
* else it is a simple method name or field name.
|
||||||
* @return the simple name of the underlying member
|
* @return the simple name of the underlying member
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -51,7 +51,7 @@ import java.lang.annotation.*;
|
||||||
* If the field is an array type, then both the field value and
|
* If the field is an array type, then both the field value and
|
||||||
* all the components of the field value (if the field value is non-null)
|
* all the components of the field value (if the field value is non-null)
|
||||||
* are indicated to be stable.
|
* are indicated to be stable.
|
||||||
* If the field type is an array type with rank {@code N > 1},
|
* If the field type is an array type with rank {@code N > 1},
|
||||||
* then each component of the field value (if the field value is non-null),
|
* then each component of the field value (if the field value is non-null),
|
||||||
* is regarded as a stable array of rank {@code N-1}.
|
* is regarded as a stable array of rank {@code N-1}.
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
@ -55,20 +55,20 @@ package java.lang.invoke;
|
||||||
* At that point {@code guardWithTest} may ignore {@code T} and return {@code F}.
|
* At that point {@code guardWithTest} may ignore {@code T} and return {@code F}.
|
||||||
* <p>
|
* <p>
|
||||||
* Here is an example of a switch point in action:
|
* Here is an example of a switch point in action:
|
||||||
* <blockquote><pre>{@code
|
* <pre>{@code
|
||||||
MethodHandle MH_strcat = MethodHandles.lookup()
|
* MethodHandle MH_strcat = MethodHandles.lookup()
|
||||||
.findVirtual(String.class, "concat", MethodType.methodType(String.class, String.class));
|
* .findVirtual(String.class, "concat", MethodType.methodType(String.class, String.class));
|
||||||
SwitchPoint spt = new SwitchPoint();
|
* SwitchPoint spt = new SwitchPoint();
|
||||||
assert(!spt.hasBeenInvalidated());
|
* assert(!spt.hasBeenInvalidated());
|
||||||
// the following steps may be repeated to re-use the same switch point:
|
* // the following steps may be repeated to re-use the same switch point:
|
||||||
MethodHandle worker1 = MH_strcat;
|
* MethodHandle worker1 = MH_strcat;
|
||||||
MethodHandle worker2 = MethodHandles.permuteArguments(MH_strcat, MH_strcat.type(), 1, 0);
|
* MethodHandle worker2 = MethodHandles.permuteArguments(MH_strcat, MH_strcat.type(), 1, 0);
|
||||||
MethodHandle worker = spt.guardWithTest(worker1, worker2);
|
* MethodHandle worker = spt.guardWithTest(worker1, worker2);
|
||||||
assertEquals("method", (String) worker.invokeExact("met", "hod"));
|
* assertEquals("method", (String) worker.invokeExact("met", "hod"));
|
||||||
SwitchPoint.invalidateAll(new SwitchPoint[]{ spt });
|
* SwitchPoint.invalidateAll(new SwitchPoint[]{ spt });
|
||||||
assert(spt.hasBeenInvalidated());
|
* assert(spt.hasBeenInvalidated());
|
||||||
assertEquals("hodmet", (String) worker.invokeExact("met", "hod"));
|
* assertEquals("hodmet", (String) worker.invokeExact("met", "hod"));
|
||||||
* }</pre></blockquote>
|
* }</pre>
|
||||||
* <p style="font-size:smaller;">
|
* <p style="font-size:smaller;">
|
||||||
* <em>Discussion:</em>
|
* <em>Discussion:</em>
|
||||||
* Switch points are useful without subclassing. They may also be subclassed.
|
* Switch points are useful without subclassing. They may also be subclassed.
|
||||||
|
@ -82,31 +82,31 @@ assertEquals("hodmet", (String) worker.invokeExact("met", "hod"));
|
||||||
* <em>Implementation Note:</em>
|
* <em>Implementation Note:</em>
|
||||||
* A switch point behaves as if implemented on top of {@link MutableCallSite},
|
* A switch point behaves as if implemented on top of {@link MutableCallSite},
|
||||||
* approximately as follows:
|
* approximately as follows:
|
||||||
* <blockquote><pre>{@code
|
* <pre>{@code
|
||||||
public class SwitchPoint {
|
* public class SwitchPoint {
|
||||||
private static final MethodHandle
|
* private static final MethodHandle
|
||||||
K_true = MethodHandles.constant(boolean.class, true),
|
* K_true = MethodHandles.constant(boolean.class, true),
|
||||||
K_false = MethodHandles.constant(boolean.class, false);
|
* K_false = MethodHandles.constant(boolean.class, false);
|
||||||
private final MutableCallSite mcs;
|
* private final MutableCallSite mcs;
|
||||||
private final MethodHandle mcsInvoker;
|
* private final MethodHandle mcsInvoker;
|
||||||
public SwitchPoint() {
|
* public SwitchPoint() {
|
||||||
this.mcs = new MutableCallSite(K_true);
|
* this.mcs = new MutableCallSite(K_true);
|
||||||
this.mcsInvoker = mcs.dynamicInvoker();
|
* this.mcsInvoker = mcs.dynamicInvoker();
|
||||||
}
|
* }
|
||||||
public MethodHandle guardWithTest(
|
* public MethodHandle guardWithTest(
|
||||||
MethodHandle target, MethodHandle fallback) {
|
* MethodHandle target, MethodHandle fallback) {
|
||||||
// Note: mcsInvoker is of type ()boolean.
|
* // Note: mcsInvoker is of type ()boolean.
|
||||||
// Target and fallback may take any arguments, but must have the same type.
|
* // Target and fallback may take any arguments, but must have the same type.
|
||||||
return MethodHandles.guardWithTest(this.mcsInvoker, target, fallback);
|
* return MethodHandles.guardWithTest(this.mcsInvoker, target, fallback);
|
||||||
}
|
* }
|
||||||
public static void invalidateAll(SwitchPoint[] spts) {
|
* public static void invalidateAll(SwitchPoint[] spts) {
|
||||||
List<MutableCallSite> mcss = new ArrayList<>();
|
* List<MutableCallSite> mcss = new ArrayList<>();
|
||||||
for (SwitchPoint spt : spts) mcss.add(spt.mcs);
|
* for (SwitchPoint spt : spts) mcss.add(spt.mcs);
|
||||||
for (MutableCallSite mcs : mcss) mcs.setTarget(K_false);
|
* for (MutableCallSite mcs : mcss) mcs.setTarget(K_false);
|
||||||
MutableCallSite.syncAll(mcss.toArray(new MutableCallSite[0]));
|
* MutableCallSite.syncAll(mcss.toArray(new MutableCallSite[0]));
|
||||||
}
|
* }
|
||||||
}
|
* }
|
||||||
* }</pre></blockquote>
|
* }</pre>
|
||||||
* @author Remi Forax, JSR 292 EG
|
* @author Remi Forax, JSR 292 EG
|
||||||
*/
|
*/
|
||||||
public class SwitchPoint {
|
public class SwitchPoint {
|
||||||
|
|
|
@ -715,7 +715,7 @@ public interface ChronoLocalDate
|
||||||
* only compares the underlying date and not the chronology.
|
* only compares the underlying date and not the chronology.
|
||||||
* This allows dates in different calendar systems to be compared based
|
* This allows dates in different calendar systems to be compared based
|
||||||
* on the time-line position.
|
* on the time-line position.
|
||||||
* This is equivalent to using {@code date1.toEpochDay() > date2.toEpochDay()}.
|
* This is equivalent to using {@code date1.toEpochDay() > date2.toEpochDay()}.
|
||||||
* <p>
|
* <p>
|
||||||
* This default implementation performs the comparison based on the epoch-day.
|
* This default implementation performs the comparison based on the epoch-day.
|
||||||
*
|
*
|
||||||
|
@ -733,7 +733,7 @@ public interface ChronoLocalDate
|
||||||
* only compares the underlying date and not the chronology.
|
* only compares the underlying date and not the chronology.
|
||||||
* This allows dates in different calendar systems to be compared based
|
* This allows dates in different calendar systems to be compared based
|
||||||
* on the time-line position.
|
* on the time-line position.
|
||||||
* This is equivalent to using {@code date1.toEpochDay() < date2.toEpochDay()}.
|
* This is equivalent to using {@code date1.toEpochDay() < date2.toEpochDay()}.
|
||||||
* <p>
|
* <p>
|
||||||
* This default implementation performs the comparison based on the epoch-day.
|
* This default implementation performs the comparison based on the epoch-day.
|
||||||
*
|
*
|
||||||
|
|
|
@ -295,7 +295,7 @@ public class BytecodeName {
|
||||||
* (The safe name might possibly be mangled to hide further dangerous characters.)
|
* (The safe name might possibly be mangled to hide further dangerous characters.)
|
||||||
* For example, the qualified class name {@code java/lang/String}
|
* For example, the qualified class name {@code java/lang/String}
|
||||||
* will be parsed into the array {@code {"java", '/', "lang", '/', "String"}}.
|
* will be parsed into the array {@code {"java", '/', "lang", '/', "String"}}.
|
||||||
* The name {@code <init>} will be parsed into { '<', "init", '>'}}
|
* The name {@code <init>} will be parsed into {@code {'<', "init", '>'}}.
|
||||||
* The name {@code foo/bar$:baz} will be parsed into
|
* The name {@code foo/bar$:baz} will be parsed into
|
||||||
* {@code {"foo", '/', "bar", '$', ':', "baz"}}.
|
* {@code {"foo", '/', "bar", '$', ':', "baz"}}.
|
||||||
* The name {@code ::\=:foo:\=bar\!baz} will be parsed into
|
* The name {@code ::\=:foo:\=bar\!baz} will be parsed into
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class ListSelectionEvent extends EventObject
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the index of the first row whose selection may have changed.
|
* Returns the index of the first row whose selection may have changed.
|
||||||
* {@code getFirstIndex() <= getLastIndex()}
|
* {@code getFirstIndex() <= getLastIndex()}
|
||||||
*
|
*
|
||||||
* @return the first row whose selection value may have changed,
|
* @return the first row whose selection value may have changed,
|
||||||
* where zero is the first row
|
* where zero is the first row
|
||||||
|
@ -89,7 +89,7 @@ public class ListSelectionEvent extends EventObject
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the index of the last row whose selection may have changed.
|
* Returns the index of the last row whose selection may have changed.
|
||||||
* {@code getLastIndex() >= getFirstIndex()}
|
* {@code getLastIndex() >= getFirstIndex()}
|
||||||
*
|
*
|
||||||
* @return the last row whose selection value may have changed,
|
* @return the last row whose selection value may have changed,
|
||||||
* where zero is the first row
|
* where zero is the first row
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue