提交 54e01b75 编写于 作者: I igerasim

8134356: {@code} tag contains < and > sequences

Reviewed-by: martin
上级 5827b450
......@@ -6647,7 +6647,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
* <td>{@code FORM FEED}</td></tr>
* <tr><td>{@code '\r'}</td> <td>{@code U+000D}</td>
* <td>{@code CARRIAGE RETURN}</td></tr>
* <tr><td>{@code '&nbsp;'}</td> <td>{@code U+0020}</td>
* <tr><td>{@code ' '}</td> <td>{@code U+0020}</td>
* <td>{@code SPACE}</td></tr>
* </table>
*
......
......@@ -93,7 +93,7 @@ import java.util.Objects;
/** Return the simple name of this member.
* 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 constructor, it is always {@code "&lt;init&gt;"}.
* For a constructor, it is always {@code "<init>"}.
*/
public String getName() {
if (name == null) {
......@@ -727,7 +727,7 @@ import java.util.Objects;
}
/** Create a method or constructor name from the given components:
* Declaring class, name, type, reference kind.
* It will be a constructor if and only if the name is {@code "&lt;init&gt;"}.
* 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 last argument is optional, a boolean which requests REF_invokeSpecial.
* 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.
* This is {@code "&lt;init&gt;"} 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.
* @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
* all the components of the field value (if the field value is non-null)
* are indicated to be stable.
* If the field type is an array type with rank {@code N &gt; 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),
* is regarded as a stable array of rank {@code N-1}.
* <p>
......
......@@ -55,20 +55,20 @@ package java.lang.invoke;
* At that point {@code guardWithTest} may ignore {@code T} and return {@code F}.
* <p>
* Here is an example of a switch point in action:
* <blockquote><pre>{@code
MethodHandle MH_strcat = MethodHandles.lookup()
.findVirtual(String.class, "concat", MethodType.methodType(String.class, String.class));
SwitchPoint spt = new SwitchPoint();
assert(!spt.hasBeenInvalidated());
// the following steps may be repeated to re-use the same switch point:
MethodHandle worker1 = MH_strcat;
MethodHandle worker2 = MethodHandles.permuteArguments(MH_strcat, MH_strcat.type(), 1, 0);
MethodHandle worker = spt.guardWithTest(worker1, worker2);
assertEquals("method", (String) worker.invokeExact("met", "hod"));
SwitchPoint.invalidateAll(new SwitchPoint[]{ spt });
assert(spt.hasBeenInvalidated());
assertEquals("hodmet", (String) worker.invokeExact("met", "hod"));
* }</pre></blockquote>
* <pre>{@code
* MethodHandle MH_strcat = MethodHandles.lookup()
* .findVirtual(String.class, "concat", MethodType.methodType(String.class, String.class));
* SwitchPoint spt = new SwitchPoint();
* assert(!spt.hasBeenInvalidated());
* // the following steps may be repeated to re-use the same switch point:
* MethodHandle worker1 = MH_strcat;
* MethodHandle worker2 = MethodHandles.permuteArguments(MH_strcat, MH_strcat.type(), 1, 0);
* MethodHandle worker = spt.guardWithTest(worker1, worker2);
* assertEquals("method", (String) worker.invokeExact("met", "hod"));
* SwitchPoint.invalidateAll(new SwitchPoint[]{ spt });
* assert(spt.hasBeenInvalidated());
* assertEquals("hodmet", (String) worker.invokeExact("met", "hod"));
* }</pre>
* <p style="font-size:smaller;">
* <em>Discussion:</em>
* 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>
* A switch point behaves as if implemented on top of {@link MutableCallSite},
* approximately as follows:
* <blockquote><pre>{@code
public class SwitchPoint {
private static final MethodHandle
K_true = MethodHandles.constant(boolean.class, true),
K_false = MethodHandles.constant(boolean.class, false);
private final MutableCallSite mcs;
private final MethodHandle mcsInvoker;
public SwitchPoint() {
this.mcs = new MutableCallSite(K_true);
this.mcsInvoker = mcs.dynamicInvoker();
}
public MethodHandle guardWithTest(
MethodHandle target, MethodHandle fallback) {
// Note: mcsInvoker is of type ()boolean.
// Target and fallback may take any arguments, but must have the same type.
return MethodHandles.guardWithTest(this.mcsInvoker, target, fallback);
}
public static void invalidateAll(SwitchPoint[] spts) {
List&lt;MutableCallSite&gt; mcss = new ArrayList&lt;&gt;();
for (SwitchPoint spt : spts) mcss.add(spt.mcs);
for (MutableCallSite mcs : mcss) mcs.setTarget(K_false);
MutableCallSite.syncAll(mcss.toArray(new MutableCallSite[0]));
}
}
* }</pre></blockquote>
* <pre>{@code
* public class SwitchPoint {
* private static final MethodHandle
* K_true = MethodHandles.constant(boolean.class, true),
* K_false = MethodHandles.constant(boolean.class, false);
* private final MutableCallSite mcs;
* private final MethodHandle mcsInvoker;
* public SwitchPoint() {
* this.mcs = new MutableCallSite(K_true);
* this.mcsInvoker = mcs.dynamicInvoker();
* }
* public MethodHandle guardWithTest(
* MethodHandle target, MethodHandle fallback) {
* // Note: mcsInvoker is of type ()boolean.
* // Target and fallback may take any arguments, but must have the same type.
* return MethodHandles.guardWithTest(this.mcsInvoker, target, fallback);
* }
* public static void invalidateAll(SwitchPoint[] spts) {
* List<MutableCallSite> mcss = new ArrayList<>();
* for (SwitchPoint spt : spts) mcss.add(spt.mcs);
* for (MutableCallSite mcs : mcss) mcs.setTarget(K_false);
* MutableCallSite.syncAll(mcss.toArray(new MutableCallSite[0]));
* }
* }
* }</pre>
* @author Remi Forax, JSR 292 EG
*/
public class SwitchPoint {
......
......@@ -715,7 +715,7 @@ public interface ChronoLocalDate
* only compares the underlying date and not the chronology.
* This allows dates in different calendar systems to be compared based
* on the time-line position.
* This is equivalent to using {@code date1.toEpochDay() &gt; date2.toEpochDay()}.
* This is equivalent to using {@code date1.toEpochDay() > date2.toEpochDay()}.
* <p>
* 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.
* This allows dates in different calendar systems to be compared based
* on the time-line position.
* This is equivalent to using {@code date1.toEpochDay() &lt; date2.toEpochDay()}.
* This is equivalent to using {@code date1.toEpochDay() < date2.toEpochDay()}.
* <p>
* This default implementation performs the comparison based on the epoch-day.
*
......
......@@ -78,7 +78,7 @@ public class ListSelectionEvent extends EventObject
/**
* Returns the index of the first row whose selection may have changed.
* {@code getFirstIndex() &lt;= getLastIndex()}
* {@code getFirstIndex() <= getLastIndex()}
*
* @return the first row whose selection value may have changed,
* where zero is the first row
......@@ -87,7 +87,7 @@ public class ListSelectionEvent extends EventObject
/**
* Returns the index of the last row whose selection may have changed.
* {@code getLastIndex() &gt;= getFirstIndex()}
* {@code getLastIndex() >= getFirstIndex()}
*
* @return the last row whose selection value may have changed,
* where zero is the first row
......
......@@ -295,7 +295,7 @@ public class BytecodeName {
* (The safe name might possibly be mangled to hide further dangerous characters.)
* For example, the qualified class name {@code java/lang/String}
* will be parsed into the array {@code {"java", '/', "lang", '/', "String"}}.
* The name {@code &lt;init&gt;} will be parsed into { '&lt;', "init", '&gt;'}}
* The name {@code <init>} will be parsed into {@code {'<', "init", '>'}}.
* The name {@code foo/bar$:baz} will be parsed into
* {@code {"foo", '/', "bar", '$', ':', "baz"}}.
* The name {@code ::\=:foo:\=bar\!baz} will be parsed into
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册