diff --git a/jdk/src/java.base/share/classes/java/nio/Buffer.java b/jdk/src/java.base/share/classes/java/nio/Buffer.java index ba72f285a8f..8669242c195 100644 --- a/jdk/src/java.base/share/classes/java/nio/Buffer.java +++ b/jdk/src/java.base/share/classes/java/nio/Buffer.java @@ -96,10 +96,10 @@ import jdk.internal.HotSpotIntrinsicCandidate; * capacity values: * *
- * 0 <= - * mark <= - * position <= - * limit <= + * {@code 0} {@code <=} + * mark {@code <=} + * position {@code <=} + * limit {@code <=} * capacity *
* @@ -229,7 +229,7 @@ public abstract class Buffer { * The new buffer's capacity, in $type$s * * @throws IllegalArgumentException - * If the capacity is a negative integer + * If the {@code capacity} is a negative integer */ static IllegalArgumentException createCapacityException(int capacity) { assert capacity < 0 : "capacity expected to be negative"; @@ -266,7 +266,7 @@ public abstract class Buffer { * @return This buffer * * @throws IllegalArgumentException - * If the preconditions on newPosition do not hold + * If the preconditions on {@code newPosition} do not hold */ public Buffer position(int newPosition) { if (newPosition > limit | newPosition < 0) @@ -319,7 +319,7 @@ public abstract class Buffer { * @return This buffer * * @throws IllegalArgumentException - * If the preconditions on newLimit do not hold + * If the preconditions on {@code newLimit} do not hold */ public Buffer limit(int newLimit) { if (newLimit > capacity | newLimit < 0) @@ -468,7 +468,7 @@ public abstract class Buffer { * Tells whether there are any elements between the current position and * the limit. * - * @return true if, and only if, there is at least one element + * @return {@code true} if, and only if, there is at least one element * remaining in this buffer */ public final boolean hasRemaining() { @@ -478,7 +478,7 @@ public abstract class Buffer { /** * Tells whether or not this buffer is read-only. * - * @return true if, and only if, this buffer is read-only + * @return {@code true} if, and only if, this buffer is read-only */ public abstract boolean isReadOnly(); @@ -486,11 +486,11 @@ public abstract class Buffer { * Tells whether or not this buffer is backed by an accessible * array. * - *

If this method returns true then the {@link #array() array} + *

If this method returns {@code true} then the {@link #array() array} * and {@link #arrayOffset() arrayOffset} methods may safely be invoked. *

* - * @return true if, and only if, this buffer + * @return {@code true} if, and only if, this buffer * is backed by an array and is not read-only * * @since 1.6 @@ -529,7 +529,7 @@ public abstract class Buffer { * element of the buffer  (optional operation). * *

If this buffer is backed by an array then buffer position p - * corresponds to array index p + arrayOffset(). + * corresponds to array index p + {@code arrayOffset()}. * *

Invoke the {@link #hasArray hasArray} method before invoking this * method in order to ensure that this buffer has an accessible backing @@ -552,7 +552,7 @@ public abstract class Buffer { * Tells whether or not this buffer is * direct. * - * @return true if, and only if, this buffer is direct + * @return {@code true} if, and only if, this buffer is direct * * @since 1.6 */ diff --git a/jdk/src/java.base/share/classes/java/nio/ByteOrder.java b/jdk/src/java.base/share/classes/java/nio/ByteOrder.java index a20cacce8f9..97dc16b3909 100644 --- a/jdk/src/java.base/share/classes/java/nio/ByteOrder.java +++ b/jdk/src/java.base/share/classes/java/nio/ByteOrder.java @@ -75,9 +75,9 @@ public final class ByteOrder { /** * Constructs a string describing this object. * - *

This method returns the string "BIG_ENDIAN" for {@link - * #BIG_ENDIAN} and "LITTLE_ENDIAN" for {@link #LITTLE_ENDIAN}. - *

+ *

This method returns the string + * {@code "BIG_ENDIAN"} for {@link #BIG_ENDIAN} and + * {@code "LITTLE_ENDIAN"} for {@link #LITTLE_ENDIAN}. * * @return The specified string */ diff --git a/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java b/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java index 5331cb372da..953a78b8206 100644 --- a/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java +++ b/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java @@ -116,10 +116,10 @@ public abstract class MappedByteBuffer * Tells whether or not this buffer's content is resident in physical * memory. * - *

A return value of true implies that it is highly likely + *

A return value of {@code true} implies that it is highly likely * that all of the data in this buffer is resident in physical memory and * may therefore be accessed without incurring any virtual-memory page - * faults or I/O operations. A return value of false does not + * faults or I/O operations. A return value of {@code false} does not * necessarily imply that the buffer's content is not resident in physical * memory. * @@ -127,7 +127,7 @@ public abstract class MappedByteBuffer * underlying operating system may have paged out some of the buffer's data * by the time that an invocation of this method returns.

* - * @return true if it is likely that this buffer's content + * @return {@code true} if it is likely that this buffer's content * is resident in physical memory */ public final boolean isLoaded() { diff --git a/jdk/src/java.base/share/classes/java/nio/X-Buffer-bin.java.template b/jdk/src/java.base/share/classes/java/nio/X-Buffer-bin.java.template index 44d2c4e3172..3473e2d824d 100644 --- a/jdk/src/java.base/share/classes/java/nio/X-Buffer-bin.java.template +++ b/jdk/src/java.base/share/classes/java/nio/X-Buffer-bin.java.template @@ -78,7 +78,7 @@ class XXX { * @return The $type$ value at the given index * * @throws IndexOutOfBoundsException - * If index is negative + * If {@code index} is negative * or not smaller than the buffer's limit, * minus $nbytesButOne$ */ @@ -100,7 +100,7 @@ class XXX { * @return This buffer * * @throws IndexOutOfBoundsException - * If index is negative + * If {@code index} is negative * or not smaller than the buffer's limit, * minus $nbytesButOne$ * diff --git a/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template b/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template index 78afa40a506..d34f975526c 100644 --- a/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template +++ b/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template @@ -133,7 +133,7 @@ import java.util.stream.$Streamtype$Stream; *

Access to binary data

* *

This class defines methods for reading and writing values of all other - * primitive types, except boolean. Primitive values are translated + * primitive types, except {@code boolean}. Primitive values are translated * to (or from) sequences of bytes according to the buffer's current byte * order, which may be retrieved and modified via the {@link #order order} * methods. Specific byte orders are represented by instances of the {@link @@ -151,8 +151,8 @@ import java.util.stream.$Streamtype$Stream; * void {@link #putFloat(float) putFloat(float f)} * void {@link #putFloat(int,float) putFloat(int index, float f)} * - *

Corresponding methods are defined for the types char, - * short, int, long, and double. The index + *

Corresponding methods are defined for the types {@code char, + * short, int, long}, and {@code double}. The index * parameters of the absolute get and put methods are in terms of * bytes rather than of the type being read or written. * @@ -167,8 +167,7 @@ import java.util.stream.$Streamtype$Stream; * #asFloatBuffer() asFloatBuffer} method, for example, creates an instance of * the {@link FloatBuffer} class that is backed by the byte buffer upon which * the method is invoked. Corresponding view-creation methods are defined for - * the types char, short, int, long, and - * double. + * the types {@code char, short, int, long}, and {@code double}. * *

View buffers have three important advantages over the families of * type-specific get and put methods described above: @@ -196,7 +195,7 @@ import java.util.stream.$Streamtype$Stream; * *

Like a byte buffer, $a$ $type$ buffer is either direct or non-direct. A - * $type$ buffer created via the wrap methods of this class will + * $type$ buffer created via the {@code wrap} methods of this class will * be non-direct. $A$ $type$ buffer created as a view of a byte buffer will * be direct if, and only if, the byte buffer itself is direct. Whether or not * $a$ $type$ buffer is direct may be determined by invoking the {@link @@ -208,7 +207,7 @@ import java.util.stream.$Streamtype$Stream; * *

This class implements the {@link CharSequence} interface so that * character buffers may be used wherever character sequences are accepted, for - * example in the regular-expression package {@link java.util.regex}. + * example in the regular-expression package {@link java.util.regex}. *

* #end[char] @@ -306,7 +305,7 @@ public abstract class $Type$Buffer * @return The new $type$ buffer * * @throws IllegalArgumentException - * If the capacity is a negative integer + * If the {@code capacity} is a negative integer */ public static $Type$Buffer allocateDirect(int capacity) { return new Direct$Type$Buffer(capacity); @@ -335,7 +334,7 @@ public abstract class $Type$Buffer * @return The new $type$ buffer * * @throws IllegalArgumentException - * If the capacity is a negative integer + * If the {@code capacity} is a negative integer */ public static $Type$Buffer allocate(int capacity) { if (capacity < 0) @@ -349,8 +348,8 @@ public abstract class $Type$Buffer *

The new buffer will be backed by the given $type$ array; * that is, modifications to the buffer will cause the array to be modified * and vice versa. The new buffer's capacity will be - * array.length, its position will be offset, its limit - * will be offset + length, its mark will be undefined, and its + * {@code array.length}, its position will be {@code offset}, its limit + * will be {@code offset + length}, its mark will be undefined, and its * byte order will be #if[byte] * {@link ByteOrder#BIG_ENDIAN BIG_ENDIAN}. @@ -366,19 +365,19 @@ public abstract class $Type$Buffer * * @param offset * The offset of the subarray to be used; must be non-negative and - * no larger than array.length. The new buffer's position + * no larger than {@code array.length}. The new buffer's position * will be set to this value. * * @param length * The length of the subarray to be used; * must be non-negative and no larger than - * array.length - offset. - * The new buffer's limit will be set to offset + length. + * {@code array.length - offset}. + * The new buffer's limit will be set to {@code offset + length}. * * @return The new $type$ buffer * * @throws IndexOutOfBoundsException - * If the preconditions on the offset and length + * If the preconditions on the {@code offset} and {@code length} * parameters do not hold */ public static $Type$Buffer wrap($type$[] array, @@ -397,7 +396,7 @@ public abstract class $Type$Buffer *

The new buffer will be backed by the given $type$ array; * that is, modifications to the buffer will cause the array to be modified * and vice versa. The new buffer's capacity and limit will be - * array.length, its position will be zero, its mark will be + * {@code array.length}, its position will be zero, its mark will be * undefined, and its byte order will be #if[byte] * {@link ByteOrder#BIG_ENDIAN BIG_ENDIAN}. @@ -458,8 +457,8 @@ public abstract class $Type$Buffer * *

The content of the new, read-only buffer will be the content of the * given character sequence. The buffer's capacity will be - * csq.length(), its position will be start, its limit - * will be end, and its mark will be undefined.

+ * {@code csq.length()}, its position will be {@code start}, its limit + * will be {@code end}, and its mark will be undefined.

* * @param csq * The character sequence from which the new character buffer is to @@ -467,19 +466,19 @@ public abstract class $Type$Buffer * * @param start * The index of the first character to be used; - * must be non-negative and no larger than csq.length(). + * must be non-negative and no larger than {@code csq.length()}. * The new buffer's position will be set to this value. * * @param end * The index of the character following the last character to be - * used; must be no smaller than start and no larger - * than csq.length(). + * used; must be no smaller than {@code start} and no larger + * than {@code csq.length()}. * The new buffer's limit will be set to this value. * * @return The new character buffer * * @throws IndexOutOfBoundsException - * If the preconditions on the start and end + * If the preconditions on the {@code start} and {@code end} * parameters do not hold */ public static CharBuffer wrap(CharSequence csq, int start, int end) { @@ -495,7 +494,7 @@ public abstract class $Type$Buffer * *

The content of the new, read-only buffer will be the content of the * given character sequence. The new buffer's capacity and limit will be - * csq.length(), its position will be zero, and its mark will be + * {@code csq.length()}, its position will be zero, and its mark will be * undefined.

* * @param csq @@ -624,7 +623,7 @@ public abstract class $Type$Buffer * @return The $type$ at the given index * * @throws IndexOutOfBoundsException - * If index is negative + * If {@code index} is negative * or not smaller than the buffer's limit */ public abstract $type$ get(int index); @@ -657,7 +656,7 @@ public abstract class $Type$Buffer * @return This buffer * * @throws IndexOutOfBoundsException - * If index is negative + * If {@code index} is negative * or not smaller than the buffer's limit * * @throws ReadOnlyBufferException @@ -674,17 +673,17 @@ public abstract class $Type$Buffer *

This method transfers $type$s from this buffer into the given * destination array. If there are fewer $type$s remaining in the * buffer than are required to satisfy the request, that is, if - * length > remaining(), then no + * {@code length} {@code >} {@code remaining()}, then no * $type$s are transferred and a {@link BufferUnderflowException} is * thrown. * - *

Otherwise, this method copies length $type$s from this + *

Otherwise, this method copies {@code length} $type$s from this * buffer into the given array, starting at the current position of this * buffer and at the given offset in the array. The position of this - * buffer is then incremented by length. + * buffer is then incremented by {@code length}. * *

In other words, an invocation of this method of the form - * src.get(dst, off, len) has exactly the same effect as + * src.get(dst, off, len) has exactly the same effect as * the loop * *

{@code
@@ -701,21 +700,21 @@ public abstract class $Type$Buffer
      * @param  offset
      *         The offset within the array of the first $type$ to be
      *         written; must be non-negative and no larger than
-     *         dst.length
+     *         {@code dst.length}
      *
      * @param  length
      *         The maximum number of $type$s to be written to the given
      *         array; must be non-negative and no larger than
-     *         dst.length - offset
+     *         {@code dst.length - offset}
      *
      * @return  This buffer
      *
      * @throws  BufferUnderflowException
-     *          If there are fewer than length $type$s
+     *          If there are fewer than {@code length} $type$s
      *          remaining in this buffer
      *
      * @throws  IndexOutOfBoundsException
-     *          If the preconditions on the offset and length
+     *          If the preconditions on the {@code offset} and {@code length}
      *          parameters do not hold
      */
     public $Type$Buffer get($type$[] dst, int offset, int length) {
@@ -733,7 +732,7 @@ public abstract class $Type$Buffer
      *
      * 

This method transfers $type$s from this buffer into the given * destination array. An invocation of this method of the form - * src.get(a) behaves in exactly the same way as the invocation + * {@code src.get(a)} behaves in exactly the same way as the invocation * *

      *     src.get(a, 0, a.length) 
@@ -744,7 +743,7 @@ public abstract class $Type$Buffer * @return This buffer * * @throws BufferUnderflowException - * If there are fewer than length $type$s + * If there are fewer than {@code length} $type$s * remaining in this buffer */ public $Type$Buffer get($type$[] dst) { @@ -760,17 +759,17 @@ public abstract class $Type$Buffer *

This method transfers the $type$s remaining in the given source * buffer into this buffer. If there are more $type$s remaining in the * source buffer than in this buffer, that is, if - * src.remaining() > remaining(), + * {@code src.remaining()} {@code >} {@code remaining()}, * then no $type$s are transferred and a {@link * BufferOverflowException} is thrown. * *

Otherwise, this method copies - * n = src.remaining() $type$s from the given + * n = {@code src.remaining()} $type$s from the given * buffer into this buffer, starting at each buffer's current position. * The positions of both buffers are then incremented by n. * *

In other words, an invocation of this method of the form - * dst.put(src) has exactly the same effect as the loop + * {@code dst.put(src)} has exactly the same effect as the loop * *

      *     while (src.hasRemaining())
@@ -814,17 +813,17 @@ public abstract class $Type$Buffer
      * 

This method transfers $type$s into this buffer from the given * source array. If there are more $type$s to be copied from the array * than remain in this buffer, that is, if - * length > remaining(), then no + * {@code length} {@code >} {@code remaining()}, then no * $type$s are transferred and a {@link BufferOverflowException} is * thrown. * - *

Otherwise, this method copies length $type$s from the + *

Otherwise, this method copies {@code length} $type$s from the * given array into this buffer, starting at the given offset in the array * and at the current position of this buffer. The position of this buffer - * is then incremented by length. + * is then incremented by {@code length}. * *

In other words, an invocation of this method of the form - * dst.put(src, off, len) has exactly the same effect as + * dst.put(src, off, len) has exactly the same effect as * the loop * *

{@code
@@ -840,12 +839,12 @@ public abstract class $Type$Buffer
      *
      * @param  offset
      *         The offset within the array of the first $type$ to be read;
-     *         must be non-negative and no larger than array.length
+     *         must be non-negative and no larger than {@code array.length}
      *
      * @param  length
      *         The number of $type$s to be read from the given array;
      *         must be non-negative and no larger than
-     *         array.length - offset
+     *         {@code array.length - offset}
      *
      * @return  This buffer
      *
@@ -853,7 +852,7 @@ public abstract class $Type$Buffer
      *          If there is insufficient space in this buffer
      *
      * @throws  IndexOutOfBoundsException
-     *          If the preconditions on the offset and length
+     *          If the preconditions on the {@code offset} and {@code length}
      *          parameters do not hold
      *
      * @throws  ReadOnlyBufferException
@@ -874,7 +873,7 @@ public abstract class $Type$Buffer
      *
      * 

This method transfers the entire content of the given source * $type$ array into this buffer. An invocation of this method of the - * form dst.put(a) behaves in exactly the same way as the + * form {@code dst.put(a)} behaves in exactly the same way as the * invocation * *

@@ -903,18 +902,18 @@ public abstract class $Type$Buffer
      * 

This method transfers $type$s from the given string into this * buffer. If there are more $type$s to be copied from the string than * remain in this buffer, that is, if - * end - start > remaining(), + * end - start {@code >} {@code remaining()}, * then no $type$s are transferred and a {@link * BufferOverflowException} is thrown. * *

Otherwise, this method copies - * n = end - start $type$s + * n = {@code end} - {@code start} $type$s * from the given string into this buffer, starting at the given - * start index and at the current position of this buffer. The + * {@code start} index and at the current position of this buffer. The * position of this buffer is then incremented by n. * *

In other words, an invocation of this method of the form - * dst.put(src, start, end) has exactly the same effect + * dst.put(src, start, end) has exactly the same effect * as the loop * *

{@code
@@ -931,12 +930,12 @@ public abstract class $Type$Buffer
      * @param  start
      *         The offset within the string of the first $type$ to be read;
      *         must be non-negative and no larger than
-     *         string.length()
+     *         {@code string.length()}
      *
      * @param  end
      *         The offset within the string of the last $type$ to be read,
      *         plus one; must be non-negative and no larger than
-     *         string.length()
+     *         {@code string.length()}
      *
      * @return  This buffer
      *
@@ -944,7 +943,7 @@ public abstract class $Type$Buffer
      *          If there is insufficient space in this buffer
      *
      * @throws  IndexOutOfBoundsException
-     *          If the preconditions on the start and end
+     *          If the preconditions on the {@code start} and {@code end}
      *          parameters do not hold
      *
      * @throws  ReadOnlyBufferException
@@ -966,7 +965,7 @@ public abstract class $Type$Buffer
      *
      * 

This method transfers the entire content of the given source string * into this buffer. An invocation of this method of the form - * dst.put(s) behaves in exactly the same way as the invocation + * {@code dst.put(s)} behaves in exactly the same way as the invocation * *

      *     dst.put(s, 0, s.length()) 
@@ -995,11 +994,11 @@ public abstract class $Type$Buffer * Tells whether or not this buffer is backed by an accessible $type$ * array. * - *

If this method returns true then the {@link #array() array} + *

If this method returns {@code true} then the {@link #array() array} * and {@link #arrayOffset() arrayOffset} methods may safely be invoked. *

* - * @return true if, and only if, this buffer + * @return {@code true} if, and only if, this buffer * is backed by an array and is not read-only */ public final boolean hasArray() { @@ -1038,7 +1037,7 @@ public abstract class $Type$Buffer * element of the buffer  (optional operation). * *

If this buffer is backed by an array then buffer position p - * corresponds to array index p + arrayOffset(). + * corresponds to array index p + {@code arrayOffset()}. * *

Invoke the {@link #hasArray hasArray} method before invoking this * method in order to ensure that this buffer has an accessible backing @@ -1166,11 +1165,11 @@ public abstract class $Type$Buffer * *

The $type$s between the buffer's current position and its limit, * if any, are copied to the beginning of the buffer. That is, the - * $type$ at index p = position() is copied + * $type$ at index p = {@code position()} is copied * to index zero, the $type$ at index p + 1 is copied * to index one, and so forth until the $type$ at index - * limit() - 1 is copied to index - * n = limit() - 1 - p. + * {@code limit()} - 1 is copied to index + * n = {@code limit()} - {@code 1} - p. * The buffer's position is then set to n+1 and its limit is set to * its capacity. The mark, if defined, is discarded. * @@ -1183,7 +1182,7 @@ public abstract class $Type$Buffer * *

Invoke this method after writing data from a buffer in case the * write was incomplete. The following loop, for example, copies bytes - * from one channel to another via the buffer buf: + * from one channel to another via the buffer {@code buf}: * *

{@code
      *   buf.clear();          // Prepare buffer for use
@@ -1206,7 +1205,7 @@ public abstract class $Type$Buffer
     /**
      * Tells whether or not this $type$ buffer is direct.
      *
-     * @return  true if, and only if, this buffer is direct
+     * @return  {@code true} if, and only if, this buffer is direct
      */
     public abstract boolean isDirect();
 
@@ -1239,8 +1238,8 @@ public abstract class $Type$Buffer
      * Returns the current hash code of this buffer.
      *
      * 

The hash code of a $type$ buffer depends only upon its remaining - * elements; that is, upon the elements from position() up to, and - * including, the element at limit() - 1. + * elements; that is, upon the elements from {@code position()} up to, and + * including, the element at {@code limit()} - {@code 1}. * *

Because buffer hash codes are content-dependent, it is inadvisable * to use buffers as keys in hash maps or similar data structures unless it @@ -1289,7 +1288,7 @@ public abstract class $Type$Buffer * * @param ob The object to which this buffer is to be compared * - * @return true if, and only if, this buffer is equal to the + * @return {@code true} if, and only if, this buffer is equal to the * given object */ public boolean equals(Object ob) { @@ -1368,7 +1367,7 @@ public abstract class $Type$Buffer * *

The first character of the resulting string will be the character at * this buffer's position, while the last character will be the character - * at index limit() - 1. Invoking this method does not + * at index {@code limit()} - 1. Invoking this method does not * change the buffer's position.

* * @return The specified string @@ -1388,7 +1387,7 @@ public abstract class $Type$Buffer *

When viewed as a character sequence, the length of a character * buffer is simply the number of characters between the position * (inclusive) and the limit (exclusive); that is, it is equivalent to - * remaining().

+ * {@code remaining()}.

* * @return The length of this character buffer */ @@ -1402,13 +1401,13 @@ public abstract class $Type$Buffer * * @param index * The index of the character to be read, relative to the position; - * must be non-negative and smaller than remaining() + * must be non-negative and smaller than {@code remaining()} * * @return The character at index - * position() + index + * position() + index * * @throws IndexOutOfBoundsException - * If the preconditions on index do not hold + * If the preconditions on {@code index} do not hold */ public final char charAt(int index) { return get(position() + checkIndex(index, 1)); @@ -1422,26 +1421,26 @@ public abstract class $Type$Buffer * content of this buffer is mutable then modifications to one buffer will * cause the other to be modified. The new buffer's capacity will be that * of this buffer, its position will be - * position() + start, and its limit will be - * position() + end. The new buffer will be + * {@code position()} + {@code start}, and its limit will be + * {@code position()} + {@code end}. The new buffer will be * direct if, and only if, this buffer is direct, and it will be read-only * if, and only if, this buffer is read-only.

* * @param start * The index, relative to the current position, of the first * character in the subsequence; must be non-negative and no larger - * than remaining() + * than {@code remaining()} * * @param end * The index, relative to the current position, of the character * following the last character in the subsequence; must be no - * smaller than start and no larger than - * remaining() + * smaller than {@code start} and no larger than + * {@code remaining()} * * @return The new character buffer * * @throws IndexOutOfBoundsException - * If the preconditions on start and end + * If the preconditions on {@code start} and {@code end} * do not hold */ public abstract CharBuffer subSequence(int start, int end); @@ -1453,21 +1452,21 @@ public abstract class $Type$Buffer * Appends the specified character sequence to this * buffer  (optional operation). * - *

An invocation of this method of the form dst.append(csq) + *

An invocation of this method of the form {@code dst.append(csq)} * behaves in exactly the same way as the invocation * *

      *     dst.put(csq.toString()) 
* - *

Depending on the specification of toString for the - * character sequence csq, the entire sequence may not be + *

Depending on the specification of {@code toString} for the + * character sequence {@code csq}, the entire sequence may not be * appended. For instance, invoking the {@link $Type$Buffer#toString() * toString} method of a character buffer will return a subsequence whose * content depends upon the buffer's position and limit. * * @param csq - * The character sequence to append. If csq is - * null, then the four characters "null" are + * The character sequence to append. If {@code csq} is + * {@code null}, then the four characters {@code "null"} are * appended to this character buffer. * * @return This buffer @@ -1491,8 +1490,8 @@ public abstract class $Type$Buffer * Appends a subsequence of the specified character sequence to this * buffer  (optional operation). * - *

An invocation of this method of the form dst.append(csq, start, - * end) when csq is not null, behaves in exactly the + *

An invocation of this method of the form {@code dst.append(csq, start, + * end)} when {@code csq} is not {@code null}, behaves in exactly the * same way as the invocation * *

@@ -1500,9 +1499,9 @@ public abstract class $Type$Buffer
      *
      * @param  csq
      *         The character sequence from which a subsequence will be
-     *         appended.  If csq is null, then characters
-     *         will be appended as if csq contained the four
-     *         characters "null".
+     *         appended.  If {@code csq} is {@code null}, then characters
+     *         will be appended as if {@code csq} contained the four
+     *         characters {@code "null"}.
      *
      * @return  This buffer
      *
@@ -1510,9 +1509,9 @@ public abstract class $Type$Buffer
      *          If there is insufficient space in this buffer
      *
      * @throws  IndexOutOfBoundsException
-     *          If start or end are negative, start
-     *          is greater than end, or end is greater than
-     *          csq.length()
+     *          If {@code start} or {@code end} are negative, {@code start}
+     *          is greater than {@code end}, or {@code end} is greater than
+     *          {@code csq.length()}
      *
      * @throws  ReadOnlyBufferException
      *          If this buffer is read-only
@@ -1528,7 +1527,7 @@ public abstract class $Type$Buffer
      * Appends the specified $type$  to this
      * buffer  (optional operation).
      *
-     * 

An invocation of this method of the form dst.append($x$) + *

An invocation of this method of the form {@code dst.append($x$)} * behaves in exactly the same way as the invocation * *

@@ -1562,7 +1561,7 @@ public abstract class $Type$Buffer
      * Retrieves this buffer's byte order.
      *
      * 

The byte order of $a$ $type$ buffer created by allocation or by - * wrapping an existing $type$ array is the {@link + * wrapping an existing {@code $type$} array is the {@link * ByteOrder#nativeOrder native order} of the underlying * hardware. The byte order of $a$ $type$ buffer created as a view of a byte buffer is that of the diff --git a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousByteChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousByteChannel.java index b96a2391151..56003d53ec7 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousByteChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousByteChannel.java @@ -70,13 +70,13 @@ public interface AsynchronousByteChannel * {@code 0} without initiating an I/O operation. * *

Suppose that a byte sequence of length n is read, where - * 0 < n <= r. + * {@code 0} {@code <} n {@code <=} r. * This byte sequence will be transferred into the buffer so that the first * byte in the sequence is at index p and the last byte is at index - * p + n - 1, + * p {@code +} n {@code -} {@code 1}, * where p is the buffer's position at the moment the read is * performed. Upon completion the buffer's position will be equal to - * p + n; its limit will not have changed. + * p {@code +} n; its limit will not have changed. * *

Buffers are not safe for use by multiple concurrent threads so care * should be taken to not access the buffer until the operation has @@ -151,13 +151,13 @@ public interface AsynchronousByteChannel * {@code 0} without initiating an I/O operation. * *

Suppose that a byte sequence of length n is written, where - * 0 < n <= r. + * {@code 0} {@code <} n {@code <=} r. * This byte sequence will be transferred from the buffer starting at index * p, where p is the buffer's position at the moment the * write is performed; the index of the last byte written will be - * p + n - 1. + * p {@code +} n {@code -} {@code 1}. * Upon completion the buffer's position will be equal to - * p + n; its limit will not have changed. + * p {@code +} n; its limit will not have changed. * *

Buffers are not safe for use by multiple concurrent threads so care * should be taken to not access the buffer until the operation has diff --git a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java index 29ecbd626ac..44a2460426f 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java @@ -41,7 +41,7 @@ import java.io.IOException; * by invoking the {@link #bind(SocketAddress,int) bind} method. Once bound, * the {@link #accept(Object,CompletionHandler) accept} method * is used to initiate the accepting of connections to the channel's socket. - * An attempt to invoke the accept method on an unbound channel will + * An attempt to invoke the {@code accept} method on an unbound channel will * cause a {@link NotYetBoundException} to be thrown. * *

Channels of this type are safe for use by multiple concurrent threads @@ -122,13 +122,13 @@ public abstract class AsynchronousServerSocketChannel * java.nio.channels.spi.AsynchronousChannelProvider#openAsynchronousServerSocketChannel * openAsynchronousServerSocketChannel} method on the {@link * java.nio.channels.spi.AsynchronousChannelProvider} object that created - * the given group. If the group parameter is null then the + * the given group. If the group parameter is {@code null} then the * resulting channel is created by the system-wide default provider, and * bound to the default group. * * @param group * The group to which the newly constructed channel should be bound, - * or null for the default group + * or {@code null} for the default group * * @return A new asynchronous server socket channel * @@ -176,7 +176,7 @@ public abstract class AsynchronousServerSocketChannel *

* * @param local - * The local address to bind the socket, or null to bind + * The local address to bind the socket, or {@code null} to bind * to an automatically assigned socket address * * @return This channel diff --git a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java index 1ed1e8602aa..d5e2abeb63a 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java @@ -452,11 +452,11 @@ public abstract class AsynchronousSocketChannel * at the moment that the read is attempted. * *

Suppose that a byte sequence of length n is read, where - * 0 < n <= r. - * Up to the first dsts[offset].remaining() bytes of this sequence - * are transferred into buffer dsts[offset], up to the next - * dsts[offset+1].remaining() bytes are transferred into buffer - * dsts[offset+1], and so forth, until the entire byte sequence + * {@code 0} {@code <} n {@code <=} r. + * Up to the first {@code dsts[offset].remaining()} bytes of this sequence + * are transferred into buffer {@code dsts[offset]}, up to the next + * {@code dsts[offset+1].remaining()} bytes are transferred into buffer + * {@code dsts[offset+1]}, and so forth, until the entire byte sequence * is transferred into the given buffers. As many bytes as possible are * transferred into each buffer, hence the final position of each updated * buffer, except the last updated buffer, is guaranteed to be equal to @@ -606,11 +606,11 @@ public abstract class AsynchronousSocketChannel * at the moment that the write is attempted. * *

Suppose that a byte sequence of length n is written, where - * 0 < n <= r. - * Up to the first srcs[offset].remaining() bytes of this sequence - * are written from buffer srcs[offset], up to the next - * srcs[offset+1].remaining() bytes are written from buffer - * srcs[offset+1], and so forth, until the entire byte sequence is + * {@code 0} {@code <} n {@code <=} r. + * Up to the first {@code srcs[offset].remaining()} bytes of this sequence + * are written from buffer {@code srcs[offset]}, up to the next + * {@code srcs[offset+1].remaining()} bytes are written from buffer + * {@code srcs[offset+1]}, and so forth, until the entire byte sequence is * written. As many bytes as possible are written from each buffer, hence * the final position of each updated buffer, except the last updated * buffer, is guaranteed to be equal to that buffer's limit. The underlying diff --git a/jdk/src/java.base/share/classes/java/nio/channels/Channel.java b/jdk/src/java.base/share/classes/java/nio/channels/Channel.java index 663d0e098b2..5cca15e0b5d 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/Channel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/Channel.java @@ -58,7 +58,7 @@ public interface Channel extends Closeable { /** * Tells whether or not this channel is open. * - * @return true if, and only if, this channel is open + * @return {@code true} if, and only if, this channel is open */ public boolean isOpen(); diff --git a/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java index b85c98c59c7..0b3278bf356 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java @@ -187,8 +187,8 @@ public abstract class DatagramChannel * operations. * *

Datagram channels support reading and writing, so this method - * returns ({@link SelectionKey#OP_READ} | {@link - * SelectionKey#OP_WRITE}).

+ * returns {@code (}{@link SelectionKey#OP_READ} {@code |} {@link + * SelectionKey#OP_WRITE}{@code )}. * * @return The valid-operation set */ @@ -341,7 +341,7 @@ public abstract class DatagramChannel * copied into the given byte buffer and its source address is returned. * If this channel is in non-blocking mode and a datagram is not * immediately available then this method immediately returns - * null. + * {@code null}. * *

The datagram is transferred into the given byte buffer starting at * its current position, as if by a regular {@link @@ -371,7 +371,7 @@ public abstract class DatagramChannel * The buffer into which the datagram is to be transferred * * @return The datagram's source address, - * or null if this channel is in non-blocking mode + * or {@code null} if this channel is in non-blocking mode * and no datagram was immediately available * * @throws ClosedChannelException diff --git a/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java index eb3934d3dea..066ef8a9fa9 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java @@ -63,7 +63,7 @@ import java.util.Collections; * *

  • A region of a file may be {@link #map mapped} * directly into memory; for large files this is often much more efficient - * than invoking the usual read or write methods. + * than invoking the usual {@code read} or {@code write} methods. *

  • * *
  • Updates made to a file may be {@link #force forced @@ -107,10 +107,10 @@ import java.util.Collections; * existing {@link java.io.FileInputStream#getChannel FileInputStream}, {@link * java.io.FileOutputStream#getChannel FileOutputStream}, or {@link * java.io.RandomAccessFile#getChannel RandomAccessFile} object by invoking - * that object's getChannel method, which returns a file channel that + * that object's {@code getChannel} method, which returns a file channel that * is connected to the same underlying file. Where the file channel is obtained * from an existing stream or random access file then the state of the file - * channel is intimately connected to that of the object whose getChannel + * channel is intimately connected to that of the object whose {@code getChannel} * method returned the channel. Changing the channel's position, whether * explicitly or by reading or writing bytes, will change the file position of * the originating object, and vice versa. Changing the file's length via the @@ -128,14 +128,14 @@ import java.util.Collections; * writing. Finally, a channel obtained via the {@link * java.io.RandomAccessFile#getChannel getChannel} method of a {@link * java.io.RandomAccessFile} instance will be open for reading if the instance - * was created with mode "r" and will be open for reading and writing - * if the instance was created with mode "rw". + * was created with mode {@code "r"} and will be open for reading and writing + * if the instance was created with mode {@code "rw"}. * *

    A file channel that is open for writing may be in * append mode, for example if it was obtained from a file-output stream * that was created by invoking the {@link * java.io.FileOutputStream#FileOutputStream(java.io.File,boolean) - * FileOutputStream(File,boolean)} constructor and passing true for + * FileOutputStream(File,boolean)} constructor and passing {@code true} for * the second parameter. In this mode each invocation of a relative write * operation first advances the position to the end of the file and then writes * the requested data. Whether the advancement of the position and the writing @@ -516,10 +516,10 @@ public abstract class FileChannel *

    If the file does not reside on a local device then no such guarantee * is made. * - *

    The metaData parameter can be used to limit the number of + *

    The {@code metaData} parameter can be used to limit the number of * I/O operations that this method is required to perform. Passing - * false for this parameter indicates that only updates to the - * file's content need be written to storage; passing true + * {@code false} for this parameter indicates that only updates to the + * file's content need be written to storage; passing {@code true} * indicates that updates to both the file's content and metadata must be * written, which generally requires at least one more I/O operation. * Whether this parameter actually has any effect is dependent upon the @@ -540,7 +540,7 @@ public abstract class FileChannel * force changes made to the buffer's content to be written.

    * * @param metaData - * If true then this method is required to force changes + * If {@code true} then this method is required to force changes * to both the file's content and metadata to be written to * storage; otherwise, it need only force content changes to be * written @@ -557,14 +557,14 @@ public abstract class FileChannel * Transfers bytes from this channel's file to the given writable byte * channel. * - *

    An attempt is made to read up to count bytes starting at - * the given position in this channel's file and write them to the + *

    An attempt is made to read up to {@code count} bytes starting at + * the given {@code position} in this channel's file and write them to the * target channel. An invocation of this method may or may not transfer * all of the requested bytes; whether or not it does so depends upon the * natures and states of the channels. Fewer than the requested number of * bytes are transferred if this channel's file contains fewer than - * count bytes starting at the given position, or if the - * target channel is non-blocking and it has fewer than count + * {@code count} bytes starting at the given {@code position}, or if the + * target channel is non-blocking and it has fewer than {@code count} * bytes free in its output buffer. * *

    This method does not modify this channel's position. If the given @@ -624,14 +624,14 @@ public abstract class FileChannel * Transfers bytes into this channel's file from the given readable byte * channel. * - *

    An attempt is made to read up to count bytes from the + *

    An attempt is made to read up to {@code count} bytes from the * source channel and write them to this channel's file starting at the - * given position. An invocation of this method may or may not + * given {@code position}. An invocation of this method may or may not * transfer all of the requested bytes; whether or not it does so depends * upon the natures and states of the channels. Fewer than the requested * number of bytes will be transferred if the source channel has fewer than - * count bytes remaining, or if the source channel is non-blocking - * and has fewer than count bytes immediately available in its + * {@code count} bytes remaining, or if the source channel is non-blocking + * and has fewer than {@code count} bytes immediately available in its * input buffer. * *

    This method does not modify this channel's position. If the given @@ -704,7 +704,7 @@ public abstract class FileChannel * The file position at which the transfer is to begin; * must be non-negative * - * @return The number of bytes read, possibly zero, or -1 if the + * @return The number of bytes read, possibly zero, or {@code -1} if the * given position is greater than or equal to the file's current * size * @@ -855,7 +855,7 @@ public abstract class FileChannel * *

    The {@link MappedByteBuffer mapped byte buffer} * returned by this method will have a position of zero and a limit and - * capacity of size; its mark will be undefined. The buffer and + * capacity of {@code size}; its mark will be undefined. The buffer and * the mapping that it represents will remain valid until the buffer itself * is garbage-collected. * @@ -895,11 +895,11 @@ public abstract class FileChannel * @return The mapped byte buffer * * @throws NonReadableChannelException - * If the mode is {@link MapMode#READ_ONLY READ_ONLY} but + * If the {@code mode} is {@link MapMode#READ_ONLY READ_ONLY} but * this channel was not opened for reading * * @throws NonWritableChannelException - * If the mode is {@link MapMode#READ_WRITE READ_WRITE} or + * If the {@code mode} is {@link MapMode#READ_WRITE READ_WRITE} or * {@link MapMode#PRIVATE PRIVATE} but this channel was not opened * for both reading and writing * @@ -936,7 +936,7 @@ public abstract class FileChannel * will be thrown immediately; the thread's interrupt status will not be * changed. * - *

    The region specified by the position and size + *

    The region specified by the {@code position} and {@code size} * parameters need not be contained within, or even overlap, the actual * underlying file. Lock regions are fixed in size; if a locked region * initially contains the end of the file and the file grows beyond the @@ -963,12 +963,12 @@ public abstract class FileChannel * * @param size * The size of the locked region; must be non-negative, and the sum - * position + size must be non-negative + * {@code position} + {@code size} must be non-negative * * @param shared - * true to request a shared lock, in which case this + * {@code true} to request a shared lock, in which case this * channel must be open for reading (and possibly writing); - * false to request an exclusive lock, in which case this + * {@code false} to request an exclusive lock, in which case this * channel must be open for writing (and possibly reading) * * @return A lock object representing the newly-acquired lock @@ -994,11 +994,11 @@ public abstract class FileChannel * region * * @throws NonReadableChannelException - * If shared is true this channel was not + * If {@code shared} is {@code true} this channel was not * opened for reading * * @throws NonWritableChannelException - * If shared is false but this channel was not + * If {@code shared} is {@code false} but this channel was not * opened for writing * * @throws IOException @@ -1014,7 +1014,7 @@ public abstract class FileChannel /** * Acquires an exclusive lock on this channel's file. * - *

    An invocation of this method of the form fc.lock() behaves + *

    An invocation of this method of the form {@code fc.lock()} behaves * in exactly the same way as the invocation * *

    @@ -1060,10 +1060,10 @@ public abstract class FileChannel
          * immediately, either having acquired a lock on the requested region or
          * having failed to do so.  If it fails to acquire a lock because an
          * overlapping lock is held by another program then it returns
    -     * null.  If it fails to acquire a lock for any other reason then
    +     * {@code null}.  If it fails to acquire a lock for any other reason then
          * an appropriate exception is thrown.
          *
    -     * 

    The region specified by the position and size + *

    The region specified by the {@code position} and {@code size} * parameters need not be contained within, or even overlap, the actual * underlying file. Lock regions are fixed in size; if a locked region * initially contains the end of the file and the file grows beyond the @@ -1090,14 +1090,14 @@ public abstract class FileChannel * * @param size * The size of the locked region; must be non-negative, and the sum - * position + size must be non-negative + * {@code position} + {@code size} must be non-negative * * @param shared - * true to request a shared lock, - * false to request an exclusive lock + * {@code true} to request a shared lock, + * {@code false} to request an exclusive lock * * @return A lock object representing the newly-acquired lock, - * or null if the lock could not be acquired + * or {@code null} if the lock could not be acquired * because another program holds an overlapping lock * * @throws IllegalArgumentException @@ -1125,14 +1125,14 @@ public abstract class FileChannel /** * Attempts to acquire an exclusive lock on this channel's file. * - *

    An invocation of this method of the form fc.tryLock() + *

    An invocation of this method of the form {@code fc.tryLock()} * behaves in exactly the same way as the invocation * *

          *     fc.{@link #tryLock(long,long,boolean) tryLock}(0L, Long.MAX_VALUE, false) 
    * * @return A lock object representing the newly-acquired lock, - * or null if the lock could not be acquired + * or {@code null} if the lock could not be acquired * because another program holds an overlapping lock * * @throws ClosedChannelException diff --git a/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java b/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java index 73e351126ca..3a5c6a1a4b7 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java @@ -136,11 +136,11 @@ public abstract class FileLock implements AutoCloseable { * * @param size * The size of the locked region; must be non-negative, and the sum - * position + size must be non-negative + * {@code position} + {@code size} must be non-negative * * @param shared - * true if this lock is shared, - * false if it is exclusive + * {@code true} if this lock is shared, + * {@code false} if it is exclusive * * @throws IllegalArgumentException * If the preconditions on the parameters do not hold @@ -173,11 +173,11 @@ public abstract class FileLock implements AutoCloseable { * * @param size * The size of the locked region; must be non-negative, and the sum - * position + size must be non-negative + * {@code position} + {@code size} must be non-negative * * @param shared - * true if this lock is shared, - * false if it is exclusive + * {@code true} if this lock is shared, + * {@code false} if it is exclusive * * @throws IllegalArgumentException * If the preconditions on the parameters do not hold @@ -254,8 +254,8 @@ public abstract class FileLock implements AutoCloseable { /** * Tells whether this lock is shared. * - * @return true if lock is shared, - * false if it is exclusive + * @return {@code true} if lock is shared, + * {@code false} if it is exclusive */ public final boolean isShared() { return shared; @@ -269,7 +269,7 @@ public abstract class FileLock implements AutoCloseable { * @param size * The size of the lock range * - * @return true if, and only if, this lock and the given lock + * @return {@code true} if, and only if, this lock and the given lock * range overlap by at least one byte */ public final boolean overlaps(long position, long size) { @@ -286,7 +286,7 @@ public abstract class FileLock implements AutoCloseable { *

    A lock object remains valid until it is released or the associated * file channel is closed, whichever comes first.

    * - * @return true if, and only if, this lock is valid + * @return {@code true} if, and only if, this lock is valid */ public abstract boolean isValid(); diff --git a/jdk/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java index 9c50d9325e3..f2ae40e5170 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java @@ -66,11 +66,11 @@ public interface GatheringByteChannel * at the moment that this method is invoked. * *

    Suppose that a byte sequence of length n is written, where - * 0 <= n <= r. - * Up to the first srcs[offset].remaining() bytes of this sequence - * are written from buffer srcs[offset], up to the next - * srcs[offset+1].remaining() bytes are written from buffer - * srcs[offset+1], and so forth, until the entire byte sequence is + * {@code 0} {@code <=} n {@code <=} r. + * Up to the first {@code srcs[offset].remaining()} bytes of this sequence + * are written from buffer {@code srcs[offset]}, up to the next + * {@code srcs[offset+1].remaining()} bytes are written from buffer + * {@code srcs[offset+1]}, and so forth, until the entire byte sequence is * written. As many bytes as possible are written from each buffer, hence * the final position of each updated buffer, except the last updated * buffer, is guaranteed to be equal to that buffer's limit. @@ -92,17 +92,17 @@ public interface GatheringByteChannel * @param offset * The offset within the buffer array of the first buffer from * which bytes are to be retrieved; must be non-negative and no - * larger than srcs.length + * larger than {@code srcs.length} * * @param length * The maximum number of buffers to be accessed; must be * non-negative and no larger than - * srcs.length - offset + * {@code srcs.length} - {@code offset} * * @return The number of bytes written, possibly zero * * @throws IndexOutOfBoundsException - * If the preconditions on the offset and length + * If the preconditions on the {@code offset} and {@code length} * parameters do not hold * * @throws NonWritableChannelException @@ -131,7 +131,7 @@ public interface GatheringByteChannel /** * Writes a sequence of bytes to this channel from the given buffers. * - *

    An invocation of this method of the form c.write(srcs) + *

    An invocation of this method of the form {@code c.write(srcs)} * behaves in exactly the same manner as the invocation * *

    diff --git a/jdk/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java
    index 0e49aa680da..d13a37aeae4 100644
    --- a/jdk/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java
    +++ b/jdk/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java
    @@ -54,7 +54,7 @@ import java.io.IOException;
      *
      * 

    A channel supports asynchronous closing and interruption if, and only * if, it implements this interface. This can be tested at runtime, if - * necessary, via the instanceof operator. + * necessary, via the {@code instanceof} operator. * * * @author Mark Reinhold diff --git a/jdk/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java index 4cd99c0936c..83fd12b44fb 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java @@ -52,16 +52,16 @@ public interface ReadableByteChannel extends Channel { * *

    An attempt is made to read up to r bytes from the channel, * where r is the number of bytes remaining in the buffer, that is, - * dst.remaining(), at the moment this method is invoked. + * {@code dst.remaining()}, at the moment this method is invoked. * *

    Suppose that a byte sequence of length n is read, where - * 0 <= n <= r. + * {@code 0} {@code <=} n {@code <=} r. * This byte sequence will be transferred into the buffer so that the first * byte in the sequence is at index p and the last byte is at index - * p + n - 1, + * p {@code +} n {@code -} {@code 1}, * where p is the buffer's position at the moment this method is * invoked. Upon return the buffer's position will be equal to - * p + n; its limit will not have changed. + * p {@code +} n; its limit will not have changed. * *

    A read operation might not fill the buffer, and in fact it might not * read any bytes at all. Whether or not it does so depends upon the @@ -81,7 +81,7 @@ public interface ReadableByteChannel extends Channel { * @param dst * The buffer into which bytes are to be transferred * - * @return The number of bytes read, possibly zero, or -1 if the + * @return The number of bytes read, possibly zero, or {@code -1} if the * channel has reached end-of-stream * * @throws NonReadableChannelException diff --git a/jdk/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java index 7922909fe88..d4493979627 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java @@ -66,11 +66,11 @@ public interface ScatteringByteChannel * at the moment that this method is invoked. * *

    Suppose that a byte sequence of length n is read, where - * 0 <= n <= r. - * Up to the first dsts[offset].remaining() bytes of this sequence - * are transferred into buffer dsts[offset], up to the next - * dsts[offset+1].remaining() bytes are transferred into buffer - * dsts[offset+1], and so forth, until the entire byte sequence + * {@code 0} {@code <=} n {@code <=} r. + * Up to the first {@code dsts[offset].remaining()} bytes of this sequence + * are transferred into buffer {@code dsts[offset]}, up to the next + * {@code dsts[offset+1].remaining()} bytes are transferred into buffer + * {@code dsts[offset+1]}, and so forth, until the entire byte sequence * is transferred into the given buffers. As many bytes as possible are * transferred into each buffer, hence the final position of each updated * buffer, except the last updated buffer, is guaranteed to be equal to @@ -87,18 +87,18 @@ public interface ScatteringByteChannel * @param offset * The offset within the buffer array of the first buffer into * which bytes are to be transferred; must be non-negative and no - * larger than dsts.length + * larger than {@code dsts.length} * * @param length * The maximum number of buffers to be accessed; must be * non-negative and no larger than - * dsts.length - offset + * {@code dsts.length} - {@code offset} * * @return The number of bytes read, possibly zero, - * or -1 if the channel has reached end-of-stream + * or {@code -1} if the channel has reached end-of-stream * * @throws IndexOutOfBoundsException - * If the preconditions on the offset and length + * If the preconditions on the {@code offset} and {@code length} * parameters do not hold * * @throws NonReadableChannelException @@ -126,7 +126,7 @@ public interface ScatteringByteChannel /** * Reads a sequence of bytes from this channel into the given buffers. * - *

    An invocation of this method of the form c.read(dsts) + *

    An invocation of this method of the form {@code c.read(dsts)} * behaves in exactly the same manner as the invocation * *

    @@ -136,7 +136,7 @@ public interface ScatteringByteChannel
          *         The buffers into which bytes are to be transferred
          *
          * @return The number of bytes read, possibly zero,
    -     *         or -1 if the channel has reached end-of-stream
    +     *         or {@code -1} if the channel has reached end-of-stream
          *
          * @throws  NonReadableChannelException
          *          If this channel was not opened for reading
    diff --git a/jdk/src/java.base/share/classes/java/nio/channels/SelectableChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/SelectableChannel.java
    index 997d5c5ec57..8cf4dab27a4 100644
    --- a/jdk/src/java.base/share/classes/java/nio/channels/SelectableChannel.java
    +++ b/jdk/src/java.base/share/classes/java/nio/channels/SelectableChannel.java
    @@ -132,7 +132,7 @@ public abstract class SelectableChannel
          * of its keys have been cancelled.  A channel may also remain registered
          * for some time after it is closed.  

    * - * @return true if, and only if, this channel is registered + * @return {@code true} if, and only if, this channel is registered */ public abstract boolean isRegistered(); // @@ -146,7 +146,7 @@ public abstract class SelectableChannel * The selector * * @return The key returned when this channel was last registered with the - * given selector, or null if this channel is not + * given selector, or {@code null} if this channel is not * currently registered with that selector */ public abstract SelectionKey keyFor(Selector sel); @@ -159,16 +159,16 @@ public abstract class SelectableChannel * *

    If this channel is currently registered with the given selector then * the selection key representing that registration is returned. The key's - * interest set will have been changed to ops, as if by invoking + * interest set will have been changed to {@code ops}, as if by invoking * the {@link SelectionKey#interestOps(int) interestOps(int)} method. If - * the att argument is not null then the key's attachment + * the {@code att} argument is not {@code null} then the key's attachment * will have been set to that value. A {@link CancelledKeyException} will * be thrown if the key has already been cancelled. * *

    Otherwise this channel has not yet been registered with the given * selector, so it is registered and the resulting new key is returned. - * The key's initial interest set will be ops and its attachment - * will be att. + * The key's initial interest set will be {@code ops} and its attachment + * will be {@code att}. * *

    This method may be invoked at any time. If this method is invoked * while another invocation of this method or of the {@link @@ -189,7 +189,7 @@ public abstract class SelectableChannel * The interest set for the resulting key * * @param att - * The attachment for the resulting key; may be null + * The attachment for the resulting key; may be {@code null} * * @throws ClosedChannelException * If this channel is closed @@ -209,7 +209,7 @@ public abstract class SelectableChannel * but the corresponding key has already been cancelled * * @throws IllegalArgumentException - * If a bit in the ops set does not correspond to an + * If a bit in the {@code ops} set does not correspond to an * operation that is supported by this channel, that is, if * {@code set & ~validOps() != 0} * @@ -235,13 +235,13 @@ public abstract class SelectableChannel * *

    An invocation of this convenience method of the form * - *

    sc.register(sel, ops)
    + *
    {@code sc.register(sel, ops)}
    * * behaves in exactly the same way as the invocation * - *
    sc.{@link + *
    {@code sc.}{@link * #register(java.nio.channels.Selector,int,java.lang.Object) - * register}(sel, ops, null)
    + * register(sel, ops, null)}
    * * @param sel * The selector with which this channel is to be registered @@ -267,7 +267,7 @@ public abstract class SelectableChannel * but the corresponding key has already been cancelled * * @throws IllegalArgumentException - * If a bit in ops does not correspond to an operation + * If a bit in {@code ops} does not correspond to an operation * that is supported by this channel, that is, if {@code set & * ~validOps() != 0} * @@ -296,8 +296,8 @@ public abstract class SelectableChannel * of the {@link #register(Selector, int) register} method is in progress * then it will first block until the other operation is complete.

    * - * @param block If true then this channel will be placed in - * blocking mode; if false then it will be placed + * @param block If {@code true} then this channel will be placed in + * blocking mode; if {@code false} then it will be placed * non-blocking mode * * @return This selectable channel @@ -306,7 +306,7 @@ public abstract class SelectableChannel * If this channel is closed * * @throws IllegalBlockingModeException - * If block is true and this channel is + * If {@code block} is {@code true} and this channel is * registered with one or more selectors * * @throws IOException @@ -327,7 +327,7 @@ public abstract class SelectableChannel *

    If this channel is closed then the value returned by this method is * not specified.

    * - * @return true if, and only if, this channel is in blocking mode + * @return {@code true} if, and only if, this channel is in blocking mode */ public abstract boolean isBlocking(); diff --git a/jdk/src/java.base/share/classes/java/nio/channels/SelectionKey.java b/jdk/src/java.base/share/classes/java/nio/channels/SelectionKey.java index 00ea670f9ba..86c133d192f 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/SelectionKey.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/SelectionKey.java @@ -139,7 +139,7 @@ public abstract class SelectionKey { *

    A key is valid upon creation and remains so until it is cancelled, * its channel is closed, or its selector is closed.

    * - * @return true if, and only if, this key is valid + * @return {@code true} if, and only if, this key is valid */ public abstract boolean isValid(); @@ -218,11 +218,11 @@ public abstract class SelectionKey { * Operation-set bit for read operations. * *

    Suppose that a selection key's interest set contains - * OP_READ at the start of a selection operation. If the selector * detects that the corresponding channel is ready for reading, has reached * end-of-stream, has been remotely shut down for further reading, or has - * an error pending, then it will add OP_READ to the key's + * an error pending, then it will add {@code OP_READ} to the key's * ready-operation set and add the key to its selected-key set.

    */ public static final int OP_READ = 1 << 0; @@ -231,11 +231,11 @@ public abstract class SelectionKey { * Operation-set bit for write operations. * *

    Suppose that a selection key's interest set contains - * OP_WRITE at the start of a selection operation. If the selector * detects that the corresponding channel is ready for writing, has been * remotely shut down for further writing, or has an error pending, then it - * will add OP_WRITE to the key's ready set and add the key to its + * will add {@code OP_WRITE} to the key's ready set and add the key to its * selected-key set.

    */ public static final int OP_WRITE = 1 << 2; @@ -244,11 +244,11 @@ public abstract class SelectionKey { * Operation-set bit for socket-connect operations. * *

    Suppose that a selection key's interest set contains - * OP_CONNECT at the start of a selection operation. If the selector * detects that the corresponding socket channel is ready to complete its * connection sequence, or has an error pending, then it will add - * OP_CONNECT to the key's ready set and add the key to its + * {@code OP_CONNECT} to the key's ready set and add the key to its * selected-key set.

    */ public static final int OP_CONNECT = 1 << 3; @@ -257,11 +257,11 @@ public abstract class SelectionKey { * Operation-set bit for socket-accept operations. * *

    Suppose that a selection key's interest set contains - * OP_ACCEPT at the start of a selection operation. If the selector * detects that the corresponding server-socket channel is ready to accept * another connection, or has an error pending, then it will add - * OP_ACCEPT to the key's ready set and add the key to its + * {@code OP_ACCEPT} to the key's ready set and add the key to its * selected-key set.

    */ public static final int OP_ACCEPT = 1 << 4; @@ -269,7 +269,7 @@ public abstract class SelectionKey { /** * Tests whether this key's channel is ready for reading. * - *

    An invocation of this method of the form k.isReadable() + *

    An invocation of this method of the form {@code k.isReadable()} * behaves in exactly the same way as the expression * *

    {@code
    @@ -277,9 +277,9 @@ public abstract class SelectionKey {
          * }
    * *

    If this key's channel does not support read operations then this - * method always returns false.

    + * method always returns {@code false}.

    * - * @return true if, and only if, + * @return {@code true} if, and only if, {@code readyOps() & OP_READ} is nonzero * * @throws CancelledKeyException @@ -292,7 +292,7 @@ public abstract class SelectionKey { /** * Tests whether this key's channel is ready for writing. * - *

    An invocation of this method of the form k.isWritable() + *

    An invocation of this method of the form {@code k.isWritable()} * behaves in exactly the same way as the expression * *

    {@code
    @@ -300,9 +300,9 @@ public abstract class SelectionKey {
          * }
    * *

    If this key's channel does not support write operations then this - * method always returns false.

    + * method always returns {@code false}.

    * - * @return true if, and only if, + * @return {@code true} if, and only if, * {@code readyOps() & OP_WRITE} is nonzero * * @throws CancelledKeyException @@ -316,7 +316,7 @@ public abstract class SelectionKey { * Tests whether this key's channel has either finished, or failed to * finish, its socket-connection operation. * - *

    An invocation of this method of the form k.isConnectable() + *

    An invocation of this method of the form {@code k.isConnectable()} * behaves in exactly the same way as the expression * *

    {@code
    @@ -324,9 +324,9 @@ public abstract class SelectionKey {
          * }
    * *

    If this key's channel does not support socket-connect operations - * then this method always returns false.

    + * then this method always returns {@code false}.

    * - * @return true if, and only if, + * @return {@code true} if, and only if, * {@code readyOps() & OP_CONNECT} is nonzero * * @throws CancelledKeyException @@ -340,7 +340,7 @@ public abstract class SelectionKey { * Tests whether this key's channel is ready to accept a new socket * connection. * - *

    An invocation of this method of the form k.isAcceptable() + *

    An invocation of this method of the form {@code k.isAcceptable()} * behaves in exactly the same way as the expression * *

    {@code
    @@ -348,9 +348,9 @@ public abstract class SelectionKey {
          * }
    * *

    If this key's channel does not support socket-accept operations then - * this method always returns false.

    + * this method always returns {@code false}.

    * - * @return true if, and only if, + * @return {@code true} if, and only if, * {@code readyOps() & OP_ACCEPT} is nonzero * * @throws CancelledKeyException @@ -376,13 +376,13 @@ public abstract class SelectionKey { *

    An attached object may later be retrieved via the {@link #attachment() * attachment} method. Only one object may be attached at a time; invoking * this method causes any previous attachment to be discarded. The current - * attachment may be discarded by attaching null.

    + * attachment may be discarded by attaching {@code null}.

    * * @param ob - * The object to be attached; may be null + * The object to be attached; may be {@code null} * * @return The previously-attached object, if any, - * otherwise null + * otherwise {@code null} */ public final Object attach(Object ob) { return attachmentUpdater.getAndSet(this, ob); @@ -392,7 +392,7 @@ public abstract class SelectionKey { * Retrieves the current attachment. * * @return The object currently attached to this key, - * or null if there is no attachment + * or {@code null} if there is no attachment */ public final Object attachment() { return attachment; diff --git a/jdk/src/java.base/share/classes/java/nio/channels/Selector.java b/jdk/src/java.base/share/classes/java/nio/channels/Selector.java index ea72acb6400..cfed526b47d 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/Selector.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/Selector.java @@ -230,7 +230,7 @@ public abstract class Selector implements Closeable { /** * Tells whether or not this selector is open. * - * @return true if, and only if, this selector is open + * @return {@code true} if, and only if, this selector is open */ public abstract boolean isOpen(); @@ -309,7 +309,7 @@ public abstract class Selector implements Closeable { *

    This method does not offer real-time guarantees: It schedules the * timeout as if by invoking the {@link Object#wait(long)} method.

    * - * @param timeout If positive, block for up to timeout + * @param timeout If positive, block for up to {@code timeout} * milliseconds, more or less, while waiting for a * channel to become ready; if zero, block indefinitely; * must not be negative diff --git a/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java index 8d967b355c7..7c9666bbdd8 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java @@ -223,7 +223,7 @@ public abstract class ServerSocketChannel * Accepts a connection made to this channel's socket. * *

    If this channel is in non-blocking mode then this method will - * immediately return null if there are no pending connections. + * immediately return {@code null} if there are no pending connections. * Otherwise it will block indefinitely until a new connection is available * or an I/O error occurs. * @@ -239,7 +239,7 @@ public abstract class ServerSocketChannel * java.lang.SecurityManager#checkAccept checkAccept} method.

    * * @return The socket channel for the new connection, - * or null if this channel is in non-blocking mode + * or {@code null} if this channel is in non-blocking mode * and no connection is available to be accepted * * @throws ClosedChannelException diff --git a/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java index eb13b156eee..c25cc68edf2 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java @@ -58,7 +58,7 @@ import java.nio.channels.spi.SelectorProvider; * If the input side of a socket is shut down by one thread while another * thread is blocked in a read operation on the socket's channel, then the read * operation in the blocked thread will complete without reading any bytes and - * will return -1. If the output side of a socket is shut down by one + * will return {@code -1}. If the output side of a socket is shut down by one * thread while another thread is blocked in a write operation on the socket's * channel, then the blocked thread will receive an {@link * AsynchronousCloseException}. @@ -150,7 +150,7 @@ public abstract class SocketChannel * *

    This convenience method works as if by invoking the {@link #open()} * method, invoking the {@link #connect(SocketAddress) connect} method upon - * the resulting socket channel, passing it remote, and then + * the resulting socket channel, passing it {@code remote}, and then * returning that channel.

    * * @param remote @@ -204,9 +204,9 @@ public abstract class SocketChannel * operations. * *

    Socket channels support connecting, reading, and writing, so this - * method returns ({@link SelectionKey#OP_CONNECT} - * | {@link SelectionKey#OP_READ} | {@link - * SelectionKey#OP_WRITE}).

    + * method returns {@code (}{@link SelectionKey#OP_CONNECT} + * {@code |} {@link SelectionKey#OP_READ} {@code |} {@link + * SelectionKey#OP_WRITE}{@code )}. * * @return The valid-operation set */ @@ -304,7 +304,7 @@ public abstract class SocketChannel /** * Tells whether or not this channel's network socket is connected. * - * @return true if, and only if, this channel's network socket + * @return {@code true} if, and only if, this channel's network socket * is {@link #isOpen open} and connected */ public abstract boolean isConnected(); @@ -313,7 +313,7 @@ public abstract class SocketChannel * Tells whether or not a connection operation is in progress on this * channel. * - * @return true if, and only if, a connection operation has been + * @return {@code true} if, and only if, a connection operation has been * initiated on this channel but not yet completed by invoking the * {@link #finishConnect finishConnect} method */ @@ -325,8 +325,8 @@ public abstract class SocketChannel *

    If this channel is in non-blocking mode then an invocation of this * method initiates a non-blocking connection operation. If the connection * is established immediately, as can happen with a local connection, then - * this method returns true. Otherwise this method returns - * false and the connection operation must later be completed by + * this method returns {@code true}. Otherwise this method returns + * {@code false} and the connection operation must later be completed by * invoking the {@link #finishConnect finishConnect} method. * *

    If this channel is in blocking mode then an invocation of this @@ -349,8 +349,8 @@ public abstract class SocketChannel * @param remote * The remote address to which this channel is to be connected * - * @return true if a connection was established, - * false if this channel is in non-blocking mode + * @return {@code true} if a connection was established, + * {@code false} if this channel is in non-blocking mode * and the connection operation is in progress * * @throws AlreadyConnectedException @@ -400,11 +400,11 @@ public abstract class SocketChannel * {@link java.io.IOException} to be thrown. * *

    If this channel is already connected then this method will not block - * and will immediately return true. If this channel is in - * non-blocking mode then this method will return false if the + * and will immediately return {@code true}. If this channel is in + * non-blocking mode then this method will return {@code false} if the * connection process is not yet complete. If this channel is in blocking * mode then this method will block until the connection either completes - * or fails, and will always either return true or throw a checked + * or fails, and will always either return {@code true} or throw a checked * exception describing the failure. * *

    This method may be invoked at any time. If a read or write @@ -414,7 +414,7 @@ public abstract class SocketChannel * invocation of this method throws a checked exception, then the channel * will be closed.

    * - * @return true if, and only if, this channel's socket is now + * @return {@code true} if, and only if, this channel's socket is now * connected * * @throws NoConnectionPendingException diff --git a/jdk/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java index b2ea06598cd..ef8efa5037c 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java @@ -54,16 +54,16 @@ public interface WritableByteChannel * *

    An attempt is made to write up to r bytes to the channel, * where r is the number of bytes remaining in the buffer, that is, - * src.remaining(), at the moment this method is invoked. + * {@code src.remaining()}, at the moment this method is invoked. * *

    Suppose that a byte sequence of length n is written, where - * 0 <= n <= r. + * {@code 0} {@code <=} n {@code <=} r. * This byte sequence will be transferred from the buffer starting at index * p, where p is the buffer's position at the moment this * method is invoked; the index of the last byte written will be - * p + n - 1. + * p {@code +} n {@code -} {@code 1}. * Upon return the buffer's position will be equal to - * p + n; its limit will not have changed. + * p {@code +} n; its limit will not have changed. * *

    Unless otherwise specified, a write operation will return only after * writing all of the r requested bytes. Some types of channels, diff --git a/jdk/src/java.base/share/classes/java/nio/channels/package-info.java b/jdk/src/java.base/share/classes/java/nio/channels/package-info.java index 81183472108..b38bdea058a 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/package-info.java @@ -32,29 +32,29 @@ * *

    * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * *
    ChannelsDescription
    {@link java.nio.channels.Channel}
    {@link java.nio.channels.Channel}A nexus for I/O operations
      {@link java.nio.channels.ReadableByteChannel}
      {@link java.nio.channels.ReadableByteChannel}Can read into a buffer
        {@link java.nio.channels.ScatteringByteChannel}  
        {@link java.nio.channels.ScatteringByteChannel}  Can read into a sequence of buffers
      {@link java.nio.channels.WritableByteChannel}
      {@link java.nio.channels.WritableByteChannel}Can write from a buffer
        {@link java.nio.channels.GatheringByteChannel}
        {@link java.nio.channels.GatheringByteChannel}Can write from a sequence of buffers
      {@link java.nio.channels.ByteChannel}
      {@link java.nio.channels.ByteChannel}Can read/write to/from a buffer
        {@link java.nio.channels.SeekableByteChannel}
        {@link java.nio.channels.SeekableByteChannel}A {@code ByteChannel} connected to an entity that contains a variable-length sequence of bytes
      {@link java.nio.channels.AsynchronousChannel}
      {@link java.nio.channels.AsynchronousChannel}Supports asynchronous I/O operations.
        {@link java.nio.channels.AsynchronousByteChannel}
        {@link java.nio.channels.AsynchronousByteChannel}Can read and write bytes asynchronously
      {@link java.nio.channels.NetworkChannel}
      {@link java.nio.channels.NetworkChannel}A channel to a network socket
        {@link java.nio.channels.MulticastChannel}
        {@link java.nio.channels.MulticastChannel}Can join Internet Protocol (IP) multicast groups
    {@link java.nio.channels.Channels}
    {@link java.nio.channels.Channels}Utility methods for channel/stream interoperation
    * @@ -99,8 +99,8 @@ * Internet Protocol (IP) multicast groups. * *

    The {@link java.nio.channels.Channels} utility class defines static methods - * that support the interoperation of the stream classes of the {@link - * java.io} package with the channel classes of this package. An appropriate + * that support the interoperation of the stream classes of the {@link + * java.io} package with the channel classes of this package. An appropriate * channel can be constructed from an {@link java.io.InputStream} or an {@link * java.io.OutputStream}, and conversely an {@link java.io.InputStream} or an * {@link java.io.OutputStream} can be constructed from a channel. A {@link @@ -111,11 +111,11 @@ * *

    * - * + * * - * + * * - * + * * *
    File channelsDescription
    {@link java.nio.channels.FileChannel}
    {@link java.nio.channels.FileChannel}Reads, writes, maps, and manipulates files
    {@link java.nio.channels.FileLock}
    {@link java.nio.channels.FileLock}A lock on a (region of a) file
    {@link java.nio.MappedByteBuffer}  
    {@link java.nio.MappedByteBuffer}  A direct byte buffer mapped to a region of a file
    * @@ -133,30 +133,30 @@ * java.nio.channels.FileChannel#open open} methods, or by invoking the {@code * getChannel} method of a {@link java.io.FileInputStream}, {@link * java.io.FileOutputStream}, or {@link java.io.RandomAccessFile} to return a - * file channel connected to the same underlying file as the {@link java.io} + * file channel connected to the same underlying file as the {@link java.io} * class. * * *
    * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * *
    Multiplexed, non-blocking I/O

    Description

    {@link java.nio.channels.SelectableChannel}
    {@link java.nio.channels.SelectableChannel}A channel that can be multiplexed
      {@link java.nio.channels.DatagramChannel}
      {@link java.nio.channels.DatagramChannel}A channel to a datagram-oriented socket
      {@link java.nio.channels.Pipe.SinkChannel}
      {@link java.nio.channels.Pipe.SinkChannel}The write end of a pipe
      {@link java.nio.channels.Pipe.SourceChannel}
      {@link java.nio.channels.Pipe.SourceChannel}The read end of a pipe
      {@link java.nio.channels.ServerSocketChannel}  
      {@link java.nio.channels.ServerSocketChannel}  A channel to a stream-oriented listening socket
      {@link java.nio.channels.SocketChannel}
      {@link java.nio.channels.SocketChannel}A channel for a stream-oriented connecting socket
    {@link java.nio.channels.Selector}
    {@link java.nio.channels.Selector}A multiplexor of selectable channels
    {@link java.nio.channels.SelectionKey}
    {@link java.nio.channels.SelectionKey}A token representing the registration
    of a channel * with a selector
    {@link java.nio.channels.Pipe}
    {@link java.nio.channels.Pipe}Two channels that form a unidirectional pipe
    * @@ -194,18 +194,18 @@ * *

    This package defines selectable-channel classes corresponding to the {@link * java.net.DatagramSocket}, {@link java.net.ServerSocket}, and {@link - * java.net.Socket} classes defined in the {@link java.net} package. + * java.net.Socket} classes defined in the {@link java.net} package. * Minor changes to these classes have been made in order to support sockets that * are associated with channels. This package also defines a simple class that * implements unidirectional pipes. In all cases, a new selectable channel is - * created by invoking the static open method of the corresponding class. + * created by invoking the static {@code open} method of the corresponding class. * If a channel needs an associated socket then a socket will be created as a side * effect of this operation. * *

    The implementation of selectors, selectable channels, and selection keys * can be replaced by "plugging in" an alternative definition or instance of the - * {@link java.nio.channels.spi.SelectorProvider} class defined in the {@link - * java.nio.channels.spi} package. It is not expected that many developers + * {@link java.nio.channels.spi.SelectorProvider} class defined in the {@link + * java.nio.channels.spi} package. It is not expected that many developers * will actually make use of this facility; it is provided primarily so that * sophisticated users can take advantage of operating-system-specific * I/O-multiplexing mechanisms when very high performance is required. @@ -215,8 +215,8 @@ * java.nio.channels.spi.AbstractInterruptibleChannel}, {@link * java.nio.channels.spi.AbstractSelectableChannel}, {@link * java.nio.channels.spi.AbstractSelectionKey}, and {@link - * java.nio.channels.spi.AbstractSelector} classes in the {@link - * java.nio.channels.spi} package. When defining a custom selector provider, + * java.nio.channels.spi.AbstractSelector} classes in the {@link + * java.nio.channels.spi} package. When defining a custom selector provider, * only the {@link java.nio.channels.spi.AbstractSelector} and {@link * java.nio.channels.spi.AbstractSelectionKey} classes should be subclassed * directly; custom channel classes should extend the appropriate {@link @@ -226,15 +226,15 @@ * *

    * - * + * * - * + * * - * + * * - * + * * - * + * * *
    Asynchronous I/ODescription
    {@link java.nio.channels.AsynchronousFileChannel}
    {@link java.nio.channels.AsynchronousFileChannel}An asynchronous channel for reading, writing, and manipulating a file
    {@link java.nio.channels.AsynchronousSocketChannel}
    {@link java.nio.channels.AsynchronousSocketChannel}An asynchronous channel to a stream-oriented connecting socket
    {@link java.nio.channels.AsynchronousServerSocketChannel}  
    {@link java.nio.channels.AsynchronousServerSocketChannel}  An asynchronous channel to a stream-oriented listening socket
    {@link java.nio.channels.CompletionHandler}
    {@link java.nio.channels.CompletionHandler}A handler for consuming the result of an asynchronous operation
    {@link java.nio.channels.AsynchronousChannelGroup}
    {@link java.nio.channels.AsynchronousChannelGroup}A grouping of asynchronous channels for the purpose of resource sharing
    * @@ -272,13 +272,13 @@ *

    As with selectors, the implementation of asynchronous channels can be * replaced by "plugging in" an alternative definition or instance of the {@link * java.nio.channels.spi.AsynchronousChannelProvider} class defined in the - * {@link java.nio.channels.spi} package. It is not expected that many + * {@link java.nio.channels.spi} package. It is not expected that many * developers will actually make use of this facility; it is provided primarily * so that sophisticated users can take advantage of operating-system-specific * asynchronous I/O mechanisms when very high performance is required. * *


    - *

    Unless otherwise noted, passing a null argument to a constructor + *

    Unless otherwise noted, passing a {@code null} argument to a constructor * or method in any class or interface in this package will cause a {@link * java.lang.NullPointerException NullPointerException} to be thrown. * diff --git a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java index fccc2904c7d..e45be24c166 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java @@ -46,7 +46,7 @@ import sun.nio.ch.Interruptible; * before and after, respectively, invoking an I/O operation that might block * indefinitely. In order to ensure that the {@link #end end} method is always * invoked, these methods should be used within a - * try ... finally block: + * {@code try} ... {@code finally} block: * *

      * boolean completed = false;
    @@ -58,11 +58,11 @@ import sun.nio.ch.Interruptible;
      *     end(completed);
      * }
    * - *

    The completed argument to the {@link #end end} method tells + *

    The {@code completed} argument to the {@link #end end} method tells * whether or not the I/O operation actually completed, that is, whether it had * any effect that would be visible to the invoker. In the case of an * operation that reads bytes, for example, this argument should be - * true if, and only if, some bytes were actually transferred into the + * {@code true} if, and only if, some bytes were actually transferred into the * invoker's target buffer. * *

    A concrete channel class must also implement the {@link @@ -148,7 +148,7 @@ public abstract class AbstractInterruptibleChannel * Marks the beginning of an I/O operation that might block indefinitely. * *

    This method should be invoked in tandem with the {@link #end end} - * method, using a try ... finally block as + * method, using a {@code try} ... {@code finally} block as * shown above, in order to implement asynchronous * closing and interruption for this channel.

    */ @@ -177,12 +177,12 @@ public abstract class AbstractInterruptibleChannel * Marks the end of an I/O operation that might block indefinitely. * *

    This method should be invoked in tandem with the {@link #begin - * begin} method, using a try ... finally block + * begin} method, using a {@code try} ... {@code finally} block * as shown above, in order to implement asynchronous * closing and interruption for this channel.

    * * @param completed - * true if, and only if, the I/O operation completed + * {@code true} if, and only if, the I/O operation completed * successfully, that is, had some effect that would be visible to * the operation's invoker * diff --git a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java index 0de212d2df4..cb3ced9111d 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java @@ -305,8 +305,8 @@ public abstract class AbstractSelectableChannel * changing the blocking mode. This method is only invoked if the new mode * is different from the current mode.

    * - * @param block If true then this channel will be placed in - * blocking mode; if false then it will be placed + * @param block If {@code true} then this channel will be placed in + * blocking mode; if {@code false} then it will be placed * non-blocking mode * * @throws IOException diff --git a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java index 09e3b61491f..3c4eda99dc7 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java @@ -43,7 +43,7 @@ import java.util.concurrent.atomic.AtomicBoolean; * after, respectively, invoking an I/O operation that might block * indefinitely. In order to ensure that the {@link #end end} method is always * invoked, these methods should be used within a - * try ... finally block: + * {@code try} ... {@code finally} block: * *
      * try {
    @@ -197,7 +197,7 @@ public abstract class AbstractSelector
          * Marks the beginning of an I/O operation that might block indefinitely.
          *
          * 

    This method should be invoked in tandem with the {@link #end end} - * method, using a try ... finally block as + * method, using a {@code try} ... {@code finally} block as * shown above, in order to implement interruption for * this selector. * @@ -223,7 +223,7 @@ public abstract class AbstractSelector * Marks the end of an I/O operation that might block indefinitely. * *

    This method should be invoked in tandem with the {@link #begin begin} - * method, using a try ... finally block as + * method, using a {@code try} ... {@code finally} block as * shown above, in order to implement interruption for * this selector.

    */ diff --git a/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java b/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java index d14c853522b..f720261d03b 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java @@ -64,7 +64,7 @@ public abstract class AsynchronousChannelProvider { * * @throws SecurityException * If a security manager has been installed and it denies - * {@link RuntimePermission}("asynchronousChannelProvider") + * {@link RuntimePermission}{@code ("asynchronousChannelProvider")} */ protected AsynchronousChannelProvider() { this(checkPermission()); @@ -137,7 +137,7 @@ public abstract class AsynchronousChannelProvider { *
      * *
    1. If the system property - * java.nio.channels.spi.AsynchronousChannelProvider is defined + * {@code java.nio.channels.spi.AsynchronousChannelProvider} is defined * then it is taken to be the fully-qualified name of a concrete provider class. * The class is loaded and instantiated; if this process fails then an * unspecified error is thrown.

    2. @@ -145,8 +145,8 @@ public abstract class AsynchronousChannelProvider { *
    3. If a provider class has been installed in a jar file that is * visible to the system class loader, and that jar file contains a * provider-configuration file named - * java.nio.channels.spi.AsynchronousChannelProvider in the resource - * directory META-INF/services, then the first class name + * {@code java.nio.channels.spi.AsynchronousChannelProvider} in the resource + * directory {@code META-INF/services}, then the first class name * specified in that file is taken. The class is loaded and * instantiated; if this process fails then an unspecified error is * thrown.

    4. diff --git a/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java b/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java index ca704a8e5a5..cfe444a0041 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java @@ -46,7 +46,7 @@ import sun.security.action.GetPropertyAction; * #provider() provider} method. The first invocation of that method will locate * the default provider as specified below. * - *

      The system-wide default provider is used by the static open + *

      The system-wide default provider is used by the static {@code open} * methods of the {@link java.nio.channels.DatagramChannel#open * DatagramChannel}, {@link java.nio.channels.Pipe#open Pipe}, {@link * java.nio.channels.Selector#open Selector}, {@link @@ -54,7 +54,7 @@ import sun.security.action.GetPropertyAction; * java.nio.channels.SocketChannel#open SocketChannel} classes. It is also * used by the {@link java.lang.System#inheritedChannel System.inheritedChannel()} * method. A program may make use of a provider other than the default provider - * by instantiating that provider and then directly invoking the open + * by instantiating that provider and then directly invoking the {@code open} * methods defined in this class. * *

      All of the methods in this class are safe for use by multiple concurrent @@ -84,7 +84,7 @@ public abstract class SelectorProvider { * * @throws SecurityException * If a security manager has been installed and it denies - * {@link RuntimePermission}("selectorProvider") + * {@link RuntimePermission}{@code ("selectorProvider")} */ protected SelectorProvider() { this(checkPermission()); @@ -142,7 +142,7 @@ public abstract class SelectorProvider { *

        * *
      1. If the system property - * java.nio.channels.spi.SelectorProvider is defined then it is + * {@code java.nio.channels.spi.SelectorProvider} is defined then it is * taken to be the fully-qualified name of a concrete provider class. * The class is loaded and instantiated; if this process fails then an * unspecified error is thrown.

      2. @@ -150,8 +150,8 @@ public abstract class SelectorProvider { *
      3. If a provider class has been installed in a jar file that is * visible to the system class loader, and that jar file contains a * provider-configuration file named - * java.nio.channels.spi.SelectorProvider in the resource - * directory META-INF/services, then the first class name + * {@code java.nio.channels.spi.SelectorProvider} in the resource + * directory {@code META-INF/services}, then the first class name * specified in that file is taken. The class is loaded and * instantiated; if this process fails then an unspecified error is * thrown.

      4. @@ -305,14 +305,14 @@ public abstract class SelectorProvider { * returned. Subsequent invocations of this method return the same * channel.

        * - * @return The inherited channel, if any, otherwise null. + * @return The inherited channel, if any, otherwise {@code null}. * * @throws IOException * If an I/O error occurs * * @throws SecurityException * If a security manager has been installed and it denies - * {@link RuntimePermission}("inheritedChannel") + * {@link RuntimePermission}{@code ("inheritedChannel")} * * @since 1.5 */ diff --git a/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template b/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template index faa51bb45d4..74b6f928439 100644 --- a/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template +++ b/jdk/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template @@ -55,12 +55,12 @@ import java.util.Arrays; * has not been used before;

        * *
      5. Invoke the {@link #$code$ $code$} method zero or more times, as - * long as additional input may be available, passing false for the - * endOfInput argument and filling the input buffer and flushing the + * long as additional input may be available, passing {@code false} for the + * {@code endOfInput} argument and filling the input buffer and flushing the * output buffer between invocations;

      6. * *
      7. Invoke the {@link #$code$ $code$} method one final time, passing - * true for the endOfInput argument; and then

      8. + * {@code true} for the {@code endOfInput} argument; and then

        * *
      9. Invoke the {@link #flush flush} method so that the $coder$ can * flush any internal state to the output buffer.

      10. @@ -175,7 +175,7 @@ public abstract class Charset$Coder$ { * $otype$s that will be produced for each input $itype$ * * @param replacement - * The initial replacement; must not be null, must have + * The initial replacement; must not be {@code null}, must have * non-zero length, must not be longer than max$ItypesPerOtype$, * and must be {@linkplain #isLegalReplacement legal} * @@ -248,7 +248,7 @@ public abstract class Charset$Coder$ { * Returns this $coder$'s replacement value. * * @return This $coder$'s current replacement, - * which is never null and is never empty + * which is never {@code null} and is never empty */ public final $replType$ replacement() { #if[decoder] @@ -267,7 +267,7 @@ public abstract class Charset$Coder$ { * replacement is acceptable.

        * * @param newReplacement The new replacement; must not be - * null, must have non-zero length, + * {@code null}, must have non-zero length, #if[decoder] * and must not be longer than the value returned by the * {@link #max$ItypesPerOtype$() max$ItypesPerOtype$} method @@ -332,7 +332,7 @@ public abstract class Charset$Coder$ { * * @param repl The byte array to be tested * - * @return true if, and only if, the given byte array + * @return {@code true} if, and only if, the given byte array * is a legal replacement value for this encoder */ public boolean isLegalReplacement(byte[] repl) { @@ -358,7 +358,7 @@ public abstract class Charset$Coder$ { /** * Returns this $coder$'s current action for malformed-input errors. * - * @return The current malformed-input action, which is never null + * @return The current malformed-input action, which is never {@code null} */ public CodingErrorAction malformedInputAction() { return malformedInputAction; @@ -370,7 +370,7 @@ public abstract class Charset$Coder$ { *

        This method invokes the {@link #implOnMalformedInput * implOnMalformedInput} method, passing the new action.

        * - * @param newAction The new action; must not be null + * @param newAction The new action; must not be {@code null} * * @return This $coder$ * @@ -400,7 +400,7 @@ public abstract class Charset$Coder$ { * Returns this $coder$'s current action for unmappable-character errors. * * @return The current unmappable-character action, which is never - * null + * {@code null} */ public CodingErrorAction unmappableCharacterAction() { return unmappableCharacterAction; @@ -412,7 +412,7 @@ public abstract class Charset$Coder$ { *

        This method invokes the {@link #implOnUnmappableCharacter * implOnUnmappableCharacter} method, passing the new action.

        * - * @param newAction The new action; must not be null + * @param newAction The new action; must not be {@code null} * * @return This $coder$ * @@ -521,16 +521,16 @@ public abstract class Charset$Coder$ { * operation then care should be taken to preserve any $itype$s remaining * in the input buffer so that they are available to the next invocation. * - *

        The endOfInput parameter advises this method as to whether + *

        The {@code endOfInput} parameter advises this method as to whether * the invoker can provide further input beyond that contained in the given * input buffer. If there is a possibility of providing additional input - * then the invoker should pass false for this parameter; if there + * then the invoker should pass {@code false} for this parameter; if there * is no possibility of providing further input then the invoker should - * pass true. It is not erroneous, and in fact it is quite - * common, to pass false in one invocation and later discover that + * pass {@code true}. It is not erroneous, and in fact it is quite + * common, to pass {@code false} in one invocation and later discover that * no further input was actually available. It is critical, however, that * the final invocation of this method in a sequence of invocations always - * pass true so that any remaining un$code$d input will be treated + * pass {@code true} so that any remaining un$code$d input will be treated * as being malformed. * *

        This method works by invoking the {@link #$code$Loop $code$Loop} @@ -545,7 +545,7 @@ public abstract class Charset$Coder$ { * The output $otype$ buffer * * @param endOfInput - * true if, and only if, the invoker can provide no + * {@code true} if, and only if, the invoker can provide no * additional input $itype$s beyond those in the given buffer * * @return A coder-result object describing the reason for termination @@ -553,9 +553,9 @@ public abstract class Charset$Coder$ { * @throws IllegalStateException * If $a$ $coding$ operation is already in progress and the previous * step was an invocation neither of the {@link #reset reset} - * method, nor of this method with a value of false for - * the endOfInput parameter, nor of this method with a - * value of true for the endOfInput parameter + * method, nor of this method with a value of {@code false} for + * the {@code endOfInput} parameter, nor of this method with a + * value of {@code true} for the {@code endOfInput} parameter * but a return value indicating an incomplete $coding$ operation * * @throws CoderMalfunctionError @@ -659,7 +659,7 @@ public abstract class Charset$Coder$ { * invocation neither of the {@link #flush flush} method nor of * the three-argument {@link * #$code$($Itype$Buffer,$Otype$Buffer,boolean) $code$} method - * with a value of true for the endOfInput + * with a value of {@code true} for the {@code endOfInput} * parameter */ public final CoderResult flush($Otype$Buffer out) { @@ -824,10 +824,10 @@ public abstract class Charset$Coder$ { * Tells whether or not this decoder implements an auto-detecting charset. * *

        The default implementation of this method always returns - * false; it should be overridden by auto-detecting decoders to - * return true.

        + * {@code false}; it should be overridden by auto-detecting decoders to + * return {@code true}.

        * - * @return true if, and only if, this decoder implements an + * @return {@code true} if, and only if, this decoder implements an * auto-detecting charset */ public boolean isAutoDetecting() { @@ -840,21 +840,21 @@ public abstract class Charset$Coder$ { * *

        If this decoder implements an auto-detecting charset then at a * single point during a decoding operation this method may start returning - * true to indicate that a specific charset has been detected in + * {@code true} to indicate that a specific charset has been detected in * the input byte sequence. Once this occurs, the {@link #detectedCharset * detectedCharset} method may be invoked to retrieve the detected charset. * - *

        That this method returns false does not imply that no bytes + *

        That this method returns {@code false} does not imply that no bytes * have yet been decoded. Some auto-detecting decoders are capable of * decoding some, or even all, of an input byte sequence without fixing on * a particular charset. * *

        The default implementation of this method always throws an {@link * UnsupportedOperationException}; it should be overridden by - * auto-detecting decoders to return true once the input charset + * auto-detecting decoders to return {@code true} once the input charset * has been determined.

        * - * @return true if, and only if, this decoder has detected a + * @return {@code true} if, and only if, this decoder has detected a * specific charset * * @throws UnsupportedOperationException @@ -880,7 +880,7 @@ public abstract class Charset$Coder$ { * auto-detecting decoders to return the appropriate value.

        * * @return The charset detected by this auto-detecting decoder, - * or null if the charset has not yet been determined + * or {@code null} if the charset has not yet been determined * * @throws IllegalStateException * If insufficient bytes have been read to determine a charset @@ -920,7 +920,7 @@ public abstract class Charset$Coder$ { /** * Tells whether or not this encoder can encode the given character. * - *

        This method returns false if the given character is a + *

        This method returns {@code false} if the given character is a * surrogate character; such characters can be interpreted only when they * are members of a pair consisting of a high surrogate followed by a low * surrogate. The {@link #canEncode(java.lang.CharSequence) @@ -937,7 +937,7 @@ public abstract class Charset$Coder$ { * @param c * The given character * - * @return true if, and only if, this encoder can encode + * @return {@code true} if, and only if, this encoder can encode * the given character * * @throws IllegalStateException @@ -954,7 +954,7 @@ public abstract class Charset$Coder$ { * Tells whether or not this encoder can encode the given character * sequence. * - *

        If this method returns false for a particular character + *

        If this method returns {@code false} for a particular character * sequence then more information about why the sequence cannot be encoded * may be obtained by performing a full encoding * operation. @@ -968,7 +968,7 @@ public abstract class Charset$Coder$ { * @param cs * The given character sequence * - * @return true if, and only if, this encoder can encode + * @return {@code true} if, and only if, this encoder can encode * the given character without throwing any exceptions and without * performing any replacements * diff --git a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java index a242b9c7ac8..6766cb53c3d 100644 --- a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java +++ b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java @@ -73,29 +73,29 @@ import sun.security.action.GetPropertyAction; * *

          * - *
        • The uppercase letters 'A' through 'Z' - * ('\u0041' through '\u005a'), + *
        • The uppercase letters {@code 'A'} through {@code 'Z'} + * ('\u0041' through '\u005a'), * - *
        • The lowercase letters 'a' through 'z' - * ('\u0061' through '\u007a'), + *
        • The lowercase letters {@code 'a'} through {@code 'z'} + * ('\u0061' through '\u007a'), * - *
        • The digits '0' through '9' - * ('\u0030' through '\u0039'), + *
        • The digits {@code '0'} through {@code '9'} + * ('\u0030' through '\u0039'), * - *
        • The dash character '-' - * ('\u002d'HYPHEN-MINUS), + *
        • The dash character {@code '-'} + * ('\u002d'HYPHEN-MINUS), * - *
        • The plus character '+' - * ('\u002b'PLUS SIGN), + *
        • The plus character {@code '+'} + * ('\u002b'PLUS SIGN), * - *
        • The period character '.' - * ('\u002e'FULL STOP), + *
        • The period character {@code '.'} + * ('\u002e'FULL STOP), * - *
        • The colon character ':' - * ('\u003a'COLON), and + *
        • The colon character {@code ':'} + * ('\u003a'COLON), and * - *
        • The underscore character '_' - * ('\u005f'LOW LINE). + *
        • The underscore character {@code '_'} + * ('\u005f'LOW LINE). * *
        * @@ -115,7 +115,7 @@ import sun.security.action.GetPropertyAction; *

        Some charsets have an historical name that is defined for * compatibility with previous versions of the Java platform. A charset's * historical name is either its canonical name or one of its aliases. The - * historical name is returned by the getEncoding() methods of the + * historical name is returned by the {@code getEncoding()} methods of the * {@link java.io.InputStreamReader#getEncoding InputStreamReader} and {@link * java.io.OutputStreamWriter#getEncoding OutputStreamWriter} classes. * @@ -128,7 +128,7 @@ import sun.security.action.GetPropertyAction; * than one registry name then its canonical name must be the MIME-preferred * name and the other names in the registry must be valid aliases. If a * supported charset is not listed in the IANA registry then its canonical name - * must begin with one of the strings "X-" or "x-". + * must begin with one of the strings {@code "X-"} or {@code "x-"}. * *

        The IANA charset registry does change over time, and so the canonical * name and the aliases of a particular charset may also change over time. To @@ -148,53 +148,53 @@ import sun.security.action.GetPropertyAction; * *

        * - * - * + * - * - * - * + * + * + * * - * + * * - * + * * - * + * * *
        CharsetDescription
        US-ASCIISeven-bit ASCII, a.k.a. ISO646-US, + *
        {@code US-ASCII}Seven-bit ASCII, a.k.a. {@code ISO646-US}, * a.k.a. the Basic Latin block of the Unicode character set
        ISO-8859-1  ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1
        UTF-8
        ISO-8859-1  ISO Latin Alphabet No. 1, a.k.a. {@code ISO-LATIN-1}
        {@code UTF-8}Eight-bit UCS Transformation Format
        UTF-16BE
        {@code UTF-16BE}Sixteen-bit UCS Transformation Format, * big-endian byte order
        UTF-16LE
        {@code UTF-16LE}Sixteen-bit UCS Transformation Format, * little-endian byte order
        UTF-16
        {@code UTF-16}Sixteen-bit UCS Transformation Format, * byte order identified by an optional byte-order mark
        * - *

        The UTF-8 charset is specified by The {@code UTF-8} charset is specified by RFC 2279; the * transformation format upon which it is based is specified in * Amendment 2 of ISO 10646-1 and is also described in the Unicode * Standard. * - *

        The UTF-16 charsets are specified by The {@code UTF-16} charsets are specified by RFC 2781; the * transformation formats upon which they are based are specified in * Amendment 1 of ISO 10646-1 and are also described in the Unicode * Standard. * - *

        The UTF-16 charsets use sixteen-bit quantities and are + *

        The {@code UTF-16} charsets use sixteen-bit quantities and are * therefore sensitive to byte order. In these encodings the byte order of a * stream may be indicated by an initial byte-order mark represented by - * the Unicode character '\uFEFF'. Byte-order marks are handled + * the Unicode character '\uFEFF'. Byte-order marks are handled * as follows: * *

          * - *
        • When decoding, the UTF-16BE and UTF-16LE + *

        • When decoding, the {@code UTF-16BE} and {@code UTF-16LE} * charsets interpret the initial byte-order marks as a ZERO-WIDTH * NON-BREAKING SPACE; when encoding, they do not write * byte-order marks.

        • * - *
        • When decoding, the UTF-16 charset interprets the + *

        • When decoding, the {@code UTF-16} charset interprets the * byte-order mark at the beginning of the input stream to indicate the * byte-order of the stream but defaults to big-endian if there is no * byte-order mark; when encoding, it uses big-endian byte order and writes @@ -247,9 +247,9 @@ import sun.security.action.GetPropertyAction; * character-encoding scheme then the corresponding charset is usually * named for the coded character set; otherwise a charset is usually named * for the encoding scheme and, possibly, the locale of the coded - * character sets that it supports. Hence US-ASCII is both the + * character sets that it supports. Hence {@code US-ASCII} is both the * name of a coded character set and of the charset that encodes it, while - * EUC-JP is the name of the charset that encodes the + * {@code EUC-JP} is the name of the charset that encodes the * JIS X 0201, JIS X 0208, and JIS X 0212 * coded character sets for the Japanese language. * @@ -495,14 +495,14 @@ public abstract class Charset * The name of the requested charset; may be either * a canonical name or an alias * - * @return true if, and only if, support for the named charset + * @return {@code true} if, and only if, support for the named charset * is available in the current Java virtual machine * * @throws IllegalCharsetNameException * If the given charset name is illegal * * @throws IllegalArgumentException - * If the given charsetName is null + * If the given {@code charsetName} is null */ public static boolean isSupported(String charsetName) { return (lookup(charsetName) != null); @@ -521,7 +521,7 @@ public abstract class Charset * If the given charset name is illegal * * @throws IllegalArgumentException - * If the given charsetName is null + * If the given {@code charsetName} is null * * @throws UnsupportedCharsetException * If no support for the named charset is available @@ -692,7 +692,7 @@ public abstract class Charset * href="http://www.iana.org/assignments/character-sets">IANA Charset * Registry. * - * @return true if, and only if, this charset is known by its + * @return {@code true} if, and only if, this charset is known by its * implementor to be registered with the IANA */ public final boolean isRegistered() { @@ -732,15 +732,15 @@ public abstract class Charset *

          Every charset contains itself. * *

          This method computes an approximation of the containment relation: - * If it returns true then the given charset is known to be - * contained by this charset; if it returns false, however, then + * If it returns {@code true} then the given charset is known to be + * contained by this charset; if it returns {@code false}, however, then * it is not necessarily the case that the given charset is not contained * in this charset. * * @param cs * The given charset * - * @return true if the given charset is contained in this charset + * @return {@code true} if the given charset is contained in this charset */ public abstract boolean contains(Charset cs); @@ -770,9 +770,9 @@ public abstract class Charset * input byte sequence. Such charsets do not support encoding because * there is no way to determine which encoding should be used on output. * Implementations of such charsets should override this method to return - * false.

          + * {@code false}.

          * - * @return true if, and only if, this charset supports encoding + * @return {@code true} if, and only if, this charset supports encoding */ public boolean canEncode() { return true; @@ -782,7 +782,7 @@ public abstract class Charset * Convenience method that decodes bytes in this charset into Unicode * characters. * - *

          An invocation of this method upon a charset cs returns the + *

          An invocation of this method upon a charset {@code cs} returns the * same result as the expression * *

          @@ -818,7 +818,7 @@ public abstract class Charset
                * Convenience method that encodes Unicode characters into bytes in this
                * charset.
                *
          -     * 

          An invocation of this method upon a charset cs returns the + *

          An invocation of this method upon a charset {@code cs} returns the * same result as the expression * *

          @@ -853,7 +853,7 @@ public abstract class Charset
               /**
                * Convenience method that encodes a string into bytes in this charset.
                *
          -     * 

          An invocation of this method upon a charset cs returns the + *

          An invocation of this method upon a charset {@code cs} returns the * same result as the expression * *

          @@ -898,7 +898,7 @@ public abstract class Charset
                * 

          Two charsets are equal if, and only if, they have the same canonical * names. A charset is never equal to any other type of object.

          * - * @return true if, and only if, this charset is equal to the + * @return {@code true} if, and only if, this charset is equal to the * given object */ public final boolean equals(Object ob) { diff --git a/jdk/src/java.base/share/classes/java/nio/charset/CoderResult.java b/jdk/src/java.base/share/classes/java/nio/charset/CoderResult.java index 79d4843e2de..3d5e1c43a65 100644 --- a/jdk/src/java.base/share/classes/java/nio/charset/CoderResult.java +++ b/jdk/src/java.base/share/classes/java/nio/charset/CoderResult.java @@ -46,24 +46,24 @@ import java.util.HashMap; * processed, or there is insufficient input and additional input is * required. This condition is represented by the unique result object * {@link #UNDERFLOW}, whose {@link #isUnderflow() isUnderflow} method - * returns true.

        • + * returns {@code true}.

          * *
        • Overflow is reported when there is insufficient room * remaining in the output buffer. This condition is represented by the * unique result object {@link #OVERFLOW}, whose {@link #isOverflow() - * isOverflow} method returns true.

        • + * isOverflow} method returns {@code true}.

          * *
        • A malformed-input error is reported when a sequence of * input units is not well-formed. Such errors are described by instances of * this class whose {@link #isMalformed() isMalformed} method returns - * true and whose {@link #length() length} method returns the length + * {@code true} and whose {@link #length() length} method returns the length * of the malformed sequence. There is one unique instance of this class for * all malformed-input errors of a given length.

        • * *
        • An unmappable-character error is reported when a sequence * of input units denotes a character that cannot be represented in the * output charset. Such errors are described by instances of this class - * whose {@link #isUnmappable() isUnmappable} method returns true and + * whose {@link #isUnmappable() isUnmappable} method returns {@code true} and * whose {@link #length() length} method returns the length of the input * sequence denoting the unmappable character. There is one unique instance * of this class for all unmappable-character errors of a given length. @@ -71,9 +71,9 @@ import java.util.HashMap; * *

        * - *

        For convenience, the {@link #isError() isError} method returns true + *

        For convenience, the {@link #isError() isError} method returns {@code true} * for result objects that describe malformed-input and unmappable-character - * errors but false for those that describe underflow or overflow + * errors but {@code false} for those that describe underflow or overflow * conditions.

        * * @@ -114,7 +114,7 @@ public class CoderResult { /** * Tells whether or not this object describes an underflow condition. * - * @return true if, and only if, this object denotes underflow + * @return {@code true} if, and only if, this object denotes underflow */ public boolean isUnderflow() { return (type == CR_UNDERFLOW); @@ -123,7 +123,7 @@ public class CoderResult { /** * Tells whether or not this object describes an overflow condition. * - * @return true if, and only if, this object denotes overflow + * @return {@code true} if, and only if, this object denotes overflow */ public boolean isOverflow() { return (type == CR_OVERFLOW); @@ -132,7 +132,7 @@ public class CoderResult { /** * Tells whether or not this object describes an error condition. * - * @return true if, and only if, this object denotes either a + * @return {@code true} if, and only if, this object denotes either a * malformed-input error or an unmappable-character error */ public boolean isError() { @@ -142,7 +142,7 @@ public class CoderResult { /** * Tells whether or not this object describes a malformed-input error. * - * @return true if, and only if, this object denotes a + * @return {@code true} if, and only if, this object denotes a * malformed-input error */ public boolean isMalformed() { @@ -153,7 +153,7 @@ public class CoderResult { * Tells whether or not this object describes an unmappable-character * error. * - * @return true if, and only if, this object denotes an + * @return {@code true} if, and only if, this object denotes an * unmappable-character error */ public boolean isUnmappable() { @@ -168,7 +168,7 @@ public class CoderResult { * * @throws UnsupportedOperationException * If this object does not describe an error condition, that is, - * if the {@link #isError() isError} does not return true + * if the {@link #isError() isError} does not return {@code true} */ public int length() { if (!isError()) diff --git a/jdk/src/java.base/share/classes/java/nio/charset/package-info.java b/jdk/src/java.base/share/classes/java/nio/charset/package-info.java index e18f568004a..9d93a710a25 100644 --- a/jdk/src/java.base/share/classes/java/nio/charset/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/charset/package-info.java @@ -74,10 +74,10 @@ * *

        Support for new charsets can be made available via the * interface defined in the {@link - * java.nio.charset.spi.CharsetProvider} class in the {@link - * java.nio.charset.spi} package. + * java.nio.charset.spi.CharsetProvider} class in the {@link + * java.nio.charset.spi} package. * - *

        Unless otherwise noted, passing a null argument to a + *

        Unless otherwise noted, passing a {@code null} argument to a * constructor or method in any class or interface in this package * will cause a {@link java.lang.NullPointerException * NullPointerException} to be thrown. diff --git a/jdk/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java b/jdk/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java index f859245a9dc..63f01bf7cfa 100644 --- a/jdk/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java +++ b/jdk/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java @@ -42,13 +42,13 @@ import java.util.Iterator; * loader}. * *

        A charset provider identifies itself with a provider-configuration file - * named java.nio.charset.spi.CharsetProvider in the resource - * directory META-INF/services. The file should contain a list of + * named {@code java.nio.charset.spi.CharsetProvider} in the resource + * directory {@code META-INF/services}. The file should contain a list of * fully-qualified concrete charset-provider class names, one per line. A line - * is terminated by any one of a line feed ('\n'), a carriage return - * ('\r'), or a carriage return followed immediately by a line feed. + * is terminated by any one of a line feed ({@code '\n'}), a carriage return + * ({@code '\r'}), or a carriage return followed immediately by a line feed. * Space and tab characters surrounding each name, as well as blank lines, are - * ignored. The comment character is '#' ('\u0023'); on + * ignored. The comment character is {@code '#'} ('\u0023'); on * each line all characters following the first comment character are ignored. * The file must be encoded in UTF-8. * @@ -83,7 +83,7 @@ public abstract class CharsetProvider { * * @throws SecurityException * If a security manager has been installed and it denies - * {@link RuntimePermission}("charsetProvider") + * {@link RuntimePermission}{@code ("charsetProvider")} */ protected CharsetProvider() { this(checkPermission()); @@ -107,7 +107,7 @@ public abstract class CharsetProvider { * a canonical name or an alias * * @return A charset object for the named charset, - * or null if the named charset + * or {@code null} if the named charset * is not supported by this provider */ public abstract Charset charsetForName(String charsetName); diff --git a/jdk/src/java.base/share/classes/java/nio/exceptions b/jdk/src/java.base/share/classes/java/nio/exceptions index 062ccc4e438..d8cba29cc2d 100644 --- a/jdk/src/java.base/share/classes/java/nio/exceptions +++ b/jdk/src/java.base/share/classes/java/nio/exceptions @@ -56,5 +56,5 @@ SUPER=UnsupportedOperationException gen ReadOnlyBufferException " * Unchecked exception thrown when a content-mutation method such as - * put or compact is invoked upon a read-only buffer." \ + * put or compact is invoked upon a read-only buffer." \ -1210063976496234090L diff --git a/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java b/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java index 03ace89e7ac..1c60862c857 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java +++ b/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java @@ -202,7 +202,7 @@ public abstract class FileSystem * *

        In the case of the default provider, and a security manager is * installed, the security manager is invoked to check {@link - * RuntimePermission}("getFileStoreAttributes"). If denied, then + * RuntimePermission}{@code ("getFileStoreAttributes")}. If denied, then * no file stores are returned by the iterator. In addition, the security * manager's {@link SecurityManager#checkRead(String)} method is invoked to * check read access to the file store's top-most directory. If @@ -334,19 +334,19 @@ public abstract class FileSystem * character extension * * - * /home/*/* - * Matches /home/gus/data on UNIX platforms + * /home/*/* + * Matches /home/gus/data on UNIX platforms * * - * /home/** - * Matches /home/gus and - * /home/gus/data on UNIX platforms + * /home/** + * Matches /home/gus and + * /home/gus/data on UNIX platforms * * - * C:\\* - * Matches C:\foo and C:\bar on the Windows + * C:\\* + * Matches C:\foo and C:\bar on the Windows * platform (note that the backslash is escaped; as a string literal in the - * Java Language the pattern would be "C:\\\\*") + * Java Language the pattern would be "C:\\\\*") * * * @@ -390,7 +390,7 @@ public abstract class FileSystem * character is used to separate the subpatterns. Groups cannot be nested. *

        * - *
      11. Leading period/dot characters in file name are + *

      12. Leading period/dot characters in file name are * treated as regular characters in match operations. For example, * the {@code "*"} glob pattern matches file name {@code ".login"}. * The {@link Files#isHidden} method may be used to test whether a file diff --git a/jdk/src/java.base/share/classes/java/nio/file/Files.java b/jdk/src/java.base/share/classes/java/nio/file/Files.java index 6f968297631..3fb7fe28c94 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/Files.java +++ b/jdk/src/java.base/share/classes/java/nio/file/Files.java @@ -1033,7 +1033,7 @@ public final class Files { * if an I/O error occurs * @throws SecurityException * In the case of the default provider, and a security manager - * is installed, it denies {@link LinkPermission}("symbolic") + * is installed, it denies {@link LinkPermission}{@code ("symbolic")} * or its {@link SecurityManager#checkWrite(String) checkWrite} * method denies write access to the path of the symbolic link. */ @@ -1078,7 +1078,7 @@ public final class Files { * if an I/O error occurs * @throws SecurityException * In the case of the default provider, and a security manager - * is installed, it denies {@link LinkPermission}("hard") + * is installed, it denies {@link LinkPermission}{@code ("hard")} * or its {@link SecurityManager#checkWrite(String) checkWrite} * method denies write access to either the link or the * existing file. @@ -1455,8 +1455,8 @@ public final class Files { * In the case of the default provider, and a security manager is * installed, the {@link SecurityManager#checkRead(String) checkRead} * method is invoked to check read access to the file, and in - * addition it checks {@link RuntimePermission} - * ("getFileStoreAttributes") + * addition it checks + * {@link RuntimePermission}{@code ("getFileStoreAttributes")} */ public static FileStore getFileStore(Path path) throws IOException { return provider(path).getFileStore(path); @@ -1995,7 +1995,8 @@ public final class Files { * if an I/O error occurs * @throws SecurityException * In the case of the default provider, a security manager is - * installed, and it denies {@link RuntimePermission}("accessUserInformation") + * installed, and it denies + * {@link RuntimePermission}{@code ("accessUserInformation")} * or its {@link SecurityManager#checkRead(String) checkRead} method * denies read access to the file. */ @@ -2032,7 +2033,8 @@ public final class Files { * if an I/O error occurs * @throws SecurityException * In the case of the default provider, and a security manager is - * installed, it denies {@link RuntimePermission}("accessUserInformation") + * installed, it denies + * {@link RuntimePermission}{@code ("accessUserInformation")} * or its {@link SecurityManager#checkWrite(String) checkWrite} * method denies write access to the file. */ @@ -2069,7 +2071,8 @@ public final class Files { * if an I/O error occurs * @throws SecurityException * In the case of the default provider, and a security manager is - * installed, it denies {@link RuntimePermission}("accessUserInformation") + * installed, it denies + * {@link RuntimePermission}{@code ("accessUserInformation")} * or its {@link SecurityManager#checkRead(String) checkRead} method * denies read access to the file. */ @@ -2112,7 +2115,8 @@ public final class Files { * if an I/O error occurs * @throws SecurityException * In the case of the default provider, and a security manager is - * installed, it denies {@link RuntimePermission}("accessUserInformation") + * installed, it denies + * {@link RuntimePermission}{@code ("accessUserInformation")} * or its {@link SecurityManager#checkWrite(String) checkWrite} * method denies write access to the file. * diff --git a/jdk/src/java.base/share/classes/java/nio/file/InvalidPathException.java b/jdk/src/java.base/share/classes/java/nio/file/InvalidPathException.java index c3d617b2896..0502d7ba809 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/InvalidPathException.java +++ b/jdk/src/java.base/share/classes/java/nio/file/InvalidPathException.java @@ -46,13 +46,13 @@ public class InvalidPathException * @param input the input string * @param reason a string explaining why the input was rejected * @param index the index at which the error occurred, - * or -1 if the index is not known + * or {@code -1} if the index is not known * * @throws NullPointerException - * if either the input or reason strings are null + * if either the input or reason strings are {@code null} * * @throws IllegalArgumentException - * if the error index is less than -1 + * if the error index is less than {@code -1} */ public InvalidPathException(String input, String reason, int index) { super(reason); @@ -66,13 +66,13 @@ public class InvalidPathException /** * Constructs an instance from the given input string and reason. The - * resulting object will have an error index of -1. + * resulting object will have an error index of {@code -1}. * * @param input the input string * @param reason a string explaining why the input was rejected * * @throws NullPointerException - * if either the input or reason strings are null + * if either the input or reason strings are {@code null} */ public InvalidPathException(String input, String reason) { this(input, reason, -1); @@ -98,7 +98,7 @@ public class InvalidPathException /** * Returns an index into the input string of the position at which the - * error occurred, or -1 if this position is not known. + * error occurred, or {@code -1} if this position is not known. * * @return the error index */ @@ -109,8 +109,8 @@ public class InvalidPathException /** * Returns a string describing the error. The resulting string * consists of the reason string followed by a colon character - * (':'), a space, and the input string. If the error index is - * defined then the string " at index " followed by the index, in + * ({@code ':'}), a space, and the input string. If the error index is + * defined then the string {@code " at index "} followed by the index, in * decimal, is inserted after the reason string and before the colon * character. * diff --git a/jdk/src/java.base/share/classes/java/nio/file/Path.java b/jdk/src/java.base/share/classes/java/nio/file/Path.java index 8387a8e9597..ac497c3c0cf 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/Path.java +++ b/jdk/src/java.base/share/classes/java/nio/file/Path.java @@ -480,7 +480,8 @@ public interface Path *

        For any two {@link #normalize normalized} paths p and * q, where q does not have a root component, *

        - * p.relativize(p.resolve(q)).equals(q) + * p{@code .relativize(}p + * {@code .resolve(}q{@code )).equals(}q{@code )} *
        * *

        When symbolic links are supported, then whether the resulting path, @@ -525,9 +526,9 @@ public interface Path *

        The default provider provides a similar round-trip guarantee * to the {@link java.io.File} class. For a given {@code Path} p it * is guaranteed that - *

        - * {@link Paths#get(URI) Paths.get}(p.toUri()).equals(p - * .{@link #toAbsolutePath() toAbsolutePath}()) + *
        + * {@link Paths#get(URI) Paths.get}{@code (}p{@code .toUri()).equals(}p + * {@code .}{@link #toAbsolutePath() toAbsolutePath}{@code ())} *
        * so long as the original {@code Path}, the {@code URI}, and the new {@code * Path} are all created in (possibly different invocations of) the same diff --git a/jdk/src/java.base/share/classes/java/nio/file/Paths.java b/jdk/src/java.base/share/classes/java/nio/file/Paths.java index bb49f99121e..3f57aaf7cb8 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/Paths.java +++ b/jdk/src/java.base/share/classes/java/nio/file/Paths.java @@ -103,9 +103,9 @@ public final class Paths { *

        The default provider provides a similar round-trip guarantee * to the {@link java.io.File} class. For a given {@code Path} p it * is guaranteed that - *

        - * Paths.get(p.{@link Path#toUri() toUri}()).equals( - * p.{@link Path#toAbsolutePath() toAbsolutePath}()) + *
        {@code + * Paths.get(}p{@code .}{@link Path#toUri() toUri}{@code ()).equals(} + * p{@code .}{@link Path#toAbsolutePath() toAbsolutePath}{@code ())} *
        * so long as the original {@code Path}, the {@code URI}, and the new {@code * Path} are all created in (possibly different invocations of) the same diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java index 129d0ee2197..429bfde8a1b 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java @@ -165,7 +165,7 @@ public interface AclFileAttributeView * if an I/O error occurs * @throws SecurityException * In the case of the default provider, a security manager is - * installed, and it denies {@link RuntimePermission}("accessUserInformation") + * installed, and it denies {@link RuntimePermission}{@code ("accessUserInformation")} * or its {@link SecurityManager#checkRead(String) checkRead} method * denies read access to the file. */ @@ -201,7 +201,7 @@ public interface AclFileAttributeView * if an I/O error occurs or the ACL is invalid * @throws SecurityException * In the case of the default provider, a security manager is - * installed, it denies {@link RuntimePermission}("accessUserInformation") + * installed, it denies {@link RuntimePermission}{@code ("accessUserInformation")} * or its {@link SecurityManager#checkWrite(String) checkWrite} * method denies write access to the file. */ diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java index f18caaf86a3..9acde225339 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java @@ -69,7 +69,7 @@ public interface FileOwnerAttributeView * @throws SecurityException * In the case of the default provider, a security manager is * installed, and it denies {@link - * RuntimePermission}("accessUserInformation") or its + * RuntimePermission}{@code ("accessUserInformation")} or its * {@link SecurityManager#checkRead(String) checkRead} method * denies read access to the file. */ @@ -93,7 +93,7 @@ public interface FileOwnerAttributeView * @throws SecurityException * In the case of the default provider, a security manager is * installed, and it denies {@link - * RuntimePermission}("accessUserInformation") or its + * RuntimePermission}{@code ("accessUserInformation")} or its * {@link SecurityManager#checkWrite(String) checkWrite} method * denies write access to the file. */ diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java index 25466f2dbce..f8c36523d66 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java @@ -149,7 +149,8 @@ public interface PosixFileAttributeView * @throws IOException {@inheritDoc} * @throws SecurityException * In the case of the default provider, a security manager is - * installed, and it denies {@link RuntimePermission}("accessUserInformation") + * installed, and it denies + * {@link RuntimePermission}{@code ("accessUserInformation")} * or its {@link SecurityManager#checkRead(String) checkRead} method * denies read access to the file. */ @@ -169,7 +170,8 @@ public interface PosixFileAttributeView * if an I/O error occurs * @throws SecurityException * In the case of the default provider, a security manager is - * installed, and it denies {@link RuntimePermission}("accessUserInformation") + * installed, and it denies + * {@link RuntimePermission}{@code ("accessUserInformation")} * or its {@link SecurityManager#checkWrite(String) checkWrite} * method denies write access to the file. */ @@ -185,7 +187,8 @@ public interface PosixFileAttributeView * if an I/O error occurs * @throws SecurityException * In the case of the default provider, and a security manager is - * installed, it denies {@link RuntimePermission}("accessUserInformation") + * installed, it denies + * {@link RuntimePermission}{@code ("accessUserInformation")} * or its {@link SecurityManager#checkWrite(String) checkWrite} * method denies write access to the file. */ diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java index 56e7135ed43..ffd89b9e7b2 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java @@ -89,7 +89,7 @@ public interface UserDefinedFileAttributeView * @throws SecurityException * In the case of the default provider, a security manager is * installed, and it denies {@link - * RuntimePermission}("accessUserDefinedAttributes") + * RuntimePermission}{@code ("accessUserDefinedAttributes")} * or its {@link SecurityManager#checkRead(String) checkRead} method * denies read access to the file. */ @@ -110,7 +110,7 @@ public interface UserDefinedFileAttributeView * @throws SecurityException * In the case of the default provider, a security manager is * installed, and it denies {@link - * RuntimePermission}("accessUserDefinedAttributes") + * RuntimePermission}{@code ("accessUserDefinedAttributes")} * or its {@link SecurityManager#checkRead(String) checkRead} method * denies read access to the file. */ @@ -156,7 +156,7 @@ public interface UserDefinedFileAttributeView * @throws SecurityException * In the case of the default provider, a security manager is * installed, and it denies {@link - * RuntimePermission}("accessUserDefinedAttributes") + * RuntimePermission}{@code ("accessUserDefinedAttributes")} * or its {@link SecurityManager#checkRead(String) checkRead} method * denies read access to the file. * @@ -206,7 +206,7 @@ public interface UserDefinedFileAttributeView * @throws SecurityException * In the case of the default provider, a security manager is * installed, and it denies {@link - * RuntimePermission}("accessUserDefinedAttributes") + * RuntimePermission}{@code ("accessUserDefinedAttributes")} * or its {@link SecurityManager#checkWrite(String) checkWrite} * method denies write access to the file. */ @@ -223,7 +223,7 @@ public interface UserDefinedFileAttributeView * @throws SecurityException * In the case of the default provider, a security manager is * installed, and it denies {@link - * RuntimePermission}("accessUserDefinedAttributes") + * RuntimePermission}{@code ("accessUserDefinedAttributes")} * or its {@link SecurityManager#checkWrite(String) checkWrite} * method denies write access to the file. */ diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java index c3f3befa96d..64e26604bd8 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java @@ -72,7 +72,8 @@ public abstract class UserPrincipalLookupService { * if an I/O error occurs * @throws SecurityException * In the case of the default provider, and a security manager is - * installed, it checks {@link RuntimePermission}("lookupUserInformation") + * installed, it checks + * {@link RuntimePermission}{@code ("lookupUserInformation")} */ public abstract UserPrincipal lookupPrincipalByName(String name) throws IOException; @@ -97,7 +98,8 @@ public abstract class UserPrincipalLookupService { * if an I/O error occurs * @throws SecurityException * In the case of the default provider, and a security manager is - * installed, it checks {@link RuntimePermission}("lookupUserInformation") + * installed, it checks + * {@link RuntimePermission}{@code ("lookupUserInformation")} */ public abstract GroupPrincipal lookupPrincipalByGroupName(String group) throws IOException; diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalNotFoundException.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalNotFoundException.java index 5cf0ab0a5f3..563b339d3f2 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalNotFoundException.java +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/UserPrincipalNotFoundException.java @@ -54,7 +54,7 @@ public class UserPrincipalNotFoundException /** * Returns the user principal name if this exception was created with the - * user principal name that was not found, otherwise null. + * user principal name that was not found, otherwise {@code null}. * * @return the user principal name or {@code null} */ diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java index be46551c60d..1dd20f627c7 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java @@ -28,23 +28,23 @@ * *
        * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * *
        Attribute viewsDescription
        {@link java.nio.file.attribute.AttributeView}
        {@link java.nio.file.attribute.AttributeView}Can read or update non-opaque values associated with objects in a file system
          {@link java.nio.file.attribute.FileAttributeView}
          {@link java.nio.file.attribute.FileAttributeView}Can read or update file attributes
            {@link java.nio.file.attribute.BasicFileAttributeView}  
            {@link java.nio.file.attribute.BasicFileAttributeView}  Can read or update a basic set of file attributes
              {@link java.nio.file.attribute.PosixFileAttributeView}  
              {@link java.nio.file.attribute.PosixFileAttributeView}  Can read or update POSIX defined file attributes
              {@link java.nio.file.attribute.DosFileAttributeView}  
              {@link java.nio.file.attribute.DosFileAttributeView}  Can read or update FAT file attributes
            {@link java.nio.file.attribute.FileOwnerAttributeView}  
            {@link java.nio.file.attribute.FileOwnerAttributeView}  Can read or update the owner of a file
             {@link java.nio.file.attribute.AclFileAttributeView}  
             {@link java.nio.file.attribute.AclFileAttributeView}  Can read or update Access Control Lists
            {@link java.nio.file.attribute.UserDefinedFileAttributeView}  
            {@link java.nio.file.attribute.UserDefinedFileAttributeView}  Can read or update user-defined file attributes
          {@link java.nio.file.attribute.FileStoreAttributeView}
          {@link java.nio.file.attribute.FileStoreAttributeView}Can read or update file system attributes
        * @@ -100,7 +100,7 @@ * * * - *

        Unless otherwise noted, passing a null argument to a constructor + *

        Unless otherwise noted, passing a {@code null} argument to a constructor * or method in any class or interface in this package will cause a {@link * java.lang.NullPointerException NullPointerException} to be thrown. * diff --git a/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java b/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java index dad51083401..b92cf525eef 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java +++ b/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java @@ -102,7 +102,7 @@ public abstract class FileSystemProvider { * * @throws SecurityException * If a security manager has been installed and it denies - * {@link RuntimePermission}("fileSystemProvider") + * {@link RuntimePermission}{@code ("fileSystemProvider")} */ protected FileSystemProvider() { this(checkPermission()); @@ -644,7 +644,7 @@ public abstract class FileSystemProvider { * if an I/O error occurs * @throws SecurityException * In the case of the default provider, and a security manager - * is installed, it denies {@link LinkPermission}("symbolic") + * is installed, it denies {@link LinkPermission}{@code ("symbolic")} * or its {@link SecurityManager#checkWrite(String) checkWrite} * method denies write access to the path of the symbolic link. */ @@ -677,7 +677,7 @@ public abstract class FileSystemProvider { * if an I/O error occurs * @throws SecurityException * In the case of the default provider, and a security manager - * is installed, it denies {@link LinkPermission}("hard") + * is installed, it denies {@link LinkPermission}{@code ("hard")} * or its {@link SecurityManager#checkWrite(String) checkWrite} * method denies write access to either the link or the * existing file. @@ -902,8 +902,8 @@ public abstract class FileSystemProvider { * In the case of the default provider, and a security manager is * installed, the {@link SecurityManager#checkRead(String) checkRead} * method is invoked to check read access to the file, and in - * addition it checks {@link RuntimePermission} - * ("getFileStoreAttributes") + * addition it checks + * {@link RuntimePermission}{@code ("getFileStoreAttributes")} */ public abstract FileStore getFileStore(Path path) throws IOException; diff --git a/jdk/src/java.base/share/classes/java/nio/file/spi/FileTypeDetector.java b/jdk/src/java.base/share/classes/java/nio/file/spi/FileTypeDetector.java index ee118d63129..1e06a119331 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/spi/FileTypeDetector.java +++ b/jdk/src/java.base/share/classes/java/nio/file/spi/FileTypeDetector.java @@ -62,7 +62,7 @@ public abstract class FileTypeDetector { * * @throws SecurityException * If a security manager has been installed and it denies - * {@link RuntimePermission}("fileTypeDetector") + * {@link RuntimePermission}{@code ("fileTypeDetector")} */ protected FileTypeDetector() { this(checkPermission()); diff --git a/jdk/src/java.base/share/classes/java/nio/file/spi/package-info.java b/jdk/src/java.base/share/classes/java/nio/file/spi/package-info.java index b86affe5ef4..d263ef72ecb 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/spi/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/file/spi/package-info.java @@ -24,12 +24,12 @@ */ /** - * Service-provider classes for the {@link java.nio.file} package. + * Service-provider classes for the {@link java.nio.file} package. * *

        Only developers who are defining new file system providers or file type * detectors should need to make direct use of this package.

        * - *

        Unless otherwise noted, passing a null argument to a constructor + *

        Unless otherwise noted, passing a {@code null} argument to a constructor * or method in any class or interface in this package will cause a {@link * java.lang.NullPointerException NullPointerException} to be thrown. * diff --git a/jdk/src/java.base/share/classes/java/nio/package-info.java b/jdk/src/java.base/share/classes/java/nio/package-info.java index 374e0bb59a9..b36faeac3c6 100644 --- a/jdk/src/java.base/share/classes/java/nio/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/package-info.java @@ -52,7 +52,7 @@ * * * - *

        The java.nio package defines the buffer classes, which + *

        The {@code java.nio} package defines the buffer classes, which * are used throughout the NIO APIs. The charset API is defined in * the {@link java.nio.charset} package, and the channel and selector * APIs are defined in the {@link java.nio.channels} package. Each of @@ -64,26 +64,26 @@ * *

        * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * *
        BuffersDescription
        {@link java.nio.Buffer}
        {@link java.nio.Buffer}Position, limit, and capacity; *
        clear, flip, rewind, and mark/reset
          {@link java.nio.ByteBuffer}
          {@link java.nio.ByteBuffer}Get/put, compact, views; allocate, wrap
            {@link java.nio.MappedByteBuffer}  
            {@link java.nio.MappedByteBuffer}  A byte buffer mapped to a file
          {@link java.nio.CharBuffer}
          {@link java.nio.CharBuffer}Get/put, compact; allocate, wrap
          {@link java.nio.DoubleBuffer}
          {@link java.nio.DoubleBuffer}    ' '
          {@link java.nio.FloatBuffer}
          {@link java.nio.FloatBuffer}    ' '
          {@link java.nio.IntBuffer}
          {@link java.nio.IntBuffer}    ' '
          {@link java.nio.LongBuffer}
          {@link java.nio.LongBuffer}    ' '
          {@link java.nio.ShortBuffer}
          {@link java.nio.ShortBuffer}    ' '
        {@link java.nio.ByteOrder}
        {@link java.nio.ByteOrder}Typesafe enumeration for byte orders
        * @@ -129,7 +129,7 @@ * * * - *

        Unless otherwise noted, passing a null argument to a + *

        Unless otherwise noted, passing a {@code null} argument to a * constructor or method in any class or interface in this package * will cause a {@link java.lang.NullPointerException * NullPointerException} to be thrown. diff --git a/jdk/src/java.base/share/classes/sun/nio/ByteBuffered.java b/jdk/src/java.base/share/classes/sun/nio/ByteBuffered.java index a09621bbff4..6a016419ee4 100644 --- a/jdk/src/java.base/share/classes/sun/nio/ByteBuffered.java +++ b/jdk/src/java.base/share/classes/sun/nio/ByteBuffered.java @@ -29,11 +29,11 @@ import java.nio.ByteBuffer; import java.io.IOException; /** This is an interface to adapt existing APIs to use {@link java.nio.ByteBuffer - * ByteBuffers} as the underlying + * ByteBuffers} as the underlying * data format. Only the initial producer and final consumer have to be changed.

        * - * For example, the Zip/Jar code supports {@link java.io.InputStream InputStreams}. - * To make the Zip code use {@link java.nio.MappedByteBuffer MappedByteBuffers} as + * For example, the Zip/Jar code supports {@link java.io.InputStream InputStreams}. + * To make the Zip code use {@link java.nio.MappedByteBuffer MappedByteBuffers} as * the underlying data structure, it can create a class of InputStream that wraps the ByteBuffer, * and implements the ByteBuffered interface. A co-operating class several layers * away can ask the InputStream if it is an instance of ByteBuffered, then @@ -42,12 +42,12 @@ import java.io.IOException; public interface ByteBuffered { /** - * Returns the ByteBuffer behind this object, if this particular - * instance has one. An implementation of getByteBuffer() is allowed - * to return null for any reason. + * Returns the {@code ByteBuffer} behind this object, if this particular + * instance has one. An implementation of {@code getByteBuffer()} is allowed + * to return {@code null} for any reason. * - * @return The ByteBuffer, if this particular instance has one, - * or null otherwise. + * @return The {@code ByteBuffer}, if this particular instance has one, + * or {@code null} otherwise. * * @throws IOException * If the ByteBuffer is no longer valid. diff --git a/jdk/src/java.base/share/classes/sun/nio/ch/AllocatedNativeObject.java b/jdk/src/java.base/share/classes/sun/nio/ch/AllocatedNativeObject.java index 2406cb8f1e4..6709ce115cf 100644 --- a/jdk/src/java.base/share/classes/sun/nio/ch/AllocatedNativeObject.java +++ b/jdk/src/java.base/share/classes/sun/nio/ch/AllocatedNativeObject.java @@ -36,14 +36,14 @@ class AllocatedNativeObject // package-private { /** - * Allocates a memory area of at least size bytes outside of the + * Allocates a memory area of at least {@code size} bytes outside of the * Java heap and creates a native object for that area. * * @param size * Number of bytes to allocate * * @param pageAligned - * If true then the area will be aligned on a hardware + * If {@code true} then the area will be aligned on a hardware * page boundary * * @throws OutOfMemoryError diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java index 445b75530cb..065b13036e5 100644 --- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java +++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java @@ -538,11 +538,11 @@ public abstract class SctpChannel * {@link java.io.IOException} to be thrown. * *

        If this channel is already connected then this method will not block - * and will immediately return true. If this channel is in - * non-blocking mode then this method will return false if the + * and will immediately return {@code true}. If this channel is in + * non-blocking mode then this method will return {@code false} if the * connection process is not yet complete. If this channel is in blocking * mode then this method will block until the connection either completes - * or fails, and will always either return true or throw a checked + * or fails, and will always either return {@code true} or throw a checked * exception describing the failure. * *

        This method may be invoked at any time. If a {@link #send send} or {@link #receive receive} @@ -711,9 +711,9 @@ public abstract class SctpChannel * Returns an operation set identifying this channel's supported operations. * *

        SCTP channels support connecting, reading, and writing, so this - * method returns ({@link SelectionKey#OP_CONNECT} - * | {@link SelectionKey#OP_READ} | {@link - * SelectionKey#OP_WRITE}).

        + * method returns {@code (}{@link SelectionKey#OP_CONNECT} + * {@code |} {@link SelectionKey#OP_READ} {@code |} {@link + * SelectionKey#OP_WRITE}{@code )}. * * @return The valid-operation set */