From 032af13e8bb5e3567b5f176cf76316caf8b6f2d7 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 23 Jan 2012 12:17:30 -0800 Subject: [PATCH] 7132338: Use @code friendly idiom for '\' in javadoc Reviewed-by: alanb --- jdk/src/share/classes/java/io/DataInput.java | 291 +++++----- .../java/io/LineNumberInputStream.java | 70 +-- .../classes/java/io/RandomAccessFile.java | 238 ++++----- .../classes/java/io/StreamTokenizer.java | 126 ++--- .../java/lang/AbstractStringBuilder.java | 242 ++++----- jdk/src/share/classes/java/lang/Byte.java | 12 +- jdk/src/share/classes/java/lang/Double.java | 12 +- jdk/src/share/classes/java/lang/Float.java | 12 +- jdk/src/share/classes/java/lang/Integer.java | 50 +- jdk/src/share/classes/java/lang/Long.java | 62 +-- jdk/src/share/classes/java/lang/Short.java | 12 +- jdk/src/share/classes/java/lang/String.java | 500 +++++++++--------- .../share/classes/java/util/Properties.java | 178 +++---- 13 files changed, 902 insertions(+), 903 deletions(-) diff --git a/jdk/src/share/classes/java/io/DataInput.java b/jdk/src/share/classes/java/io/DataInput.java index e4b7e83ff5a..1480c9f0485 100644 --- a/jdk/src/share/classes/java/io/DataInput.java +++ b/jdk/src/share/classes/java/io/DataInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,12 +26,12 @@ package java.io; /** - * The DataInput interface provides + * The {@code DataInput} interface provides * for reading bytes from a binary stream and * reconstructing from them data in any of * the Java primitive types. There is also * a - * facility for reconstructing a String + * facility for reconstructing a {@code String} * from data in * modified UTF-8 * format. @@ -39,12 +39,12 @@ package java.io; * It is generally true of all the reading * routines in this interface that if end of * file is reached before the desired number - * of bytes has been read, an EOFException - * (which is a kind of IOException) + * of bytes has been read, an {@code EOFException} + * (which is a kind of {@code IOException}) * is thrown. If any byte cannot be read for - * any reason other than end of file, an IOException - * other than EOFException is - * thrown. In particular, an IOException + * any reason other than end of file, an {@code IOException} + * other than {@code EOFException} is + * thrown. In particular, an {@code IOException} * may be thrown if the input stream has been * closed. * @@ -58,8 +58,8 @@ package java.io; * Note that in the following tables, the most significant bit appears in the * far left-hand column. *

- * All characters in the range '\u0001' to - * '\u007F' are represented by a single byte: + * All characters in the range {@code '\u005Cu0001'} to + * {@code '\u005Cu007F'} are represented by a single byte: * *

* * *

- * The null character '\u0000' and characters in the - * range '\u0080' to '\u07FF' are + * The null character {@code '\u005Cu0000'} and characters in the + * range {@code '\u005Cu0080'} to {@code '\u005Cu07FF'} are * represented by a pair of bytes: * *

@@ -123,8 +123,8 @@ package java.io; *
* *
- * char values in the range '\u0800' to - * '\uFFFF' are represented by three bytes: + * {@code char} values in the range {@code '\u005Cu0800'} to + * {@code '\u005CuFFFF'} are represented by three bytes: * *
*
- *
  • The null byte '\u0000' is encoded in 2-byte format + *
  • The null byte {@code '\u005Cu0000'} is encoded in 2-byte format * rather than 1-byte, so that the encoded strings never have * embedded nulls. *
  • Only the 1-byte, 2-byte, and 3-byte formats are used. @@ -195,36 +195,36 @@ interface DataInput { /** * Reads some bytes from an input * stream and stores them into the buffer - * array b. The number of bytes + * array {@code b}. The number of bytes * read is equal - * to the length of b. + * to the length of {@code b}. *

    * This method blocks until one of the * following conditions occurs:

    *

      - *
    • b.length + *
    • {@code b.length} * bytes of input data are available, in which * case a normal return is made. * *
    • End of - * file is detected, in which case an EOFException + * file is detected, in which case an {@code EOFException} * is thrown. * *
    • An I/O error occurs, in - * which case an IOException other - * than EOFException is thrown. + * which case an {@code IOException} other + * than {@code EOFException} is thrown. *
    *

    - * If b is null, - * a NullPointerException is thrown. - * If b.length is zero, then + * If {@code b} is {@code null}, + * a {@code NullPointerException} is thrown. + * If {@code b.length} is zero, then * no bytes are read. Otherwise, the first - * byte read is stored into element b[0], - * the next one into b[1], and + * byte read is stored into element {@code b[0]}, + * the next one into {@code b[1]}, and * so on. * If an exception is thrown from * this method, then it may be that some but - * not all bytes of b have been + * not all bytes of {@code b} have been * updated with data from the input stream. * * @param b the buffer into which the data is read. @@ -236,7 +236,7 @@ interface DataInput { /** * - * Reads len + * Reads {@code len} * bytes from * an input stream. *

    @@ -244,32 +244,32 @@ interface DataInput { * blocks until one of the following conditions * occurs:

    *

      - *
    • len bytes + *
    • {@code len} bytes * of input data are available, in which case * a normal return is made. * *
    • End of file - * is detected, in which case an EOFException + * is detected, in which case an {@code EOFException} * is thrown. * *
    • An I/O error occurs, in - * which case an IOException other - * than EOFException is thrown. + * which case an {@code IOException} other + * than {@code EOFException} is thrown. *
    *

    - * If b is null, - * a NullPointerException is thrown. - * If off is negative, or len - * is negative, or off+len is - * greater than the length of the array b, - * then an IndexOutOfBoundsException + * If {@code b} is {@code null}, + * a {@code NullPointerException} is thrown. + * If {@code off} is negative, or {@code len} + * is negative, or {@code off+len} is + * greater than the length of the array {@code b}, + * then an {@code IndexOutOfBoundsException} * is thrown. - * If len is zero, + * If {@code len} is zero, * then no bytes are read. Otherwise, the first - * byte read is stored into element b[off], - * the next one into b[off+1], + * byte read is stored into element {@code b[off]}, + * the next one into {@code b[off+1]}, * and so on. The number of bytes read is, - * at most, equal to len. + * at most, equal to {@code len}. * * @param b the buffer into which the data is read. * @param off an int specifying the offset into the data. @@ -282,7 +282,7 @@ interface DataInput { /** * Makes an attempt to skip over - * n bytes + * {@code n} bytes * of data from the input * stream, discarding the skipped bytes. However, * it may skip @@ -290,10 +290,10 @@ interface DataInput { * bytes, possibly zero. This may result from * any of a * number of conditions; reaching - * end of file before n bytes + * end of file before {@code n} bytes * have been skipped is * only one possibility. - * This method never throws an EOFException. + * This method never throws an {@code EOFException}. * The actual * number of bytes skipped is returned. * @@ -305,13 +305,13 @@ interface DataInput { /** * Reads one input byte and returns - * true if that byte is nonzero, - * false if that byte is zero. + * {@code true} if that byte is nonzero, + * {@code false} if that byte is zero. * This method is suitable for reading - * the byte written by the writeBoolean - * method of interface DataOutput. + * the byte written by the {@code writeBoolean} + * method of interface {@code DataOutput}. * - * @return the boolean value read. + * @return the {@code boolean} value read. * @exception EOFException if this stream reaches the end before reading * all the bytes. * @exception IOException if an I/O error occurs. @@ -321,11 +321,11 @@ interface DataInput { /** * Reads and returns one input byte. * The byte is treated as a signed value in - * the range -128 through 127, + * the range {@code -128} through {@code 127}, * inclusive. * This method is suitable for - * reading the byte written by the writeByte - * method of interface DataOutput. + * reading the byte written by the {@code writeByte} + * method of interface {@code DataOutput}. * * @return the 8-bit value read. * @exception EOFException if this stream reaches the end before reading @@ -336,16 +336,16 @@ interface DataInput { /** * Reads one input byte, zero-extends - * it to type int, and returns + * it to type {@code int}, and returns * the result, which is therefore in the range - * 0 - * through 255. + * {@code 0} + * through {@code 255}. * This method is suitable for reading - * the byte written by the writeByte - * method of interface DataOutput - * if the argument to writeByte + * the byte written by the {@code writeByte} + * method of interface {@code DataOutput} + * if the argument to {@code writeByte} * was intended to be a value in the range - * 0 through 255. + * {@code 0} through {@code 255}. * * @return the unsigned 8-bit value read. * @exception EOFException if this stream reaches the end before reading @@ -356,8 +356,8 @@ interface DataInput { /** * Reads two input bytes and returns - * a short value. Let a - * be the first byte read and b + * a {@code short} value. Let {@code a} + * be the first byte read and {@code b} * be the second byte. The value * returned * is: @@ -365,8 +365,8 @@ interface DataInput { * * This method * is suitable for reading the bytes written - * by the writeShort method of - * interface DataOutput. + * by the {@code writeShort} method of + * interface {@code DataOutput}. * * @return the 16-bit value read. * @exception EOFException if this stream reaches the end before reading @@ -377,19 +377,19 @@ interface DataInput { /** * Reads two input bytes and returns - * an int value in the range 0 - * through 65535. Let a + * an {@code int} value in the range {@code 0} + * through {@code 65535}. Let {@code a} * be the first byte read and - * b + * {@code b} * be the second byte. The value returned is: *

    (((a & 0xff) << 8) | (b & 0xff))
          * 
    * This method is suitable for reading the bytes - * written by the writeShort method - * of interface DataOutput if - * the argument to writeShort + * written by the {@code writeShort} method + * of interface {@code DataOutput} if + * the argument to {@code writeShort} * was intended to be a value in the range - * 0 through 65535. + * {@code 0} through {@code 65535}. * * @return the unsigned 16-bit value read. * @exception EOFException if this stream reaches the end before reading @@ -399,19 +399,19 @@ interface DataInput { int readUnsignedShort() throws IOException; /** - * Reads two input bytes and returns a char value. - * Let a - * be the first byte read and b + * Reads two input bytes and returns a {@code char} value. + * Let {@code a} + * be the first byte read and {@code b} * be the second byte. The value * returned is: *

    (char)((a << 8) | (b & 0xff))
          * 
    * This method * is suitable for reading bytes written by - * the writeChar method of interface - * DataOutput. + * the {@code writeChar} method of interface + * {@code DataOutput}. * - * @return the char value read. + * @return the {@code char} value read. * @exception EOFException if this stream reaches the end before reading * all the bytes. * @exception IOException if an I/O error occurs. @@ -420,18 +420,17 @@ interface DataInput { /** * Reads four input bytes and returns an - * int value. Let a-d + * {@code int} value. Let {@code a-d} * be the first through fourth bytes read. The value returned is: - *

    -     * 
    +     * 

    
          * (((a & 0xff) << 24) | ((b & 0xff) << 16) |
          *  ((c & 0xff) << 8) | (d & 0xff))
          * 
    * This method is suitable - * for reading bytes written by the writeInt - * method of interface DataOutput. + * for reading bytes written by the {@code writeInt} + * method of interface {@code DataOutput}. * - * @return the int value read. + * @return the {@code int} value read. * @exception EOFException if this stream reaches the end before reading * all the bytes. * @exception IOException if an I/O error occurs. @@ -440,10 +439,10 @@ interface DataInput { /** * Reads eight input bytes and returns - * a long value. Let a-h + * a {@code long} value. Let {@code a-h} * be the first through eighth bytes read. * The value returned is: - *

     
    +     * 

    
          * (((long)(a & 0xff) << 56) |
          *  ((long)(b & 0xff) << 48) |
          *  ((long)(c & 0xff) << 40) |
    @@ -455,10 +454,10 @@ interface DataInput {
          * 
    *

    * This method is suitable - * for reading bytes written by the writeLong - * method of interface DataOutput. + * for reading bytes written by the {@code writeLong} + * method of interface {@code DataOutput}. * - * @return the long value read. + * @return the {@code long} value read. * @exception EOFException if this stream reaches the end before reading * all the bytes. * @exception IOException if an I/O error occurs. @@ -467,18 +466,18 @@ interface DataInput { /** * Reads four input bytes and returns - * a float value. It does this - * by first constructing an int + * a {@code float} value. It does this + * by first constructing an {@code int} * value in exactly the manner - * of the readInt - * method, then converting this int - * value to a float in - * exactly the manner of the method Float.intBitsToFloat. + * of the {@code readInt} + * method, then converting this {@code int} + * value to a {@code float} in + * exactly the manner of the method {@code Float.intBitsToFloat}. * This method is suitable for reading - * bytes written by the writeFloat - * method of interface DataOutput. + * bytes written by the {@code writeFloat} + * method of interface {@code DataOutput}. * - * @return the float value read. + * @return the {@code float} value read. * @exception EOFException if this stream reaches the end before reading * all the bytes. * @exception IOException if an I/O error occurs. @@ -487,18 +486,18 @@ interface DataInput { /** * Reads eight input bytes and returns - * a double value. It does this - * by first constructing a long + * a {@code double} value. It does this + * by first constructing a {@code long} * value in exactly the manner - * of the readlong - * method, then converting this long - * value to a double in exactly - * the manner of the method Double.longBitsToDouble. + * of the {@code readlong} + * method, then converting this {@code long} + * value to a {@code double} in exactly + * the manner of the method {@code Double.longBitsToDouble}. * This method is suitable for reading - * bytes written by the writeDouble - * method of interface DataOutput. + * bytes written by the {@code writeDouble} + * method of interface {@code DataOutput}. * - * @return the double value read. + * @return the {@code double} value read. * @exception EOFException if this stream reaches the end before reading * all the bytes. * @exception IOException if an I/O error occurs. @@ -512,35 +511,35 @@ interface DataInput { * until it encounters a line terminator or * end of * file; the characters read are then - * returned as a String. Note + * returned as a {@code String}. Note * that because this * method processes bytes, * it does not support input of the full Unicode * character set. *

    * If end of file is encountered - * before even one byte can be read, then null + * before even one byte can be read, then {@code null} * is returned. Otherwise, each byte that is - * read is converted to type char - * by zero-extension. If the character '\n' + * read is converted to type {@code char} + * by zero-extension. If the character {@code '\n'} * is encountered, it is discarded and reading - * ceases. If the character '\r' + * ceases. If the character {@code '\r'} * is encountered, it is discarded and, if * the following byte converts to the - * character '\n', then that is + * character {@code '\n'}, then that is * discarded also; reading then ceases. If * end of file is encountered before either - * of the characters '\n' and - * '\r' is encountered, reading - * ceases. Once reading has ceased, a String + * of the characters {@code '\n'} and + * {@code '\r'} is encountered, reading + * ceases. Once reading has ceased, a {@code String} * is returned that contains all the characters * read and not discarded, taken in order. * Note that every character in this string - * will have a value less than \u0100, - * that is, (char)256. + * will have a value less than {@code \u005Cu0100}, + * that is, {@code (char)256}. * * @return the next line of text from the input stream, - * or null if the end of file is + * or {@code null} if the end of file is * encountered before a byte can be read. * @exception IOException if an I/O error occurs. */ @@ -550,15 +549,15 @@ interface DataInput { * Reads in a string that has been encoded using a * modified UTF-8 * format. - * The general contract of readUTF + * The general contract of {@code readUTF} * is that it reads a representation of a Unicode * character string encoded in modified * UTF-8 format; this string of characters - * is then returned as a String. + * is then returned as a {@code String}. *

    * First, two bytes are read and used to * construct an unsigned 16-bit integer in - * exactly the manner of the readUnsignedShort + * exactly the manner of the {@code readUnsignedShort} * method . This integer value is called the * UTF length and specifies the number * of additional bytes to be read. These bytes @@ -570,58 +569,58 @@ interface DataInput { * next group. *

    * If the first byte of a group - * matches the bit pattern 0xxxxxxx - * (where x means "may be 0 - * or 1"), then the group consists + * matches the bit pattern {@code 0xxxxxxx} + * (where {@code x} means "may be {@code 0} + * or {@code 1}"), then the group consists * of just that byte. The byte is zero-extended * to form a character. *

    * If the first byte - * of a group matches the bit pattern 110xxxxx, - * then the group consists of that byte a - * and a second byte b. If there - * is no byte b (because byte - * a was the last of the bytes - * to be read), or if byte b does - * not match the bit pattern 10xxxxxx, - * then a UTFDataFormatException + * of a group matches the bit pattern {@code 110xxxxx}, + * then the group consists of that byte {@code a} + * and a second byte {@code b}. If there + * is no byte {@code b} (because byte + * {@code a} was the last of the bytes + * to be read), or if byte {@code b} does + * not match the bit pattern {@code 10xxxxxx}, + * then a {@code UTFDataFormatException} * is thrown. Otherwise, the group is converted * to the character:

    *

    (char)(((a& 0x1F) << 6) | (b & 0x3F))
          * 
    * If the first byte of a group - * matches the bit pattern 1110xxxx, - * then the group consists of that byte a - * and two more bytes b and c. - * If there is no byte c (because - * byte a was one of the last + * matches the bit pattern {@code 1110xxxx}, + * then the group consists of that byte {@code a} + * and two more bytes {@code b} and {@code c}. + * If there is no byte {@code c} (because + * byte {@code a} was one of the last * two of the bytes to be read), or either - * byte b or byte c - * does not match the bit pattern 10xxxxxx, - * then a UTFDataFormatException + * byte {@code b} or byte {@code c} + * does not match the bit pattern {@code 10xxxxxx}, + * then a {@code UTFDataFormatException} * is thrown. Otherwise, the group is converted * to the character:

    *

    
          * (char)(((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F))
          * 
    * If the first byte of a group matches the - * pattern 1111xxxx or the pattern - * 10xxxxxx, then a UTFDataFormatException + * pattern {@code 1111xxxx} or the pattern + * {@code 10xxxxxx}, then a {@code UTFDataFormatException} * is thrown. *

    * If end of file is encountered * at any time during this entire process, - * then an EOFException is thrown. + * then an {@code EOFException} is thrown. *

    * After every group has been converted to * a character by this process, the characters * are gathered, in the same order in which * their corresponding groups were read from - * the input stream, to form a String, + * the input stream, to form a {@code String}, * which is returned. *

    - * The writeUTF - * method of interface DataOutput + * The {@code writeUTF} + * method of interface {@code DataOutput} * may be used to write data that is suitable * for reading by this method. * @return a Unicode string. diff --git a/jdk/src/share/classes/java/io/LineNumberInputStream.java b/jdk/src/share/classes/java/io/LineNumberInputStream.java index 11cfdf8b8b9..1f37a98e928 100644 --- a/jdk/src/share/classes/java/io/LineNumberInputStream.java +++ b/jdk/src/share/classes/java/io/LineNumberInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,13 +30,13 @@ package java.io; * functionality of keeping track of the current line number. *

    * A line is a sequence of bytes ending with a carriage return - * character ('\r'), a newline character - * ('\n'), or a carriage return character followed + * character ({@code '\u005Cr'}), a newline character + * ({@code '\u005Cn'}), or a carriage return character followed * immediately by a linefeed character. In all three cases, the line * terminating character(s) are returned as a single newline character. *

    - * The line number begins at 0, and is incremented by - * 1 when a read returns a newline character. + * The line number begins at {@code 0}, and is incremented by + * {@code 1} when a {@code read} returns a newline character. * * @author Arthur van Hoff * @see java.io.LineNumberReader @@ -66,22 +66,22 @@ class LineNumberInputStream extends FilterInputStream { /** * Reads the next byte of data from this input stream. The value - * byte is returned as an int in the range - * 0 to 255. If no byte is available + * byte is returned as an {@code int} in the range + * {@code 0} to {@code 255}. If no byte is available * because the end of the stream has been reached, the value - * -1 is returned. This method blocks until input data + * {@code -1} is returned. This method blocks until input data * is available, the end of the stream is detected, or an exception * is thrown. *

    - * The read method of - * LineNumberInputStream calls the read + * The {@code read} method of + * {@code LineNumberInputStream} calls the {@code read} * method of the underlying input stream. It checks for carriage * returns and newline characters in the input, and modifies the * current line number as appropriate. A carriage-return character or * a carriage return followed by a newline character are both * converted into a single newline character. * - * @return the next byte of data, or -1 if the end of this + * @return the next byte of data, or {@code -1} if the end of this * stream is reached. * @exception IOException if an I/O error occurs. * @see java.io.FilterInputStream#in @@ -111,18 +111,18 @@ class LineNumberInputStream extends FilterInputStream { } /** - * Reads up to len bytes of data from this input stream + * Reads up to {@code len} bytes of data from this input stream * into an array of bytes. This method blocks until some input is available. *

    - * The read method of - * LineNumberInputStream repeatedly calls the - * read method of zero arguments to fill in the byte array. + * The {@code read} method of + * {@code LineNumberInputStream} repeatedly calls the + * {@code read} method of zero arguments to fill in the byte array. * * @param b the buffer into which the data is read. * @param off the start offset of the data. * @param len the maximum number of bytes read. * @return the total number of bytes read into the buffer, or - * -1 if there is no more data because the end of + * {@code -1} if there is no more data because the end of * this stream has been reached. * @exception IOException if an I/O error occurs. * @see java.io.LineNumberInputStream#read() @@ -160,15 +160,15 @@ class LineNumberInputStream extends FilterInputStream { } /** - * Skips over and discards n bytes of data from this - * input stream. The skip method may, for a variety of + * Skips over and discards {@code n} bytes of data from this + * input stream. The {@code skip} method may, for a variety of * reasons, end up skipping over some smaller number of bytes, - * possibly 0. The actual number of bytes skipped is - * returned. If n is negative, no bytes are skipped. + * possibly {@code 0}. The actual number of bytes skipped is + * returned. If {@code n} is negative, no bytes are skipped. *

    - * The skip method of LineNumberInputStream creates + * The {@code skip} method of {@code LineNumberInputStream} creates * a byte array and then repeatedly reads into it until - * n bytes have been read or the end of the stream has + * {@code n} bytes have been read or the end of the stream has * been reached. * * @param n the number of bytes to be skipped. @@ -225,12 +225,12 @@ class LineNumberInputStream extends FilterInputStream { *

    * Note that if the underlying input stream is able to supply * k input characters without blocking, the - * LineNumberInputStream can guarantee only to provide + * {@code LineNumberInputStream} can guarantee only to provide * k/2 characters without blocking, because the * k characters from the underlying input stream might - * consist of k/2 pairs of '\r' and - * '\n', which are converted to just - * k/2 '\n' characters. + * consist of k/2 pairs of {@code '\u005Cr'} and + * {@code '\u005Cn'}, which are converted to just + * k/2 {@code '\u005Cn'} characters. * * @return the number of bytes that can be read from this input stream * without blocking. @@ -243,12 +243,12 @@ class LineNumberInputStream extends FilterInputStream { /** * Marks the current position in this input stream. A subsequent - * call to the reset method repositions this stream at + * call to the {@code reset} method repositions this stream at * the last marked position so that subsequent reads re-read the same bytes. *

    - * The mark method of - * LineNumberInputStream remembers the current line - * number in a private variable, and then calls the mark + * The {@code mark} method of + * {@code LineNumberInputStream} remembers the current line + * number in a private variable, and then calls the {@code mark} * method of the underlying input stream. * * @param readlimit the maximum limit of bytes that can be read before @@ -264,12 +264,12 @@ class LineNumberInputStream extends FilterInputStream { /** * Repositions this stream to the position at the time the - * mark method was last called on this input stream. + * {@code mark} method was last called on this input stream. *

    - * The reset method of - * LineNumberInputStream resets the line number to be - * the line number at the time the mark method was - * called, and then calls the reset method of the + * The {@code reset} method of + * {@code LineNumberInputStream} resets the line number to be + * the line number at the time the {@code mark} method was + * called, and then calls the {@code reset} method of the * underlying input stream. *

    * Stream marks are intended to be used in diff --git a/jdk/src/share/classes/java/io/RandomAccessFile.java b/jdk/src/share/classes/java/io/RandomAccessFile.java index 893fc94ab63..cf1e5c7cef4 100644 --- a/jdk/src/share/classes/java/io/RandomAccessFile.java +++ b/jdk/src/share/classes/java/io/RandomAccessFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,16 +41,16 @@ import sun.nio.ch.FileChannelImpl; * the file pointer past the bytes written. Output operations that write * past the current end of the implied array cause the array to be * extended. The file pointer can be read by the - * getFilePointer method and set by the seek + * {@code getFilePointer} method and set by the {@code seek} * method. *

    * It is generally true of all the reading routines in this class that * if end-of-file is reached before the desired number of bytes has been - * read, an EOFException (which is a kind of - * IOException) is thrown. If any byte cannot be read for - * any reason other than end-of-file, an IOException other - * than EOFException is thrown. In particular, an - * IOException may be thrown if the stream has been closed. + * read, an {@code EOFException} (which is a kind of + * {@code IOException}) is thrown. If any byte cannot be read for + * any reason other than end-of-file, an {@code IOException} other + * than {@code EOFException} is thrown. In particular, an + * {@code IOException} may be thrown if the stream has been closed. * * @author unascribed * @since JDK1.0 @@ -82,12 +82,12 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { * href="#mode">RandomAccessFile(File,String) constructor. * *

    - * If there is a security manager, its checkRead method - * is called with the name argument + * If there is a security manager, its {@code checkRead} method + * is called with the {@code name} argument * as its argument to see if read access to the file is allowed. * If the mode allows writing, the security manager's - * checkWrite method - * is also called with the name argument + * {@code checkWrite} method + * is also called with the {@code name} argument * as its argument to see if write access to the file is allowed. * * @param name the system-dependent filename @@ -103,9 +103,9 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { * that name cannot be created, or if some other error occurs * while opening or creating the file * @exception SecurityException if a security manager exists and its - * checkRead method denies read access to the file + * {@code checkRead} method denies read access to the file * or the mode is "rw" and the security manager's - * checkWrite method denies write access to the file + * {@code checkWrite} method denies write access to the file * @see java.lang.SecurityException * @see java.lang.SecurityManager#checkRead(java.lang.String) * @see java.lang.SecurityManager#checkWrite(java.lang.String) @@ -164,10 +164,10 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { * updates to both the file's content and its metadata to be written, which * generally requires at least one more low-level I/O operation. * - *

    If there is a security manager, its checkRead method is - * called with the pathname of the file argument as its + *

    If there is a security manager, its {@code checkRead} method is + * called with the pathname of the {@code file} argument as its * argument to see if read access to the file is allowed. If the mode - * allows writing, the security manager's checkWrite method is + * allows writing, the security manager's {@code checkWrite} method is * also called with the path argument to see if write access to the file is * allowed. * @@ -185,9 +185,9 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { * that name cannot be created, or if some other error occurs * while opening or creating the file * @exception SecurityException if a security manager exists and its - * checkRead method denies read access to the file + * {@code checkRead} method denies read access to the file * or the mode is "rw" and the security manager's - * checkWrite method denies write access to the file + * {@code checkWrite} method denies write access to the file * @see java.lang.SecurityManager#checkRead(java.lang.String) * @see java.lang.SecurityManager#checkWrite(java.lang.String) * @see java.nio.channels.FileChannel#force(boolean) @@ -253,7 +253,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { * object associated with this file. * *

    The {@link java.nio.channels.FileChannel#position() - * position} of the returned channel will always be equal to + * position} of the returned channel will always be equal to * this object's file-pointer offset as returned by the {@link * #getFilePointer getFilePointer} method. Changing this object's * file-pointer offset, whether explicitly or by reading or writing bytes, @@ -277,9 +277,9 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { /** * Opens a file and returns the file descriptor. The file is - * opened in read-write mode if the O_RDWR bit in mode + * opened in read-write mode if the O_RDWR bit in {@code mode} * is true, else the file is opened as read-only. - * If the name refers to a directory, an IOException + * If the {@code name} refers to a directory, an IOException * is thrown. * * @param name the name of the file @@ -293,15 +293,15 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { /** * Reads a byte of data from this file. The byte is returned as an - * integer in the range 0 to 255 (0x00-0x0ff). This + * integer in the range 0 to 255 ({@code 0x00-0x0ff}). This * method blocks if no input is yet available. *

    - * Although RandomAccessFile is not a subclass of - * InputStream, this method behaves in exactly the same + * Although {@code RandomAccessFile} is not a subclass of + * {@code InputStream}, this method behaves in exactly the same * way as the {@link InputStream#read()} method of - * InputStream. + * {@code InputStream}. * - * @return the next byte of data, or -1 if the end of the + * @return the next byte of data, or {@code -1} if the end of the * file has been reached. * @exception IOException if an I/O error occurs. Not thrown if * end-of-file has been reached. @@ -318,59 +318,59 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { private native int readBytes(byte b[], int off, int len) throws IOException; /** - * Reads up to len bytes of data from this file into an + * Reads up to {@code len} bytes of data from this file into an * array of bytes. This method blocks until at least one byte of input * is available. *

    - * Although RandomAccessFile is not a subclass of - * InputStream, this method behaves in exactly the + * Although {@code RandomAccessFile} is not a subclass of + * {@code InputStream}, this method behaves in exactly the * same way as the {@link InputStream#read(byte[], int, int)} method of - * InputStream. + * {@code InputStream}. * * @param b the buffer into which the data is read. - * @param off the start offset in array b + * @param off the start offset in array {@code b} * at which the data is written. * @param len the maximum number of bytes read. * @return the total number of bytes read into the buffer, or - * -1 if there is no more data because the end of + * {@code -1} if there is no more data because the end of * the file has been reached. * @exception IOException If the first byte cannot be read for any reason * other than end of file, or if the random access file has been closed, or if * some other I/O error occurs. - * @exception NullPointerException If b is null. - * @exception IndexOutOfBoundsException If off is negative, - * len is negative, or len is greater than - * b.length - off + * @exception NullPointerException If {@code b} is {@code null}. + * @exception IndexOutOfBoundsException If {@code off} is negative, + * {@code len} is negative, or {@code len} is greater than + * {@code b.length - off} */ public int read(byte b[], int off, int len) throws IOException { return readBytes(b, off, len); } /** - * Reads up to b.length bytes of data from this file + * Reads up to {@code b.length} bytes of data from this file * into an array of bytes. This method blocks until at least one byte * of input is available. *

    - * Although RandomAccessFile is not a subclass of - * InputStream, this method behaves in exactly the + * Although {@code RandomAccessFile} is not a subclass of + * {@code InputStream}, this method behaves in exactly the * same way as the {@link InputStream#read(byte[])} method of - * InputStream. + * {@code InputStream}. * * @param b the buffer into which the data is read. * @return the total number of bytes read into the buffer, or - * -1 if there is no more data because the end of + * {@code -1} if there is no more data because the end of * this file has been reached. * @exception IOException If the first byte cannot be read for any reason * other than end of file, or if the random access file has been closed, or if * some other I/O error occurs. - * @exception NullPointerException If b is null. + * @exception NullPointerException If {@code b} is {@code null}. */ public int read(byte b[]) throws IOException { return readBytes(b, 0, b.length); } /** - * Reads b.length bytes from this file into the byte + * Reads {@code b.length} bytes from this file into the byte * array, starting at the current file pointer. This method reads * repeatedly from the file until the requested number of bytes are * read. This method blocks until the requested number of bytes are @@ -386,7 +386,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { } /** - * Reads exactly len bytes from this file into the byte + * Reads exactly {@code len} bytes from this file into the byte * array, starting at the current file pointer. This method reads * repeatedly from the file until the requested number of bytes are * read. This method blocks until the requested number of bytes are @@ -410,15 +410,15 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { } /** - * Attempts to skip over n bytes of input discarding the + * Attempts to skip over {@code n} bytes of input discarding the * skipped bytes. *

    * * This method may skip over some smaller number of bytes, possibly zero. * This may result from any of a number of conditions; reaching end of - * file before n bytes have been skipped is only one - * possibility. This method never throws an EOFException. - * The actual number of bytes skipped is returned. If n + * file before {@code n} bytes have been skipped is only one + * possibility. This method never throws an {@code EOFException}. + * The actual number of bytes skipped is returned. If {@code n} * is negative, no bytes are skipped. * * @param n the number of bytes to be skipped. @@ -451,7 +451,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { * Writes the specified byte to this file. The write starts at * the current file pointer. * - * @param b the byte to be written. + * @param b the {@code byte} to be written. * @exception IOException if an I/O error occurs. */ public native void write(int b) throws IOException; @@ -467,7 +467,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { private native void writeBytes(byte b[], int off, int len) throws IOException; /** - * Writes b.length bytes from the specified byte array + * Writes {@code b.length} bytes from the specified byte array * to this file, starting at the current file pointer. * * @param b the data. @@ -478,8 +478,8 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { } /** - * Writes len bytes from the specified byte array - * starting at offset off to this file. + * Writes {@code len} bytes from the specified byte array + * starting at offset {@code off} to this file. * * @param b the data. * @param off the start offset in the data. @@ -512,8 +512,8 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { * @param pos the offset position, measured in bytes from the * beginning of the file, at which to set the file * pointer. - * @exception IOException if pos is less than - * 0 or if an I/O error occurs. + * @exception IOException if {@code pos} is less than + * {@code 0} or if an I/O error occurs. */ public native void seek(long pos) throws IOException; @@ -529,14 +529,14 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { * Sets the length of this file. * *

    If the present length of the file as returned by the - * length method is greater than the newLength + * {@code length} method is greater than the {@code newLength} * argument then the file will be truncated. In this case, if the file - * offset as returned by the getFilePointer method is greater - * than newLength then after this method returns the offset - * will be equal to newLength. + * offset as returned by the {@code getFilePointer} method is greater + * than {@code newLength} then after this method returns the offset + * will be equal to {@code newLength}. * *

    If the present length of the file as returned by the - * length method is smaller than the newLength + * {@code length} method is smaller than the {@code newLength} * argument then the file will be extended. In this case, the contents of * the extended portion of the file are not defined. * @@ -584,14 +584,14 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { // /** - * Reads a boolean from this file. This method reads a + * Reads a {@code boolean} from this file. This method reads a * single byte from the file, starting at the current file pointer. - * A value of 0 represents - * false. Any other value represents true. + * A value of {@code 0} represents + * {@code false}. Any other value represents {@code true}. * This method blocks until the byte is read, the end of the stream * is detected, or an exception is thrown. * - * @return the boolean value read. + * @return the {@code boolean} value read. * @exception EOFException if this file has reached the end. * @exception IOException if an I/O error occurs. */ @@ -605,7 +605,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { /** * Reads a signed eight-bit value from this file. This method reads a * byte from the file, starting from the current file pointer. - * If the byte read is b, where + * If the byte read is {@code b}, where * 0 <= b <= 255, * then the result is: *

    @@ -616,7 +616,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
          * is detected, or an exception is thrown.
          *
          * @return     the next byte of this file as a signed eight-bit
    -     *             byte.
    +     *             {@code byte}.
          * @exception  EOFException  if this file has reached the end.
          * @exception  IOException   if an I/O error occurs.
          */
    @@ -651,8 +651,8 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
          * Reads a signed 16-bit number from this file. The method reads two
          * bytes from this file, starting at the current file pointer.
          * If the two bytes read, in order, are
    -     * b1 and b2, where each of the two values is
    -     * between 0 and 255, inclusive, then the
    +     * {@code b1} and {@code b2}, where each of the two values is
    +     * between {@code 0} and {@code 255}, inclusive, then the
          * result is equal to:
          * 
          *     (short)((b1 << 8) | b2)
    @@ -679,7 +679,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
          * Reads an unsigned 16-bit number from this file. This method reads
          * two bytes from the file, starting at the current file pointer.
          * If the bytes read, in order, are
    -     * b1 and b2, where
    +     * {@code b1} and {@code b2}, where
          * 0 <= b1, b2 <= 255,
          * then the result is equal to:
          * 
    @@ -707,7 +707,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
          * Reads a character from this file. This method reads two
          * bytes from the file, starting at the current file pointer.
          * If the bytes read, in order, are
    -     * b1 and b2, where
    +     * {@code b1} and {@code b2}, where
          * 0 <= b1, b2 <= 255,
          * then the result is equal to:
          * 
    @@ -718,7 +718,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
          * stream is detected, or an exception is thrown.
          *
          * @return     the next two bytes of this file, interpreted as a
    -     *                  char.
    +     *                  {@code char}.
          * @exception  EOFException  if this file reaches the end before reading
          *               two bytes.
          * @exception  IOException   if an I/O error occurs.
    @@ -734,8 +734,8 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
         /**
          * Reads a signed 32-bit integer from this file. This method reads 4
          * bytes from the file, starting at the current file pointer.
    -     * If the bytes read, in order, are b1,
    -     * b2, b3, and b4, where
    +     * If the bytes read, in order, are {@code b1},
    +     * {@code b2}, {@code b3}, and {@code b4}, where
          * 0 <= b1, b2, b3, b4 <= 255,
          * then the result is equal to:
          * 
    @@ -746,7 +746,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
          * stream is detected, or an exception is thrown.
          *
          * @return     the next four bytes of this file, interpreted as an
    -     *             int.
    +     *             {@code int}.
          * @exception  EOFException  if this file reaches the end before reading
          *               four bytes.
          * @exception  IOException   if an I/O error occurs.
    @@ -765,9 +765,9 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
          * Reads a signed 64-bit integer from this file. This method reads eight
          * bytes from the file, starting at the current file pointer.
          * If the bytes read, in order, are
    -     * b1, b2, b3,
    -     * b4, b5, b6,
    -     * b7, and b8, where:
    +     * {@code b1}, {@code b2}, {@code b3},
    +     * {@code b4}, {@code b5}, {@code b6},
    +     * {@code b7}, and {@code b8,} where:
          * 
          *     0 <= b1, b2, b3, b4, b5, b6, b7, b8 <=255,
          * 
    @@ -784,7 +784,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { * stream is detected, or an exception is thrown. * * @return the next eight bytes of this file, interpreted as a - * long. + * {@code long}. * @exception EOFException if this file reaches the end before reading * eight bytes. * @exception IOException if an I/O error occurs. @@ -794,18 +794,18 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { } /** - * Reads a float from this file. This method reads an - * int value, starting at the current file pointer, - * as if by the readInt method - * and then converts that int to a float - * using the intBitsToFloat method in class - * Float. + * Reads a {@code float} from this file. This method reads an + * {@code int} value, starting at the current file pointer, + * as if by the {@code readInt} method + * and then converts that {@code int} to a {@code float} + * using the {@code intBitsToFloat} method in class + * {@code Float}. *

    * This method blocks until the four bytes are read, the end of the * stream is detected, or an exception is thrown. * * @return the next four bytes of this file, interpreted as a - * float. + * {@code float}. * @exception EOFException if this file reaches the end before reading * four bytes. * @exception IOException if an I/O error occurs. @@ -817,18 +817,18 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { } /** - * Reads a double from this file. This method reads a - * long value, starting at the current file pointer, - * as if by the readLong method - * and then converts that long to a double - * using the longBitsToDouble method in - * class Double. + * Reads a {@code double} from this file. This method reads a + * {@code long} value, starting at the current file pointer, + * as if by the {@code readLong} method + * and then converts that {@code long} to a {@code double} + * using the {@code longBitsToDouble} method in + * class {@code Double}. *

    * This method blocks until the eight bytes are read, the end of the * stream is detected, or an exception is thrown. * * @return the next eight bytes of this file, interpreted as a - * double. + * {@code double}. * @exception EOFException if this file reaches the end before reading * eight bytes. * @exception IOException if an I/O error occurs. @@ -849,7 +849,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { * therefore, support the full Unicode character set. * *

    A line of text is terminated by a carriage-return character - * ('\r'), a newline character ('\n'), a + * ({@code '\u005Cr'}), a newline character ({@code '\u005Cn'}), a * carriage-return character immediately followed by a newline character, * or the end of the file. Line-terminating characters are discarded and * are not included as part of the string returned. @@ -901,7 +901,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { *

    * The first two bytes are read, starting from the current file * pointer, as if by - * readUnsignedShort. This value gives the number of + * {@code readUnsignedShort}. This value gives the number of * following bytes that are in the encoded string, not * the length of the resulting string. The following bytes are then * interpreted as bytes encoding characters in the modified UTF-8 format @@ -923,13 +923,13 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { } /** - * Writes a boolean to the file as a one-byte value. The - * value true is written out as the value - * (byte)1; the value false is written out - * as the value (byte)0. The write starts at + * Writes a {@code boolean} to the file as a one-byte value. The + * value {@code true} is written out as the value + * {@code (byte)1}; the value {@code false} is written out + * as the value {@code (byte)0}. The write starts at * the current position of the file pointer. * - * @param v a boolean value to be written. + * @param v a {@code boolean} value to be written. * @exception IOException if an I/O error occurs. */ public final void writeBoolean(boolean v) throws IOException { @@ -938,10 +938,10 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { } /** - * Writes a byte to the file as a one-byte value. The + * Writes a {@code byte} to the file as a one-byte value. The * write starts at the current position of the file pointer. * - * @param v a byte value to be written. + * @param v a {@code byte} value to be written. * @exception IOException if an I/O error occurs. */ public final void writeByte(int v) throws IOException { @@ -950,10 +950,10 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { } /** - * Writes a short to the file as two bytes, high byte first. + * Writes a {@code short} to the file as two bytes, high byte first. * The write starts at the current position of the file pointer. * - * @param v a short to be written. + * @param v a {@code short} to be written. * @exception IOException if an I/O error occurs. */ public final void writeShort(int v) throws IOException { @@ -963,11 +963,11 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { } /** - * Writes a char to the file as a two-byte value, high + * Writes a {@code char} to the file as a two-byte value, high * byte first. The write starts at the current position of the * file pointer. * - * @param v a char value to be written. + * @param v a {@code char} value to be written. * @exception IOException if an I/O error occurs. */ public final void writeChar(int v) throws IOException { @@ -977,10 +977,10 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { } /** - * Writes an int to the file as four bytes, high byte first. + * Writes an {@code int} to the file as four bytes, high byte first. * The write starts at the current position of the file pointer. * - * @param v an int to be written. + * @param v an {@code int} to be written. * @exception IOException if an I/O error occurs. */ public final void writeInt(int v) throws IOException { @@ -992,10 +992,10 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { } /** - * Writes a long to the file as eight bytes, high byte first. + * Writes a {@code long} to the file as eight bytes, high byte first. * The write starts at the current position of the file pointer. * - * @param v a long to be written. + * @param v a {@code long} to be written. * @exception IOException if an I/O error occurs. */ public final void writeLong(long v) throws IOException { @@ -1011,13 +1011,13 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { } /** - * Converts the float argument to an int using the - * floatToIntBits method in class Float, - * and then writes that int value to the file as a + * Converts the float argument to an {@code int} using the + * {@code floatToIntBits} method in class {@code Float}, + * and then writes that {@code int} value to the file as a * four-byte quantity, high byte first. The write starts at the * current position of the file pointer. * - * @param v a float value to be written. + * @param v a {@code float} value to be written. * @exception IOException if an I/O error occurs. * @see java.lang.Float#floatToIntBits(float) */ @@ -1026,13 +1026,13 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { } /** - * Converts the double argument to a long using the - * doubleToLongBits method in class Double, - * and then writes that long value to the file as an + * Converts the double argument to a {@code long} using the + * {@code doubleToLongBits} method in class {@code Double}, + * and then writes that {@code long} value to the file as an * eight-byte quantity, high byte first. The write starts at the current * position of the file pointer. * - * @param v a double value to be written. + * @param v a {@code double} value to be written. * @exception IOException if an I/O error occurs. * @see java.lang.Double#doubleToLongBits(double) */ @@ -1060,10 +1060,10 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { /** * Writes a string to the file as a sequence of characters. Each * character is written to the data output stream as if by the - * writeChar method. The write starts at the current + * {@code writeChar} method. The write starts at the current * position of the file pointer. * - * @param s a String value to be written. + * @param s a {@code String} value to be written. * @exception IOException if an I/O error occurs. * @see java.io.RandomAccessFile#writeChar(int) */ @@ -1087,7 +1087,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { *

    * First, two bytes are written to the file, starting at the * current file pointer, as if by the - * writeShort method giving the number of bytes to + * {@code writeShort} method giving the number of bytes to * follow. This value is the number of bytes actually written out, * not the length of the string. Following the length, each character * of the string is output, in sequence, using the modified UTF-8 encoding diff --git a/jdk/src/share/classes/java/io/StreamTokenizer.java b/jdk/src/share/classes/java/io/StreamTokenizer.java index 81ec5d5d221..3c7c7cc214c 100644 --- a/jdk/src/share/classes/java/io/StreamTokenizer.java +++ b/jdk/src/share/classes/java/io/StreamTokenizer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ package java.io; import java.util.Arrays; /** - * The StreamTokenizer class takes an input stream and + * The {@code StreamTokenizer} class takes an input stream and * parses it into "tokens", allowing the tokens to be * read one at a time. The parsing process is controlled by a table * and a number of flags that can be set to various states. The @@ -36,7 +36,7 @@ import java.util.Arrays; * strings, and various comment styles. *

    * Each byte read from the input stream is regarded as a character - * in the range '\u0000' through '\u00FF'. + * in the range {@code '\u005Cu0000'} through {@code '\u005Cu00FF'}. * The character value is used to look up five possible attributes of * the character: white space, alphabetic, * numeric, string quote, and comment character. @@ -53,8 +53,8 @@ import java.util.Arrays; *

    * A typical application first constructs an instance of this class, * sets up the syntax tables, and then repeatedly loops calling the - * nextToken method in each iteration of the loop until - * it returns the value TT_EOF. + * {@code nextToken} method in each iteration of the loop until + * it returns the value {@code TT_EOF}. * * @author James Gosling * @see java.io.StreamTokenizer#nextToken() @@ -99,19 +99,19 @@ public class StreamTokenizer { private static final byte CT_COMMENT = 16; /** - * After a call to the nextToken method, this field + * After a call to the {@code nextToken} method, this field * contains the type of the token just read. For a single character * token, its value is the single character, converted to an integer. * For a quoted string token, its value is the quote character. * Otherwise, its value is one of the following: *

      - *
    • TT_WORD indicates that the token is a word. - *
    • TT_NUMBER indicates that the token is a number. - *
    • TT_EOL indicates that the end of line has been read. + *
    • {@code TT_WORD} indicates that the token is a word. + *
    • {@code TT_NUMBER} indicates that the token is a number. + *
    • {@code TT_EOL} indicates that the end of line has been read. * The field can only have this value if the - * eolIsSignificant method has been called with the - * argument true. - *
    • TT_EOF indicates that the end of the input stream + * {@code eolIsSignificant} method has been called with the + * argument {@code true}. + *
    • {@code TT_EOF} indicates that the end of the input stream * has been reached. *
    *

    @@ -160,8 +160,8 @@ public class StreamTokenizer { * the string. *

    * The current token is a word when the value of the - * ttype field is TT_WORD. The current token is - * a quoted string token when the value of the ttype field is + * {@code ttype} field is {@code TT_WORD}. The current token is + * a quoted string token when the value of the {@code ttype} field is * a quote character. *

    * The initial value of this field is null. @@ -175,7 +175,7 @@ public class StreamTokenizer { /** * If the current token is a number, this field contains the value * of that number. The current token is a number when the value of - * the ttype field is TT_NUMBER. + * the {@code ttype} field is {@code TT_NUMBER}. *

    * The initial value of this field is 0.0. * @@ -201,14 +201,14 @@ public class StreamTokenizer { * stream. The stream tokenizer is initialized to the following * default state: *

      - *
    • All byte values 'A' through 'Z', - * 'a' through 'z', and - * '\u00A0' through '\u00FF' are + *
    • All byte values {@code 'A'} through {@code 'Z'}, + * {@code 'a'} through {@code 'z'}, and + * {@code '\u005Cu00A0'} through {@code '\u005Cu00FF'} are * considered to be alphabetic. - *
    • All byte values '\u0000' through - * '\u0020' are considered to be white space. - *
    • '/' is a comment character. - *
    • Single quote '\'' and double quote '"' + *
    • All byte values {@code '\u005Cu0000'} through + * {@code '\u005Cu0020'} are considered to be white space. + *
    • {@code '/'} is a comment character. + *
    • Single quote {@code '\u005C''} and double quote {@code '"'} * are string quote characters. *
    • Numbers are parsed. *
    • Ends of lines are treated as white space, not as separate tokens. @@ -252,7 +252,7 @@ public class StreamTokenizer { /** * Resets this tokenizer's syntax table so that all characters are - * "ordinary." See the ordinaryChar method + * "ordinary." See the {@code ordinaryChar} method * for more information on a character being ordinary. * * @see java.io.StreamTokenizer#ordinaryChar(int) @@ -305,7 +305,7 @@ public class StreamTokenizer { * Specifies that all characters c in the range * low <= c <= high * are "ordinary" in this tokenizer. See the - * ordinaryChar method for more information on a + * {@code ordinaryChar} method for more information on a * character being ordinary. * * @param low the low end of the range. @@ -327,12 +327,12 @@ public class StreamTokenizer { * character has as a comment character, word component, string * delimiter, white space, or number character. When such a character * is encountered by the parser, the parser treats it as a - * single-character token and sets ttype field to the + * single-character token and sets {@code ttype} field to the * character value. * *

      Making a line terminator character "ordinary" may interfere - * with the ability of a StreamTokenizer to count - * lines. The lineno method may no longer reflect + * with the ability of a {@code StreamTokenizer} to count + * lines. The {@code lineno} method may no longer reflect * the presence of such terminator characters in its line count. * * @param ch the character. @@ -361,9 +361,9 @@ public class StreamTokenizer { * Specifies that matching pairs of this character delimit string * constants in this tokenizer. *

      - * When the nextToken method encounters a string - * constant, the ttype field is set to the string - * delimiter and the sval field is set to the body of + * When the {@code nextToken} method encounters a string + * constant, the {@code ttype} field is set to the string + * delimiter and the {@code sval} field is set to the body of * the string. *

      * If a string quote character is encountered, then a string is @@ -371,7 +371,7 @@ public class StreamTokenizer { * the string quote character, up to (but not including) the next * occurrence of that same string quote character, or a line * terminator, or end of file. The usual escape sequences such as - * "\n" and "\t" are recognized and + * {@code "\u005Cn"} and {@code "\u005Ct"} are recognized and * converted to single characters as the string is parsed. * *

      Any other attribute settings for the specified character are cleared. @@ -398,9 +398,9 @@ public class StreamTokenizer { *

      * When the parser encounters a word token that has the format of a * double precision floating-point number, it treats the token as a - * number rather than a word, by setting the ttype - * field to the value TT_NUMBER and putting the numeric - * value of the token into the nval field. + * number rather than a word, by setting the {@code ttype} + * field to the value {@code TT_NUMBER} and putting the numeric + * value of the token into the {@code nval} field. * * @see java.io.StreamTokenizer#nval * @see java.io.StreamTokenizer#TT_NUMBER @@ -416,21 +416,21 @@ public class StreamTokenizer { /** * Determines whether or not ends of line are treated as tokens. * If the flag argument is true, this tokenizer treats end of lines - * as tokens; the nextToken method returns - * TT_EOL and also sets the ttype field to + * as tokens; the {@code nextToken} method returns + * {@code TT_EOL} and also sets the {@code ttype} field to * this value when an end of line is read. *

      * A line is a sequence of characters ending with either a - * carriage-return character ('\r') or a newline - * character ('\n'). In addition, a carriage-return + * carriage-return character ({@code '\u005Cr'}) or a newline + * character ({@code '\u005Cn'}). In addition, a carriage-return * character followed immediately by a newline character is treated * as a single end-of-line token. *

      - * If the flag is false, end-of-line characters are + * If the {@code flag} is false, end-of-line characters are * treated as white space and serve only to separate tokens. * - * @param flag true indicates that end-of-line characters - * are separate tokens; false indicates that + * @param flag {@code true} indicates that end-of-line characters + * are separate tokens; {@code false} indicates that * end-of-line characters are white space. * @see java.io.StreamTokenizer#nextToken() * @see java.io.StreamTokenizer#ttype @@ -442,14 +442,14 @@ public class StreamTokenizer { /** * Determines whether or not the tokenizer recognizes C-style comments. - * If the flag argument is true, this stream tokenizer + * If the flag argument is {@code true}, this stream tokenizer * recognizes C-style comments. All text between successive - * occurrences of /* and */ are discarded. + * occurrences of {@code /*} and */ are discarded. *

      - * If the flag argument is false, then C-style comments + * If the flag argument is {@code false}, then C-style comments * are not treated specially. * - * @param flag true indicates to recognize and ignore + * @param flag {@code true} indicates to recognize and ignore * C-style comments. */ public void slashStarComments(boolean flag) { @@ -458,15 +458,15 @@ public class StreamTokenizer { /** * Determines whether or not the tokenizer recognizes C++-style comments. - * If the flag argument is true, this stream tokenizer + * If the flag argument is {@code true}, this stream tokenizer * recognizes C++-style comments. Any occurrence of two consecutive - * slash characters ('/') is treated as the beginning of + * slash characters ({@code '/'}) is treated as the beginning of * a comment that extends to the end of the line. *

      - * If the flag argument is false, then C++-style + * If the flag argument is {@code false}, then C++-style * comments are not treated specially. * - * @param flag true indicates to recognize and ignore + * @param flag {@code true} indicates to recognize and ignore * C++-style comments. */ public void slashSlashComments(boolean flag) { @@ -475,16 +475,16 @@ public class StreamTokenizer { /** * Determines whether or not word token are automatically lowercased. - * If the flag argument is true, then the value in the - * sval field is lowercased whenever a word token is - * returned (the ttype field has the - * value TT_WORD by the nextToken method + * If the flag argument is {@code true}, then the value in the + * {@code sval} field is lowercased whenever a word token is + * returned (the {@code ttype} field has the + * value {@code TT_WORD} by the {@code nextToken} method * of this tokenizer. *

      - * If the flag argument is false, then the - * sval field is not modified. + * If the flag argument is {@code false}, then the + * {@code sval} field is not modified. * - * @param fl true indicates that all word tokens should + * @param fl {@code true} indicates that all word tokens should * be lowercased. * @see java.io.StreamTokenizer#nextToken() * @see java.io.StreamTokenizer#ttype @@ -506,9 +506,9 @@ public class StreamTokenizer { /** * Parses the next token from the input stream of this tokenizer. - * The type of the next token is returned in the ttype + * The type of the next token is returned in the {@code ttype} * field. Additional information about the token may be in the - * nval field or the sval field of this + * {@code nval} field or the {@code sval} field of this * tokenizer. *

      * Typical clients of this @@ -516,7 +516,7 @@ public class StreamTokenizer { * calling nextToken to parse successive tokens until TT_EOF * is returned. * - * @return the value of the ttype field. + * @return the value of the {@code ttype} field. * @exception IOException if an I/O error occurs. * @see java.io.StreamTokenizer#nval * @see java.io.StreamTokenizer#sval @@ -752,10 +752,10 @@ public class StreamTokenizer { } /** - * Causes the next call to the nextToken method of this - * tokenizer to return the current value in the ttype - * field, and not to modify the value in the nval or - * sval field. + * Causes the next call to the {@code nextToken} method of this + * tokenizer to return the current value in the {@code ttype} + * field, and not to modify the value in the {@code nval} or + * {@code sval} field. * * @see java.io.StreamTokenizer#nextToken() * @see java.io.StreamTokenizer#nval diff --git a/jdk/src/share/classes/java/lang/AbstractStringBuilder.java b/jdk/src/share/classes/java/lang/AbstractStringBuilder.java index 3605343ae36..eb38da21c0a 100644 --- a/jdk/src/share/classes/java/lang/AbstractStringBuilder.java +++ b/jdk/src/share/classes/java/lang/AbstractStringBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -91,10 +91,10 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * array is allocated with greater capacity. The new capacity is the * larger of: *

        - *
      • The minimumCapacity argument. - *
      • Twice the old capacity, plus 2. + *
      • The {@code minimumCapacity} argument. + *
      • Twice the old capacity, plus {@code 2}. *
      - * If the minimumCapacity argument is nonpositive, this + * If the {@code minimumCapacity} argument is nonpositive, this * method takes no action and simply returns. * * @param minimumCapacity the minimum desired capacity. @@ -147,26 +147,26 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * Sets the length of the character sequence. * The sequence is changed to a new character sequence * whose length is specified by the argument. For every nonnegative - * index k less than newLength, the character at + * index k less than {@code newLength}, the character at * index k in the new character sequence is the same as the * character at index k in the old sequence if k is less * than the length of the old character sequence; otherwise, it is the - * null character '\u0000'. + * null character {@code '\u005Cu0000'}. * - * In other words, if the newLength argument is less than + * In other words, if the {@code newLength} argument is less than * the current length, the length is changed to the specified length. *

      - * If the newLength argument is greater than or equal + * If the {@code newLength} argument is greater than or equal * to the current length, sufficient null characters - * ('\u0000') are appended so that - * length becomes the newLength argument. + * ({@code '\u005Cu0000'}) are appended so that + * length becomes the {@code newLength} argument. *

      - * The newLength argument must be greater than or equal - * to 0. + * The {@code newLength} argument must be greater than or equal + * to {@code 0}. * * @param newLength the new length * @throws IndexOutOfBoundsException if the - * newLength argument is negative. + * {@code newLength} argument is negative. */ public void setLength(int newLength) { if (newLength < 0) @@ -182,21 +182,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { } /** - * Returns the char value in this sequence at the specified index. - * The first char value is at index 0, the next at index - * 1, and so on, as in array indexing. + * Returns the {@code char} value in this sequence at the specified index. + * The first {@code char} value is at index {@code 0}, the next at index + * {@code 1}, and so on, as in array indexing. *

      * The index argument must be greater than or equal to - * 0, and less than the length of this sequence. + * {@code 0}, and less than the length of this sequence. * - *

      If the char value specified by the index is a + *

      If the {@code char} value specified by the index is a * surrogate, the surrogate * value is returned. * - * @param index the index of the desired char value. - * @return the char value at the specified index. - * @throws IndexOutOfBoundsException if index is - * negative or greater than or equal to length(). + * @param index the index of the desired {@code char} value. + * @return the {@code char} value at the specified index. + * @throws IndexOutOfBoundsException if {@code index} is + * negative or greater than or equal to {@code length()}. */ public char charAt(int index) { if ((index < 0) || (index >= count)) @@ -206,22 +206,22 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { /** * Returns the character (Unicode code point) at the specified - * index. The index refers to char values - * (Unicode code units) and ranges from 0 to - * {@link #length()} - 1. + * index. The index refers to {@code char} values + * (Unicode code units) and ranges from {@code 0} to + * {@link #length()}{@code - 1}. * - *

      If the char value specified at the given index + *

      If the {@code char} value specified at the given index * is in the high-surrogate range, the following index is less * than the length of this sequence, and the - * char value at the following index is in the + * {@code char} value at the following index is in the * low-surrogate range, then the supplementary code point * corresponding to this surrogate pair is returned. Otherwise, - * the char value at the given index is returned. + * the {@code char} value at the given index is returned. * - * @param index the index to the char values + * @param index the index to the {@code char} values * @return the code point value of the character at the - * index - * @exception IndexOutOfBoundsException if the index + * {@code index} + * @exception IndexOutOfBoundsException if the {@code index} * argument is negative or not less than the length of this * sequence. */ @@ -234,22 +234,22 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { /** * Returns the character (Unicode code point) before the specified - * index. The index refers to char values - * (Unicode code units) and ranges from 1 to {@link + * index. The index refers to {@code char} values + * (Unicode code units) and ranges from {@code 1} to {@link * #length()}. * - *

      If the char value at (index - 1) - * is in the low-surrogate range, (index - 2) is not - * negative, and the char value at (index - - * 2) is in the high-surrogate range, then the + *

      If the {@code char} value at {@code (index - 1)} + * is in the low-surrogate range, {@code (index - 2)} is not + * negative, and the {@code char} value at {@code (index - + * 2)} is in the high-surrogate range, then the * supplementary code point value of the surrogate pair is - * returned. If the char value at index - - * 1 is an unpaired low-surrogate or a high-surrogate, the + * returned. If the {@code char} value at {@code index - + * 1} is an unpaired low-surrogate or a high-surrogate, the * surrogate value is returned. * * @param index the index following the code point that should be returned * @return the Unicode code point value before the given index. - * @exception IndexOutOfBoundsException if the index + * @exception IndexOutOfBoundsException if the {@code index} * argument is less than 1 or greater than the length * of this sequence. */ @@ -264,22 +264,22 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { /** * Returns the number of Unicode code points in the specified text * range of this sequence. The text range begins at the specified - * beginIndex and extends to the char at - * index endIndex - 1. Thus the length (in - * chars) of the text range is - * endIndex-beginIndex. Unpaired surrogates within + * {@code beginIndex} and extends to the {@code char} at + * index {@code endIndex - 1}. Thus the length (in + * {@code char}s) of the text range is + * {@code endIndex-beginIndex}. Unpaired surrogates within * this sequence count as one code point each. * - * @param beginIndex the index to the first char of + * @param beginIndex the index to the first {@code char} of * the text range. - * @param endIndex the index after the last char of + * @param endIndex the index after the last {@code char} of * the text range. * @return the number of Unicode code points in the specified text * range * @exception IndexOutOfBoundsException if the - * beginIndex is negative, or endIndex + * {@code beginIndex} is negative, or {@code endIndex} * is larger than the length of this sequence, or - * beginIndex is larger than endIndex. + * {@code beginIndex} is larger than {@code endIndex}. */ public int codePointCount(int beginIndex, int endIndex) { if (beginIndex < 0 || endIndex > count || beginIndex > endIndex) { @@ -290,22 +290,22 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { /** * Returns the index within this sequence that is offset from the - * given index by codePointOffset code + * given {@code index} by {@code codePointOffset} code * points. Unpaired surrogates within the text range given by - * index and codePointOffset count as + * {@code index} and {@code codePointOffset} count as * one code point each. * * @param index the index to be offset * @param codePointOffset the offset in code points * @return the index within this sequence - * @exception IndexOutOfBoundsException if index + * @exception IndexOutOfBoundsException if {@code index} * is negative or larger then the length of this sequence, - * or if codePointOffset is positive and the subsequence - * starting with index has fewer than - * codePointOffset code points, - * or if codePointOffset is negative and the subsequence - * before index has fewer than the absolute value of - * codePointOffset code points. + * or if {@code codePointOffset} is positive and the subsequence + * starting with {@code index} has fewer than + * {@code codePointOffset} code points, + * or if {@code codePointOffset} is negative and the subsequence + * before {@code index} has fewer than the absolute value of + * {@code codePointOffset} code points. */ public int offsetByCodePoints(int index, int codePointOffset) { if (index < 0 || index > count) { @@ -317,12 +317,12 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { /** * Characters are copied from this sequence into the - * destination character array dst. The first character to - * be copied is at index srcBegin; the last character to - * be copied is at index srcEnd-1. The total number of - * characters to be copied is srcEnd-srcBegin. The - * characters are copied into the subarray of dst starting - * at index dstBegin and ending at index: + * destination character array {@code dst}. The first character to + * be copied is at index {@code srcBegin}; the last character to + * be copied is at index {@code srcEnd-1}. The total number of + * characters to be copied is {@code srcEnd-srcBegin}. The + * characters are copied into the subarray of {@code dst} starting + * at index {@code dstBegin} and ending at index: *

            * dstbegin + (srcEnd-srcBegin) - 1
            * 
      @@ -330,19 +330,19 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * @param srcBegin start copying at this offset. * @param srcEnd stop copying at this offset. * @param dst the array to copy the data into. - * @param dstBegin offset into dst. - * @throws NullPointerException if dst is - * null. + * @param dstBegin offset into {@code dst}. + * @throws NullPointerException if {@code dst} is + * {@code null}. * @throws IndexOutOfBoundsException if any of the following is true: *
        - *
      • srcBegin is negative - *
      • dstBegin is negative - *
      • the srcBegin argument is greater than - * the srcEnd argument. - *
      • srcEnd is greater than - * this.length(). - *
      • dstBegin+srcEnd-srcBegin is greater than - * dst.length + *
      • {@code srcBegin} is negative + *
      • {@code dstBegin} is negative + *
      • the {@code srcBegin} argument is greater than + * the {@code srcEnd} argument. + *
      • {@code srcEnd} is greater than + * {@code this.length()}. + *
      • {@code dstBegin+srcEnd-srcBegin} is greater than + * {@code dst.length} *
      */ public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) @@ -357,18 +357,18 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { } /** - * The character at the specified index is set to ch. This + * The character at the specified index is set to {@code ch}. This * sequence is altered to represent a new character sequence that is * identical to the old character sequence, except that it contains the - * character ch at position index. + * character {@code ch} at position {@code index}. *

      * The index argument must be greater than or equal to - * 0, and less than the length of this sequence. + * {@code 0}, and less than the length of this sequence. * * @param index the index of the character to modify. * @param ch the new character. - * @throws IndexOutOfBoundsException if index is - * negative or greater than or equal to length(). + * @throws IndexOutOfBoundsException if {@code index} is + * negative or greater than or equal to {@code length()}. */ public void setCharAt(int index, char ch) { if ((index < 0) || (index >= count)) @@ -741,21 +741,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { } /** - * Removes the char at the specified position in this - * sequence. This sequence is shortened by one char. + * Removes the {@code char} at the specified position in this + * sequence. This sequence is shortened by one {@code char}. * *

      Note: If the character at the given index is a supplementary * character, this method does not remove the entire character. If * correct handling of supplementary characters is required, - * determine the number of chars to remove by calling - * Character.charCount(thisSequence.codePointAt(index)), - * where thisSequence is this sequence. + * determine the number of {@code char}s to remove by calling + * {@code Character.charCount(thisSequence.codePointAt(index))}, + * where {@code thisSequence} is this sequence. * - * @param index Index of char to remove + * @param index Index of {@code char} to remove * @return This object. - * @throws StringIndexOutOfBoundsException if the index + * @throws StringIndexOutOfBoundsException if the {@code index} * is negative or greater than or equal to - * length(). + * {@code length()}. */ public AbstractStringBuilder deleteCharAt(int index) { if ((index < 0) || (index >= count)) @@ -767,12 +767,12 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { /** * Replaces the characters in a substring of this sequence - * with characters in the specified String. The substring - * begins at the specified start and extends to the character - * at index end - 1 or to the end of the + * with characters in the specified {@code String}. The substring + * begins at the specified {@code start} and extends to the character + * at index {@code end - 1} or to the end of the * sequence if no such character exists. First the * characters in the substring are removed and then the specified - * String is inserted at start. (This + * {@code String} is inserted at {@code start}. (This * sequence will be lengthened to accommodate the * specified String if necessary.) * @@ -780,9 +780,9 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * @param end The ending index, exclusive. * @param str String that will replace previous contents. * @return This object. - * @throws StringIndexOutOfBoundsException if start - * is negative, greater than length(), or - * greater than end. + * @throws StringIndexOutOfBoundsException if {@code start} + * is negative, greater than {@code length()}, or + * greater than {@code end}. */ public AbstractStringBuilder replace(int start, int end, String str) { if (start < 0) @@ -805,14 +805,14 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { } /** - * Returns a new String that contains a subsequence of + * Returns a new {@code String} that contains a subsequence of * characters currently contained in this character sequence. The * substring begins at the specified index and extends to the end of * this sequence. * * @param start The beginning index, inclusive. * @return The new string. - * @throws StringIndexOutOfBoundsException if start is + * @throws StringIndexOutOfBoundsException if {@code start} is * less than zero, or greater than the length of this object. */ public String substring(int start) { @@ -850,18 +850,18 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { } /** - * Returns a new String that contains a subsequence of + * Returns a new {@code String} that contains a subsequence of * characters currently contained in this sequence. The - * substring begins at the specified start and - * extends to the character at index end - 1. + * substring begins at the specified {@code start} and + * extends to the character at index {@code end - 1}. * * @param start The beginning index, inclusive. * @param end The ending index, exclusive. * @return The new string. - * @throws StringIndexOutOfBoundsException if start - * or end are negative or greater than - * length(), or start is - * greater than end. + * @throws StringIndexOutOfBoundsException if {@code start} + * or {@code end} are negative or greater than + * {@code length()}, or {@code start} is + * greater than {@code end}. */ public String substring(int start, int end) { if (start < 0) @@ -1254,15 +1254,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { *

            * this.toString().startsWith(str, k)
            * 
      - * is true. + * is {@code true}. * * @param str any string. * @return if the string argument occurs as a substring within this * object, then the index of the first character of the first * such substring is returned; if it does not occur as a - * substring, -1 is returned. - * @throws java.lang.NullPointerException if str is - * null. + * substring, {@code -1} is returned. + * @throws java.lang.NullPointerException if {@code str} is + * {@code null}. */ public int indexOf(String str) { return indexOf(str, 0); @@ -1282,8 +1282,8 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * @param fromIndex the index from which to start the search. * @return the index within this string of the first occurrence of the * specified substring, starting at the specified index. - * @throws java.lang.NullPointerException if str is - * null. + * @throws java.lang.NullPointerException if {@code str} is + * {@code null}. */ public int indexOf(String str, int fromIndex) { return String.indexOf(value, 0, count, @@ -1293,7 +1293,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { /** * Returns the index within this string of the rightmost occurrence * of the specified substring. The rightmost empty string "" is - * considered to occur at the index value this.length(). + * considered to occur at the index value {@code this.length()}. * The returned index is the largest value k such that *
            * this.toString().startsWith(str, k)
      @@ -1304,9 +1304,9 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
            * @return  if the string argument occurs one or more times as a substring
            *          within this object, then the index of the first character of
            *          the last such substring is returned. If it does not occur as
      -     *          a substring, -1 is returned.
      -     * @throws  java.lang.NullPointerException  if str is
      -     *          null.
      +     *          a substring, {@code -1} is returned.
      +     * @throws  java.lang.NullPointerException  if {@code str} is
      +     *          {@code null}.
            */
           public int lastIndexOf(String str) {
               return lastIndexOf(str, count);
      @@ -1326,8 +1326,8 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
            * @param   fromIndex   the index to start the search from.
            * @return  the index within this sequence of the last occurrence of the
            *          specified substring.
      -     * @throws  java.lang.NullPointerException if str is
      -     *          null.
      +     * @throws  java.lang.NullPointerException if {@code str} is
      +     *          {@code null}.
            */
           public int lastIndexOf(String str, int fromIndex) {
               return String.lastIndexOf(value, 0, count,
      @@ -1342,8 +1342,8 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
            * is never reversed.
            *
            * Let n be the character length of this character sequence
      -     * (not the length in char values) just prior to
      -     * execution of the reverse method. Then the
      +     * (not the length in {@code char} values) just prior to
      +     * execution of the {@code reverse} method. Then the
            * character at index k in the new character sequence is
            * equal to the character at index n-k-1 in the old
            * character sequence.
      @@ -1351,7 +1351,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
            * 

      Note that the reverse operation may result in producing * surrogate pairs that were unpaired low-surrogates and * high-surrogates before the operation. For example, reversing - * "\uDC00\uD800" produces "\uD800\uDC00" which is + * "\u005CuDC00\u005CuD800" produces "\u005CuD800\u005CuDC00" which is * a valid surrogate pair. * * @return a reference to this object. @@ -1387,11 +1387,11 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { /** * Returns a string representing the data in this sequence. - * A new String object is allocated and initialized to + * A new {@code String} object is allocated and initialized to * contain the character sequence currently represented by this - * object. This String is then returned. Subsequent + * object. This {@code String} is then returned. Subsequent * changes to this sequence do not affect the contents of the - * String. + * {@code String}. * * @return a string representation of this sequence of characters. */ diff --git a/jdk/src/share/classes/java/lang/Byte.java b/jdk/src/share/classes/java/lang/Byte.java index 21c813b2187..799936f4a44 100644 --- a/jdk/src/share/classes/java/lang/Byte.java +++ b/jdk/src/share/classes/java/lang/Byte.java @@ -110,8 +110,8 @@ public final class Byte extends Number implements Comparable { * determined by whether {@link java.lang.Character#digit(char, * int)} returns a nonnegative value) except that the first * character may be an ASCII minus sign {@code '-'} - * ('\u002D') to indicate a negative value or an - * ASCII plus sign {@code '+'} ('\u002B') to + * ({@code '\u005Cu002D'}) to indicate a negative value or an + * ASCII plus sign {@code '+'} ({@code '\u005Cu002B'}) to * indicate a positive value. The resulting {@code byte} value is * returned. * @@ -127,8 +127,8 @@ public final class Byte extends Number implements Comparable { * *

    • Any character of the string is not a digit of the * specified radix, except that the first character may be a minus - * sign {@code '-'} ('\u002D') or plus sign - * {@code '+'} ('\u002B') provided that the + * sign {@code '-'} ({@code '\u005Cu002D'}) or plus sign + * {@code '+'} ({@code '\u005Cu002B'}) provided that the * string is longer than length 1. * *
    • The value represented by the string is not a value of type @@ -157,9 +157,9 @@ public final class Byte extends Number implements Comparable { * Parses the string argument as a signed decimal {@code * byte}. The characters in the string must all be decimal digits, * except that the first character may be an ASCII minus sign - * {@code '-'} ('\u002D') to indicate a negative + * {@code '-'} ({@code '\u005Cu002D'}) to indicate a negative * value or an ASCII plus sign {@code '+'} - * ('\u002B') to indicate a positive value. The + * ({@code '\u005Cu002B'}) to indicate a positive value. The * resulting {@code byte} value is returned, exactly as if the * argument and the radix 10 were given as arguments to the {@link * #parseByte(java.lang.String, int)} method. diff --git a/jdk/src/share/classes/java/lang/Double.java b/jdk/src/share/classes/java/lang/Double.java index 8bf9853537d..5e1afaea747 100644 --- a/jdk/src/share/classes/java/lang/Double.java +++ b/jdk/src/share/classes/java/lang/Double.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -140,7 +140,7 @@ public final class Double extends Number implements Comparable { *
    • Otherwise, the result is a string that represents the sign and * magnitude (absolute value) of the argument. If the sign is negative, * the first character of the result is '{@code -}' - * ('\u002D'); if the sign is positive, no sign character + * ({@code '\u005Cu002D'}); if the sign is positive, no sign character * appears in the result. As for the magnitude m: *
        *
      • If m is infinity, it is represented by the characters @@ -156,7 +156,7 @@ public final class Double extends Number implements Comparable { *
      • If m is greater than or equal to 10-3 but less * than 107, then it is represented as the integer part of * m, in decimal form with no leading zeroes, followed by - * '{@code .}' ('\u002E'), followed by one or + * '{@code .}' ({@code '\u005Cu002E'}), followed by one or * more decimal digits representing the fractional part of m. * *
      • If m is less than 10-3 or greater than or @@ -168,9 +168,9 @@ public final class Double extends Number implements Comparable { * 10n so that 1 ≤ a {@literal <} 10. The * magnitude is then represented as the integer part of a, * as a single decimal digit, followed by '{@code .}' - * ('\u002E'), followed by decimal digits + * ({@code '\u005Cu002E'}), followed by decimal digits * representing the fractional part of a, followed by the - * letter '{@code E}' ('\u0045'), followed + * letter '{@code E}' ({@code '\u005Cu0045'}), followed * by a representation of n as a decimal integer, as * produced by the method {@link Integer#toString(int)}. *
      @@ -208,7 +208,7 @@ public final class Double extends Number implements Comparable { *
    • Otherwise, the result is a string that represents the sign * and magnitude of the argument. If the sign is negative, the * first character of the result is '{@code -}' - * ('\u002D'); if the sign is positive, no sign + * ({@code '\u005Cu002D'}); if the sign is positive, no sign * character appears in the result. As for the magnitude m: * *
        diff --git a/jdk/src/share/classes/java/lang/Float.java b/jdk/src/share/classes/java/lang/Float.java index 65a230a12a5..4e73507911b 100644 --- a/jdk/src/share/classes/java/lang/Float.java +++ b/jdk/src/share/classes/java/lang/Float.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -138,7 +138,7 @@ public final class Float extends Number implements Comparable { *
      • Otherwise, the result is a string that represents the sign and * magnitude (absolute value) of the argument. If the sign is * negative, the first character of the result is - * '{@code -}' ('\u002D'); if the sign is + * '{@code -}' ({@code '\u005Cu002D'}); if the sign is * positive, no sign character appears in the result. As for * the magnitude m: *
          @@ -154,7 +154,7 @@ public final class Float extends Number implements Comparable { * less than 107, then it is represented as the * integer part of m, in decimal form with no leading * zeroes, followed by '{@code .}' - * ('\u002E'), followed by one or more + * ({@code '\u005Cu002E'}), followed by one or more * decimal digits representing the fractional part of * m. *
        • If m is less than 10-3 or greater than or @@ -166,10 +166,10 @@ public final class Float extends Number implements Comparable { * 10n so that 1 ≤ a {@literal <} 10. * The magnitude is then represented as the integer part of * a, as a single decimal digit, followed by - * '{@code .}' ('\u002E'), followed by + * '{@code .}' ({@code '\u005Cu002E'}), followed by * decimal digits representing the fractional part of * a, followed by the letter '{@code E}' - * ('\u0045'), followed by a representation + * ({@code '\u005Cu0045'}), followed by a representation * of n as a decimal integer, as produced by the * method {@link java.lang.Integer#toString(int)}. * @@ -210,7 +210,7 @@ public final class Float extends Number implements Comparable { *
        • Otherwise, the result is a string that represents the sign and * magnitude (absolute value) of the argument. If the sign is negative, * the first character of the result is '{@code -}' - * ('\u002D'); if the sign is positive, no sign character + * ({@code '\u005Cu002D'}); if the sign is positive, no sign character * appears in the result. As for the magnitude m: * *
            diff --git a/jdk/src/share/classes/java/lang/Integer.java b/jdk/src/share/classes/java/lang/Integer.java index 445161d150e..88acdfa11da 100644 --- a/jdk/src/share/classes/java/lang/Integer.java +++ b/jdk/src/share/classes/java/lang/Integer.java @@ -93,13 +93,13 @@ public final class Integer extends Number implements Comparable { * *

            If the first argument is negative, the first element of the * result is the ASCII minus character {@code '-'} - * ('\u002D'). If the first argument is not + * ({@code '\u005Cu002D'}). If the first argument is not * negative, no sign character appears in the result. * *

            The remaining characters of the result represent the magnitude * of the first argument. If the magnitude is zero, it is * represented by a single zero character {@code '0'} - * ('\u0030'); otherwise, the first character of + * ({@code '\u005Cu0030'}); otherwise, the first character of * the representation of the magnitude will not be the zero * character. The following ASCII characters are used as digits: * @@ -107,9 +107,9 @@ public final class Integer extends Number implements Comparable { * {@code 0123456789abcdefghijklmnopqrstuvwxyz} *

    • * - * These are '\u0030' through - * '\u0039' and '\u0061' through - * '\u007A'. If {@code radix} is + * These are {@code '\u005Cu0030'} through + * {@code '\u005Cu0039'} and {@code '\u005Cu0061'} through + * {@code '\u005Cu007A'}. If {@code radix} is * N, then the first N of these characters * are used as radix-N digits in the order shown. Thus, * the digits for hexadecimal (radix 16) are @@ -170,7 +170,7 @@ public final class Integer extends Number implements Comparable { * value, no leading sign character is printed. * *

      If the magnitude is zero, it is represented by a single zero - * character {@code '0'} ('\u0030'); otherwise, + * character {@code '0'} ({@code '\u005Cu0030'}); otherwise, * the first character of the representation of the magnitude will * not be the zero character. * @@ -203,7 +203,7 @@ public final class Integer extends Number implements Comparable { * Integer.parseUnsignedInt(s, 16)}. * *

      If the unsigned magnitude is zero, it is represented by a - * single zero character {@code '0'} ('\u0030'); + * single zero character {@code '0'} ({@code '\u005Cu0030'}); * otherwise, the first character of the representation of the * unsigned magnitude will not be the zero character. The * following characters are used as hexadecimal digits: @@ -212,9 +212,9 @@ public final class Integer extends Number implements Comparable { * {@code 0123456789abcdef} *

    * - * These are the characters '\u0030' through - * '\u0039' and '\u0061' through - * '\u0066'. If uppercase letters are + * These are the characters {@code '\u005Cu0030'} through + * {@code '\u005Cu0039'} and {@code '\u005Cu0061'} through + * {@code '\u005Cu0066'}. If uppercase letters are * desired, the {@link java.lang.String#toUpperCase()} method may * be called on the result: * @@ -248,7 +248,7 @@ public final class Integer extends Number implements Comparable { * Integer.parseUnsignedInt(s, 8)}. * *

    If the unsigned magnitude is zero, it is represented by a - * single zero character {@code '0'} ('\u0030'); + * single zero character {@code '0'} ({@code '\u005Cu0030'}); * otherwise, the first character of the representation of the * unsigned magnitude will not be the zero character. The * following characters are used as octal digits: @@ -257,8 +257,8 @@ public final class Integer extends Number implements Comparable { * {@code 01234567} *

    * - * These are the characters '\u0030' through - * '\u0037'. + * These are the characters {@code '\u005Cu0030'} through + * {@code '\u005Cu0037'}. * * @param i an integer to be converted to a string. * @return the string representation of the unsigned integer value @@ -286,11 +286,11 @@ public final class Integer extends Number implements Comparable { * Integer.parseUnsignedInt(s, 2)}. * *

    If the unsigned magnitude is zero, it is represented by a - * single zero character {@code '0'} ('\u0030'); + * single zero character {@code '0'} ({@code '\u005Cu0030'}); * otherwise, the first character of the representation of the * unsigned magnitude will not be the zero character. The - * characters {@code '0'} ('\u0030') and {@code - * '1'} ('\u0031') are used as binary digits. + * characters {@code '0'} ({@code '\u005Cu0030'}) and {@code + * '1'} ({@code '\u005Cu0031'}) are used as binary digits. * * @param i an integer to be converted to a string. * @return the string representation of the unsigned integer value @@ -461,9 +461,9 @@ public final class Integer extends Number implements Comparable { * must all be digits of the specified radix (as determined by * whether {@link java.lang.Character#digit(char, int)} returns a * nonnegative value), except that the first character may be an - * ASCII minus sign {@code '-'} ('\u002D') to + * ASCII minus sign {@code '-'} ({@code '\u005Cu002D'}) to * indicate a negative value or an ASCII plus sign {@code '+'} - * ('\u002B') to indicate a positive value. The + * ({@code '\u005Cu002B'}) to indicate a positive value. The * resulting integer value is returned. * *

    An exception of type {@code NumberFormatException} is @@ -478,8 +478,8 @@ public final class Integer extends Number implements Comparable { * *

  • Any character of the string is not a digit of the specified * radix, except that the first character may be a minus sign - * {@code '-'} ('\u002D') or plus sign - * {@code '+'} ('\u002B') provided that the + * {@code '-'} ({@code '\u005Cu002D'}) or plus sign + * {@code '+'} ({@code '\u005Cu002B'}) provided that the * string is longer than length 1. * *
  • The value represented by the string is not a value of type @@ -579,8 +579,8 @@ public final class Integer extends Number implements Comparable { * Parses the string argument as a signed decimal integer. The * characters in the string must all be decimal digits, except * that the first character may be an ASCII minus sign {@code '-'} - * ('\u002D') to indicate a negative value or an - * ASCII plus sign {@code '+'} ('\u002B') to + * ({@code '\u005Cu002D'}) to indicate a negative value or an + * ASCII plus sign {@code '+'} ({@code '\u005Cu002B'}) to * indicate a positive value. The resulting integer value is * returned, exactly as if the argument and the radix 10 were * given as arguments to the {@link #parseInt(java.lang.String, @@ -606,7 +606,7 @@ public final class Integer extends Number implements Comparable { * specified radix (as determined by whether {@link * java.lang.Character#digit(char, int)} returns a nonnegative * value), except that the first character may be an ASCII plus - * sign {@code '+'} ('\u002B'). The resulting + * sign {@code '+'} ({@code '\u005Cu002B'}). The resulting * integer value is returned. * *

    An exception of type {@code NumberFormatException} is @@ -621,7 +621,7 @@ public final class Integer extends Number implements Comparable { * *

  • Any character of the string is not a digit of the specified * radix, except that the first character may be a plus sign - * {@code '+'} ('\u002B') provided that the + * {@code '+'} ({@code '\u005Cu002B'}) provided that the * string is longer than length 1. * *
  • The value represented by the string is larger than the @@ -676,7 +676,7 @@ public final class Integer extends Number implements Comparable { * Parses the string argument as an unsigned decimal integer. The * characters in the string must all be decimal digits, except * that the first character may be an an ASCII plus sign {@code - * '+'} ('\u002B'). The resulting integer value + * '+'} ({@code '\u005Cu002B'}). The resulting integer value * is returned, exactly as if the argument and the radix 10 were * given as arguments to the {@link * #parseUnsignedInt(java.lang.String, int)} method. diff --git a/jdk/src/share/classes/java/lang/Long.java b/jdk/src/share/classes/java/lang/Long.java index 2e23951ae3c..f4dc32dcdff 100644 --- a/jdk/src/share/classes/java/lang/Long.java +++ b/jdk/src/share/classes/java/lang/Long.java @@ -81,13 +81,13 @@ public final class Long extends Number implements Comparable { * *

    If the first argument is negative, the first element of the * result is the ASCII minus sign {@code '-'} - * ('\u002d'). If the first argument is not + * ({@code '\u005Cu002d'}). If the first argument is not * negative, no sign character appears in the result. * *

    The remaining characters of the result represent the magnitude * of the first argument. If the magnitude is zero, it is * represented by a single zero character {@code '0'} - * ('\u0030'); otherwise, the first character of + * ({@code '\u005Cu0030'}); otherwise, the first character of * the representation of the magnitude will not be the zero * character. The following ASCII characters are used as digits: * @@ -95,9 +95,9 @@ public final class Long extends Number implements Comparable { * {@code 0123456789abcdefghijklmnopqrstuvwxyz} *

  • * - * These are '\u0030' through - * '\u0039' and '\u0061' through - * '\u007a'. If {@code radix} is + * These are {@code '\u005Cu0030'} through + * {@code '\u005Cu0039'} and {@code '\u005Cu0061'} through + * {@code '\u005Cu007a'}. If {@code radix} is * N, then the first N of these characters * are used as radix-N digits in the order shown. Thus, * the digits for hexadecimal (radix 16) are @@ -154,7 +154,7 @@ public final class Long extends Number implements Comparable { * value, no leading sign character is printed. * *

    If the magnitude is zero, it is represented by a single zero - * character {@code '0'} ('\u0030'); otherwise, + * character {@code '0'} ({@code '\u005Cu0030'}); otherwise, * the first character of the representation of the magnitude will * not be the zero character. * @@ -239,7 +239,7 @@ public final class Long extends Number implements Comparable { * 16)}. * *

    If the unsigned magnitude is zero, it is represented by a - * single zero character {@code '0'} ('\u0030'); + * single zero character {@code '0'} ({@code '\u005Cu0030'}); * otherwise, the first character of the representation of the * unsigned magnitude will not be the zero character. The * following characters are used as hexadecimal digits: @@ -248,9 +248,9 @@ public final class Long extends Number implements Comparable { * {@code 0123456789abcdef} *

    * - * These are the characters '\u0030' through - * '\u0039' and '\u0061' through - * '\u0066'. If uppercase letters are desired, + * These are the characters {@code '\u005Cu0030'} through + * {@code '\u005Cu0039'} and {@code '\u005Cu0061'} through + * {@code '\u005Cu0066'}. If uppercase letters are desired, * the {@link java.lang.String#toUpperCase()} method may be called * on the result: * @@ -286,7 +286,7 @@ public final class Long extends Number implements Comparable { * 8)}. * *

    If the unsigned magnitude is zero, it is represented by a - * single zero character {@code '0'} ('\u0030'); + * single zero character {@code '0'} ({@code '\u005Cu0030'}); * otherwise, the first character of the representation of the * unsigned magnitude will not be the zero character. The * following characters are used as octal digits: @@ -295,8 +295,8 @@ public final class Long extends Number implements Comparable { * {@code 01234567} *

    * - * These are the characters '\u0030' through - * '\u0037'. + * These are the characters {@code '\u005Cu0030'} through + * {@code '\u005Cu0037'}. * * @param i a {@code long} to be converted to a string. * @return the string representation of the unsigned {@code long} @@ -325,11 +325,11 @@ public final class Long extends Number implements Comparable { * 2)}. * *

    If the unsigned magnitude is zero, it is represented by a - * single zero character {@code '0'} ('\u0030'); + * single zero character {@code '0'} ({@code '\u005Cu0030'}); * otherwise, the first character of the representation of the * unsigned magnitude will not be the zero character. The - * characters {@code '0'} ('\u0030') and {@code - * '1'} ('\u0031') are used as binary digits. + * characters {@code '0'} ({@code '\u005Cu0030'}) and {@code + * '1'} ({@code '\u005Cu0031'}) are used as binary digits. * * @param i a {@code long} to be converted to a string. * @return the string representation of the unsigned {@code long} @@ -467,14 +467,14 @@ public final class Long extends Number implements Comparable { * string must all be digits of the specified radix (as determined * by whether {@link java.lang.Character#digit(char, int)} returns * a nonnegative value), except that the first character may be an - * ASCII minus sign {@code '-'} ('\u002D') to + * ASCII minus sign {@code '-'} ({@code '\u005Cu002D'}) to * indicate a negative value or an ASCII plus sign {@code '+'} - * ('\u002B') to indicate a positive value. The + * ({@code '\u005Cu002B'}) to indicate a positive value. The * resulting {@code long} value is returned. * *

    Note that neither the character {@code L} - * ('\u004C') nor {@code l} - * ('\u006C') is permitted to appear at the end + * ({@code '\u005Cu004C'}) nor {@code l} + * ({@code '\u005Cu006C'}) is permitted to appear at the end * of the string as a type indicator, as would be permitted in * Java programming language source code - except that either * {@code L} or {@code l} may appear as a digit for a @@ -493,8 +493,8 @@ public final class Long extends Number implements Comparable { * *

  • Any character of the string is not a digit of the specified * radix, except that the first character may be a minus sign - * {@code '-'} ('\u002d') or plus sign {@code - * '+'} ('\u002B') provided that the string is + * {@code '-'} ({@code '\u005Cu002d'}) or plus sign {@code + * '+'} ({@code '\u005Cu002B'}) provided that the string is * longer than length 1. * *
  • The value represented by the string is not a value of type @@ -584,16 +584,16 @@ public final class Long extends Number implements Comparable { * Parses the string argument as a signed decimal {@code long}. * The characters in the string must all be decimal digits, except * that the first character may be an ASCII minus sign {@code '-'} - * (\u002D') to indicate a negative value or an - * ASCII plus sign {@code '+'} ('\u002B') to + * ({@code \u005Cu002D'}) to indicate a negative value or an + * ASCII plus sign {@code '+'} ({@code '\u005Cu002B'}) to * indicate a positive value. The resulting {@code long} value is * returned, exactly as if the argument and the radix {@code 10} * were given as arguments to the {@link * #parseLong(java.lang.String, int)} method. * *

    Note that neither the character {@code L} - * ('\u004C') nor {@code l} - * ('\u006C') is permitted to appear at the end + * ({@code '\u005Cu004C'}) nor {@code l} + * ({@code '\u005Cu006C'}) is permitted to appear at the end * of the string as a type indicator, as would be permitted in * Java programming language source code. * @@ -618,7 +618,7 @@ public final class Long extends Number implements Comparable { * specified radix (as determined by whether {@link * java.lang.Character#digit(char, int)} returns a nonnegative * value), except that the first character may be an ASCII plus - * sign {@code '+'} ('\u002B'). The resulting + * sign {@code '+'} ({@code '\u005Cu002B'}). The resulting * integer value is returned. * *

    An exception of type {@code NumberFormatException} is @@ -633,7 +633,7 @@ public final class Long extends Number implements Comparable { * *

  • Any character of the string is not a digit of the specified * radix, except that the first character may be a plus sign - * {@code '+'} ('\u002B') provided that the + * {@code '+'} ({@code '\u005Cu002B'}) provided that the * string is longer than length 1. * *
  • The value represented by the string is larger than the @@ -707,7 +707,7 @@ public final class Long extends Number implements Comparable { * Parses the string argument as an unsigned decimal {@code long}. The * characters in the string must all be decimal digits, except * that the first character may be an an ASCII plus sign {@code - * '+'} ('\u002B'). The resulting integer value + * '+'} ({@code '\u005Cu002B'}). The resulting integer value * is returned, exactly as if the argument and the radix 10 were * given as arguments to the {@link * #parseUnsignedLong(java.lang.String, int)} method. @@ -1148,8 +1148,8 @@ public final class Long extends Number implements Comparable { * * *

    Note that, in every case, neither {@code L} - * ('\u004C') nor {@code l} - * ('\u006C') is permitted to appear at the end + * ({@code '\u005Cu004C'}) nor {@code l} + * ({@code '\u005Cu006C'}) is permitted to appear at the end * of the property value as a type indicator, as would be * permitted in Java programming language source code. * diff --git a/jdk/src/share/classes/java/lang/Short.java b/jdk/src/share/classes/java/lang/Short.java index c2f93a9d1fb..2a1d8b5502d 100644 --- a/jdk/src/share/classes/java/lang/Short.java +++ b/jdk/src/share/classes/java/lang/Short.java @@ -80,8 +80,8 @@ public final class Short extends Number implements Comparable { * determined by whether {@link java.lang.Character#digit(char, * int)} returns a nonnegative value) except that the first * character may be an ASCII minus sign {@code '-'} - * ('\u002D') to indicate a negative value or an - * ASCII plus sign {@code '+'} ('\u002B') to + * ({@code '\u005Cu002D'}) to indicate a negative value or an + * ASCII plus sign {@code '+'} ({@code '\u005Cu002B'}) to * indicate a positive value. The resulting {@code short} value * is returned. * @@ -97,8 +97,8 @@ public final class Short extends Number implements Comparable { * *

  • Any character of the string is not a digit of the * specified radix, except that the first character may be a minus - * sign {@code '-'} ('\u002D') or plus sign - * {@code '+'} ('\u002B') provided that the + * sign {@code '-'} ({@code '\u005Cu002D'}) or plus sign + * {@code '+'} ({@code '\u005Cu002B'}) provided that the * string is longer than length 1. * *
  • The value represented by the string is not a value of type @@ -126,9 +126,9 @@ public final class Short extends Number implements Comparable { * Parses the string argument as a signed decimal {@code * short}. The characters in the string must all be decimal * digits, except that the first character may be an ASCII minus - * sign {@code '-'} ('\u002D') to indicate a + * sign {@code '-'} ({@code '\u005Cu002D'}) to indicate a * negative value or an ASCII plus sign {@code '+'} - * ('\u002B') to indicate a positive value. The + * ({@code '\u005Cu002B'}) to indicate a positive value. The * resulting {@code short} value is returned, exactly as if the * argument and the radix 10 were given as arguments to the {@link * #parseShort(java.lang.String, int)} method. diff --git a/jdk/src/share/classes/java/lang/String.java b/jdk/src/share/classes/java/lang/String.java index 50b3f7b6b48..79c71d119a5 100644 --- a/jdk/src/share/classes/java/lang/String.java +++ b/jdk/src/share/classes/java/lang/String.java @@ -39,8 +39,8 @@ import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; /** - * The String class represents character strings. All - * string literals in Java programs, such as "abc", are + * The {@code String} class represents character strings. All + * string literals in Java programs, such as {@code "abc"}, are * implemented as instances of this class. *

    * Strings are constant; their values cannot be changed after they @@ -63,7 +63,7 @@ import java.util.regex.PatternSyntaxException; * String d = cde.substring(1, 2); *

  • *

    - * The class String includes methods for examining + * The class {@code String} includes methods for examining * individual characters of the sequence, for comparing strings, for * searching strings, for extracting substrings, and for creating a * copy of a string with all characters translated to uppercase or to @@ -73,10 +73,10 @@ import java.util.regex.PatternSyntaxException; * The Java language provides special support for the string * concatenation operator ( + ), and for conversion of * other objects to strings. String concatenation is implemented - * through the StringBuilder(or StringBuffer) - * class and its append method. + * through the {@code StringBuilder}(or {@code StringBuffer}) + * class and its {@code append} method. * String conversions are implemented through the method - * toString, defined by Object and + * {@code toString}, defined by {@code Object} and * inherited by all classes in Java. For additional information on * string concatenation and conversion, see Gosling, Joy, and Steele, * The Java Language Specification. @@ -85,16 +85,16 @@ import java.util.regex.PatternSyntaxException; * or method in this class will cause a {@link NullPointerException} to be * thrown. * - *

    A String represents a string in the UTF-16 format + *

    A {@code String} represents a string in the UTF-16 format * in which supplementary characters are represented by surrogate * pairs (see the section Unicode - * Character Representations in the Character class for + * Character Representations in the {@code Character} class for * more information). - * Index values refer to char code units, so a supplementary - * character uses two positions in a String. - *

    The String class provides methods for dealing with + * Index values refer to {@code char} code units, so a supplementary + * character uses two positions in a {@code String}. + *

    The {@code String} class provides methods for dealing with * Unicode code points (i.e., characters), in addition to those for - * dealing with Unicode code units (i.e., char values). + * dealing with Unicode code units (i.e., {@code char} values). * * @author Lee Boynton * @author Arthur van Hoff @@ -131,9 +131,9 @@ public final class String * A String instance is written initially into an ObjectOutputStream in the * following format: *

    -     *      TC_STRING (utf String)
    +     *      {@code TC_STRING} (utf String)
          * 
    - * The String is written by method DataOutput.writeUTF. + * The String is written by method {@code DataOutput.writeUTF}. * A new handle is generated to refer to all future references to the * string instance within the stream. */ @@ -673,20 +673,20 @@ public final class String } /** - * Returns the char value at the - * specified index. An index ranges from 0 to - * length() - 1. The first char value of the sequence - * is at index 0, the next at index 1, + * Returns the {@code char} value at the + * specified index. An index ranges from {@code 0} to + * {@code length() - 1}. The first {@code char} value of the sequence + * is at index {@code 0}, the next at index {@code 1}, * and so on, as for array indexing. * - *

    If the char value specified by the index is a + *

    If the {@code char} value specified by the index is a * surrogate, the surrogate * value is returned. * - * @param index the index of the char value. - * @return the char value at the specified index of this string. - * The first char value is at index 0. - * @exception IndexOutOfBoundsException if the index + * @param index the index of the {@code char} value. + * @return the {@code char} value at the specified index of this string. + * The first {@code char} value is at index {@code 0}. + * @exception IndexOutOfBoundsException if the {@code index} * argument is negative or not less than the length of this * string. */ @@ -699,22 +699,22 @@ public final class String /** * Returns the character (Unicode code point) at the specified - * index. The index refers to char values - * (Unicode code units) and ranges from 0 to - * {@link #length()} - 1. + * index. The index refers to {@code char} values + * (Unicode code units) and ranges from {@code 0} to + * {@link #length()}{@code - 1}. * - *

    If the char value specified at the given index + *

    If the {@code char} value specified at the given index * is in the high-surrogate range, the following index is less - * than the length of this String, and the - * char value at the following index is in the + * than the length of this {@code String}, and the + * {@code char} value at the following index is in the * low-surrogate range, then the supplementary code point * corresponding to this surrogate pair is returned. Otherwise, - * the char value at the given index is returned. + * the {@code char} value at the given index is returned. * - * @param index the index to the char values + * @param index the index to the {@code char} values * @return the code point value of the character at the - * index - * @exception IndexOutOfBoundsException if the index + * {@code index} + * @exception IndexOutOfBoundsException if the {@code index} * argument is negative or not less than the length of this * string. * @since 1.5 @@ -728,22 +728,22 @@ public final class String /** * Returns the character (Unicode code point) before the specified - * index. The index refers to char values - * (Unicode code units) and ranges from 1 to {@link + * index. The index refers to {@code char} values + * (Unicode code units) and ranges from {@code 1} to {@link * CharSequence#length() length}. * - *

    If the char value at (index - 1) - * is in the low-surrogate range, (index - 2) is not - * negative, and the char value at (index - - * 2) is in the high-surrogate range, then the + *

    If the {@code char} value at {@code (index - 1)} + * is in the low-surrogate range, {@code (index - 2)} is not + * negative, and the {@code char} value at {@code (index - + * 2)} is in the high-surrogate range, then the * supplementary code point value of the surrogate pair is - * returned. If the char value at index - - * 1 is an unpaired low-surrogate or a high-surrogate, the + * returned. If the {@code char} value at {@code index - + * 1} is an unpaired low-surrogate or a high-surrogate, the * surrogate value is returned. * * @param index the index following the code point that should be returned * @return the Unicode code point value before the given index. - * @exception IndexOutOfBoundsException if the index + * @exception IndexOutOfBoundsException if the {@code index} * argument is less than 1 or greater than the length * of this string. * @since 1.5 @@ -758,23 +758,23 @@ public final class String /** * Returns the number of Unicode code points in the specified text - * range of this String. The text range begins at the - * specified beginIndex and extends to the - * char at index endIndex - 1. Thus the - * length (in chars) of the text range is - * endIndex-beginIndex. Unpaired surrogates within + * range of this {@code String}. The text range begins at the + * specified {@code beginIndex} and extends to the + * {@code char} at index {@code endIndex - 1}. Thus the + * length (in {@code char}s) of the text range is + * {@code endIndex-beginIndex}. Unpaired surrogates within * the text range count as one code point each. * - * @param beginIndex the index to the first char of + * @param beginIndex the index to the first {@code char} of * the text range. - * @param endIndex the index after the last char of + * @param endIndex the index after the last {@code char} of * the text range. * @return the number of Unicode code points in the specified text * range * @exception IndexOutOfBoundsException if the - * beginIndex is negative, or endIndex - * is larger than the length of this String, or - * beginIndex is larger than endIndex. + * {@code beginIndex} is negative, or {@code endIndex} + * is larger than the length of this {@code String}, or + * {@code beginIndex} is larger than {@code endIndex}. * @since 1.5 */ public int codePointCount(int beginIndex, int endIndex) { @@ -785,23 +785,23 @@ public final class String } /** - * Returns the index within this String that is - * offset from the given index by - * codePointOffset code points. Unpaired surrogates - * within the text range given by index and - * codePointOffset count as one code point each. + * Returns the index within this {@code String} that is + * offset from the given {@code index} by + * {@code codePointOffset} code points. Unpaired surrogates + * within the text range given by {@code index} and + * {@code codePointOffset} count as one code point each. * * @param index the index to be offset * @param codePointOffset the offset in code points - * @return the index within this String - * @exception IndexOutOfBoundsException if index + * @return the index within this {@code String} + * @exception IndexOutOfBoundsException if {@code index} * is negative or larger then the length of this - * String, or if codePointOffset is positive - * and the substring starting with index has fewer - * than codePointOffset code points, - * or if codePointOffset is negative and the substring - * before index has fewer than the absolute value - * of codePointOffset code points. + * {@code String}, or if {@code codePointOffset} is positive + * and the substring starting with {@code index} has fewer + * than {@code codePointOffset} code points, + * or if {@code codePointOffset} is negative and the substring + * before {@code index} has fewer than the absolute value + * of {@code codePointOffset} code points. * @since 1.5 */ public int offsetByCodePoints(int index, int codePointOffset) { @@ -824,11 +824,11 @@ public final class String * Copies characters from this string into the destination character * array. *

    - * The first character to be copied is at index srcBegin; - * the last character to be copied is at index srcEnd-1 + * The first character to be copied is at index {@code srcBegin}; + * the last character to be copied is at index {@code srcEnd-1} * (thus the total number of characters to be copied is - * srcEnd-srcBegin). The characters are copied into the - * subarray of dst starting at index dstBegin + * {@code srcEnd-srcBegin}). The characters are copied into the + * subarray of {@code dst} starting at index {@code dstBegin} * and ending at index: *

          *     dstbegin + (srcEnd-srcBegin) - 1
    @@ -842,13 +842,13 @@ public final class String
          * @param      dstBegin   the start offset in the destination array.
          * @exception IndexOutOfBoundsException If any of the following
          *            is true:
    -     *            
    • srcBegin is negative. - *
    • srcBegin is greater than srcEnd - *
    • srcEnd is greater than the length of this + *
      • {@code srcBegin} is negative. + *
      • {@code srcBegin} is greater than {@code srcEnd} + *
      • {@code srcEnd} is greater than the length of this * string - *
      • dstBegin is negative - *
      • dstBegin+(srcEnd-srcBegin) is larger than - * dst.length
      + *
    • {@code dstBegin} is negative + *
    • {@code dstBegin+(srcEnd-srcBegin)} is larger than + * {@code dst.length}
    */ public void getChars(int srcBegin, int srcEnd, char dst[], int dstBegin) { if (srcBegin < 0) { @@ -1135,14 +1135,14 @@ public final class String * Compares two strings lexicographically. * The comparison is based on the Unicode value of each character in * the strings. The character sequence represented by this - * String object is compared lexicographically to the + * {@code String} object is compared lexicographically to the * character sequence represented by the argument string. The result is - * a negative integer if this String object + * a negative integer if this {@code String} object * lexicographically precedes the argument string. The result is a - * positive integer if this String object lexicographically + * positive integer if this {@code String} object lexicographically * follows the argument string. The result is zero if the strings - * are equal; compareTo returns 0 exactly when - * the {@link #equals(Object)} method would return true. + * are equal; {@code compareTo} returns {@code 0} exactly when + * the {@link #equals(Object)} method would return {@code true}. *

    * This is the definition of lexicographic ordering. If two strings are * different, then either they have different characters at some index @@ -1151,25 +1151,25 @@ public final class String * positions, let k be the smallest such index; then the string * whose character at position k has the smaller value, as * determined by using the < operator, lexicographically precedes the - * other string. In this case, compareTo returns the - * difference of the two character values at position k in + * other string. In this case, {@code compareTo} returns the + * difference of the two character values at position {@code k} in * the two string -- that is, the value: *

          * this.charAt(k)-anotherString.charAt(k)
          * 
    * If there is no index position at which they differ, then the shorter * string lexicographically precedes the longer string. In this case, - * compareTo returns the difference of the lengths of the + * {@code compareTo} returns the difference of the lengths of the * strings -- that is, the value: *
          * this.length()-anotherString.length()
          * 
    * - * @param anotherString the String to be compared. - * @return the value 0 if the argument string is equal to - * this string; a value less than 0 if this string + * @param anotherString the {@code String} to be compared. + * @return the value {@code 0} if the argument string is equal to + * this string; a value less than {@code 0} if this string * is lexicographically less than the string argument; and a - * value greater than 0 if this string is + * value greater than {@code 0} if this string is * lexicographically greater than the string argument. */ public int compareTo(String anotherString) { @@ -1205,8 +1205,8 @@ public final class String } /** - * A Comparator that orders String objects as by - * compareToIgnoreCase. This comparator is serializable. + * A Comparator that orders {@code String} objects as by + * {@code compareToIgnoreCase}. This comparator is serializable. *

    * Note that this Comparator does not take locale into account, * and will result in an unsatisfactory ordering for certain locales. @@ -1253,9 +1253,9 @@ public final class String /** * Compares two strings lexicographically, ignoring case * differences. This method returns an integer whose sign is that of - * calling compareTo with normalized versions of the strings + * calling {@code compareTo} with normalized versions of the strings * where case differences have been eliminated by calling - * Character.toLowerCase(Character.toUpperCase(character)) on + * {@code Character.toLowerCase(Character.toUpperCase(character))} on * each character. *

    * Note that this method does not take locale into account, @@ -1263,7 +1263,7 @@ public final class String * The java.text package provides collators to allow * locale-sensitive ordering. * - * @param str the String to be compared. + * @param str the {@code String} to be compared. * @return a negative integer, zero, or a positive integer as the * specified String is greater than, equal to, or less * than this String, ignoring case considerations. @@ -1301,9 +1301,9 @@ public final class String * @param ooffset the starting offset of the subregion in the string * argument. * @param len the number of characters to compare. - * @return true if the specified subregion of this string + * @return {@code true} if the specified subregion of this string * exactly matches the specified subregion of the string argument; - * false otherwise. + * {@code false} otherwise. */ public boolean regionMatches(int toffset, String other, int ooffset, int len) { @@ -1360,7 +1360,7 @@ public final class String *

    * * - * @param ignoreCase if true, ignore case when comparing + * @param ignoreCase if {@code true}, ignore case when comparing * characters. * @param toffset the starting offset of the subregion in this * string. @@ -1368,10 +1368,10 @@ public final class String * @param ooffset the starting offset of the subregion in the string * argument. * @param len the number of characters to compare. - * @return true if the specified subregion of this string + * @return {@code true} if the specified subregion of this string * matches the specified subregion of the string argument; - * false otherwise. Whether the matching is exact - * or case insensitive depends on the ignoreCase + * {@code false} otherwise. Whether the matching is exact + * or case insensitive depends on the {@code ignoreCase} * argument. */ public boolean regionMatches(boolean ignoreCase, int toffset, @@ -1420,12 +1420,12 @@ public final class String * * @param prefix the prefix. * @param toffset where to begin looking in this string. - * @return true if the character sequence represented by the + * @return {@code true} if the character sequence represented by the * argument is a prefix of the substring of this object starting - * at index toffset; false otherwise. - * The result is false if toffset is + * at index {@code toffset}; {@code false} otherwise. + * The result is {@code false} if {@code toffset} is * negative or greater than the length of this - * String object; otherwise the result is the same + * {@code String} object; otherwise the result is the same * as the result of the expression *
          *          this.substring(toffset).startsWith(prefix)
    @@ -1453,12 +1453,12 @@ public final class String
          * Tests if this string starts with the specified prefix.
          *
          * @param   prefix   the prefix.
    -     * @return  true if the character sequence represented by the
    +     * @return  {@code true} if the character sequence represented by the
          *          argument is a prefix of the character sequence represented by
    -     *          this string; false otherwise.
    -     *          Note also that true will be returned if the
    +     *          this string; {@code false} otherwise.
    +     *          Note also that {@code true} will be returned if the
          *          argument is an empty string or is equal to this
    -     *          String object as determined by the
    +     *          {@code String} object as determined by the
          *          {@link #equals(Object)} method.
          * @since   1. 0
          */
    @@ -1470,11 +1470,11 @@ public final class String
          * Tests if this string ends with the specified suffix.
          *
          * @param   suffix   the suffix.
    -     * @return  true if the character sequence represented by the
    +     * @return  {@code true} if the character sequence represented by the
          *          argument is a suffix of the character sequence represented by
    -     *          this object; false otherwise. Note that the
    -     *          result will be true if the argument is the
    -     *          empty string or is equal to this String object
    +     *          this object; {@code false} otherwise. Note that the
    +     *          result will be {@code true} if the argument is the
    +     *          empty string or is equal to this {@code String} object
          *          as determined by the {@link #equals(Object)} method.
          */
         public boolean endsWith(String suffix) {
    @@ -1483,13 +1483,13 @@ public final class String
     
         /**
          * Returns a hash code for this string. The hash code for a
    -     * String object is computed as
    +     * {@code String} object is computed as
          * 
          * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
          * 
    - * using int arithmetic, where s[i] is the - * ith character of the string, n is the length of - * the string, and ^ indicates exponentiation. + * using {@code int} arithmetic, where {@code s[i]} is the + * ith character of the string, {@code n} is the length of + * the string, and {@code ^} indicates exponentiation. * (The hash value of the empty string is zero.) * * @return a hash code value for this object. @@ -1512,26 +1512,26 @@ public final class String /** * Returns the index within this string of the first occurrence of * the specified character. If a character with value - * ch occurs in the character sequence represented by - * this String object, then the index (in Unicode + * {@code ch} occurs in the character sequence represented by + * this {@code String} object, then the index (in Unicode * code units) of the first such occurrence is returned. For - * values of ch in the range from 0 to 0xFFFF + * values of {@code ch} in the range from 0 to 0xFFFF * (inclusive), this is the smallest value k such that: *
          * this.charAt(k) == ch
          * 
    - * is true. For other values of ch, it is the + * is true. For other values of {@code ch}, it is the * smallest value k such that: *
          * this.codePointAt(k) == ch
          * 
    * is true. In either case, if no such character occurs in this - * string, then -1 is returned. + * string, then {@code -1} is returned. * * @param ch a character (Unicode code point). * @return the index of the first occurrence of the character in the * character sequence represented by this object, or - * -1 if the character does not occur. + * {@code -1} if the character does not occur. */ public int indexOf(int ch) { return indexOf(ch, 0); @@ -1541,39 +1541,39 @@ public final class String * Returns the index within this string of the first occurrence of the * specified character, starting the search at the specified index. *

    - * If a character with value ch occurs in the - * character sequence represented by this String - * object at an index no smaller than fromIndex, then + * If a character with value {@code ch} occurs in the + * character sequence represented by this {@code String} + * object at an index no smaller than {@code fromIndex}, then * the index of the first such occurrence is returned. For values - * of ch in the range from 0 to 0xFFFF (inclusive), + * of {@code ch} in the range from 0 to 0xFFFF (inclusive), * this is the smallest value k such that: *

          * (this.charAt(k) == ch) && (k >= fromIndex)
          * 
    - * is true. For other values of ch, it is the + * is true. For other values of {@code ch}, it is the * smallest value k such that: *
          * (this.codePointAt(k) == ch) && (k >= fromIndex)
          * 
    * is true. In either case, if no such character occurs in this - * string at or after position fromIndex, then - * -1 is returned. + * string at or after position {@code fromIndex}, then + * {@code -1} is returned. * *

    - * There is no restriction on the value of fromIndex. If it + * There is no restriction on the value of {@code fromIndex}. If it * is negative, it has the same effect as if it were zero: this entire * string may be searched. If it is greater than the length of this * string, it has the same effect as if it were equal to the length of - * this string: -1 is returned. + * this string: {@code -1} is returned. * - *

    All indices are specified in char values + *

    All indices are specified in {@code char} values * (Unicode code units). * * @param ch a character (Unicode code point). * @param fromIndex the index to start the search from. * @return the index of the first occurrence of the character in the * character sequence represented by this object that is greater - * than or equal to fromIndex, or -1 + * than or equal to {@code fromIndex}, or {@code -1} * if the character does not occur. */ public int indexOf(int ch, int fromIndex) { @@ -1622,26 +1622,26 @@ public final class String /** * Returns the index within this string of the last occurrence of - * the specified character. For values of ch in the + * the specified character. For values of {@code ch} in the * range from 0 to 0xFFFF (inclusive), the index (in Unicode code * units) returned is the largest value k such that: *

          * this.charAt(k) == ch
          * 
    - * is true. For other values of ch, it is the + * is true. For other values of {@code ch}, it is the * largest value k such that: *
          * this.codePointAt(k) == ch
          * 
    * is true. In either case, if no such character occurs in this - * string, then -1 is returned. The - * String is searched backwards starting at the last + * string, then {@code -1} is returned. The + * {@code String} is searched backwards starting at the last * character. * * @param ch a character (Unicode code point). * @return the index of the last occurrence of the character in the * character sequence represented by this object, or - * -1 if the character does not occur. + * {@code -1} if the character does not occur. */ public int lastIndexOf(int ch) { return lastIndexOf(ch, count - 1); @@ -1650,27 +1650,27 @@ public final class String /** * Returns the index within this string of the last occurrence of * the specified character, searching backward starting at the - * specified index. For values of ch in the range + * specified index. For values of {@code ch} in the range * from 0 to 0xFFFF (inclusive), the index returned is the largest * value k such that: *
          * (this.charAt(k) == ch) && (k <= fromIndex)
          * 
    - * is true. For other values of ch, it is the + * is true. For other values of {@code ch}, it is the * largest value k such that: *
          * (this.codePointAt(k) == ch) && (k <= fromIndex)
          * 
    * is true. In either case, if no such character occurs in this - * string at or before position fromIndex, then - * -1 is returned. + * string at or before position {@code fromIndex}, then + * {@code -1} is returned. * - *

    All indices are specified in char values + *

    All indices are specified in {@code char} values * (Unicode code units). * * @param ch a character (Unicode code point). * @param fromIndex the index to start the search from. There is no - * restriction on the value of fromIndex. If it is + * restriction on the value of {@code fromIndex}. If it is * greater than or equal to the length of this string, it has * the same effect as if it were equal to one less than the * length of this string: this entire string may be searched. @@ -1678,7 +1678,7 @@ public final class String * -1 is returned. * @return the index of the last occurrence of the character in the * character sequence represented by this object that is less - * than or equal to fromIndex, or -1 + * than or equal to {@code fromIndex}, or {@code -1} * if the character does not occur before that point. */ public int lastIndexOf(int ch, int fromIndex) { @@ -1921,8 +1921,8 @@ public final class String * @param beginIndex the beginning index, inclusive. * @return the specified substring. * @exception IndexOutOfBoundsException if - * beginIndex is negative or larger than the - * length of this String object. + * {@code beginIndex} is negative or larger than the + * length of this {@code String} object. */ public String substring(int beginIndex) { return substring(beginIndex, count); @@ -1930,9 +1930,9 @@ public final class String /** * Returns a new string that is a substring of this string. The - * substring begins at the specified beginIndex and - * extends to the character at index endIndex - 1. - * Thus the length of the substring is endIndex-beginIndex. + * substring begins at the specified {@code beginIndex} and + * extends to the character at index {@code endIndex - 1}. + * Thus the length of the substring is {@code endIndex-beginIndex}. *

    * Examples: *

    @@ -1944,11 +1944,11 @@ public final class String
          * @param      endIndex     the ending index, exclusive.
          * @return     the specified substring.
          * @exception  IndexOutOfBoundsException  if the
    -     *             beginIndex is negative, or
    -     *             endIndex is larger than the length of
    -     *             this String object, or
    -     *             beginIndex is larger than
    -     *             endIndex.
    +     *             {@code beginIndex} is negative, or
    +     *             {@code endIndex} is larger than the length of
    +     *             this {@code String} object, or
    +     *             {@code beginIndex} is larger than
    +     *             {@code endIndex}.
          */
         public String substring(int beginIndex, int endIndex) {
             if (beginIndex < 0) {
    @@ -1999,11 +1999,11 @@ public final class String
         /**
          * Concatenates the specified string to the end of this string.
          * 

    - * If the length of the argument string is 0, then this - * String object is returned. Otherwise, a new - * String object is created, representing a character + * If the length of the argument string is {@code 0}, then this + * {@code String} object is returned. Otherwise, a new + * {@code String} object is created, representing a character * sequence that is the concatenation of the character sequence - * represented by this String object and the character + * represented by this {@code String} object and the character * sequence represented by the argument string.

    * Examples: *

    @@ -2011,8 +2011,8 @@ public final class String
          * "to".concat("get").concat("her") returns "together"
          * 
    * - * @param str the String that is concatenated to the end - * of this String. + * @param str the {@code String} that is concatenated to the end + * of this {@code String}. * @return a string that represents the concatenation of this object's * characters followed by the string argument's characters. */ @@ -2029,16 +2029,16 @@ public final class String /** * Returns a new string resulting from replacing all occurrences of - * oldChar in this string with newChar. + * {@code oldChar} in this string with {@code newChar}. *

    - * If the character oldChar does not occur in the - * character sequence represented by this String object, - * then a reference to this String object is returned. - * Otherwise, a new String object is created that + * If the character {@code oldChar} does not occur in the + * character sequence represented by this {@code String} object, + * then a reference to this {@code String} object is returned. + * Otherwise, a new {@code String} object is created that * represents a character sequence identical to the character sequence - * represented by this String object, except that every - * occurrence of oldChar is replaced by an occurrence - * of newChar. + * represented by this {@code String} object, except that every + * occurrence of {@code oldChar} is replaced by an occurrence + * of {@code newChar}. *

    * Examples: *

    @@ -2054,7 +2054,7 @@ public final class String
          * @param   oldChar   the old character.
          * @param   newChar   the new character.
          * @return  a string derived from this string by replacing every
    -     *          occurrence of oldChar with newChar.
    +     *          occurrence of {@code oldChar} with {@code newChar}.
          */
         public String replace(char oldChar, char newChar) {
             if (oldChar != newChar) {
    @@ -2119,8 +2119,8 @@ public final class String
          * sequence of char values.
          *
          * @param s the sequence to search for
    -     * @return true if this string contains s, false otherwise
    -     * @throws NullPointerException if s is null
    +     * @return true if this string contains {@code s}, false otherwise
    +     * @throws NullPointerException if {@code s} is {@code null}
          * @since 1.5
          */
         public boolean contains(CharSequence s) {
    @@ -2223,8 +2223,8 @@ public final class String
          * @param  target The sequence of char values to be replaced
          * @param  replacement The replacement sequence of char values
          * @return  The resulting string
    -     * @throws NullPointerException if target or
    -     *         replacement is null.
    +     * @throws NullPointerException if {@code target} or
    +     *         {@code replacement} is {@code null}.
          * @since 1.5
          */
         public String replace(CharSequence target, CharSequence replacement) {
    @@ -2407,11 +2407,11 @@ public final class String
         }
     
         /**
    -     * Converts all of the characters in this String to lower
    -     * case using the rules of the given Locale.  Case mapping is based
    +     * Converts all of the characters in this {@code String} to lower
    +     * case using the rules of the given {@code Locale}.  Case mapping is based
          * on the Unicode Standard version specified by the {@link java.lang.Character Character}
          * class. Since case mappings are not always 1:1 char mappings, the resulting
    -     * String may be a different length than the original String.
    +     * {@code String} may be a different length than the original {@code String}.
          * 

    * Examples of lowercase mappings are in the following table: *

  • @@ -2452,7 +2452,7 @@ public final class String *
    * * @param locale use the case transformation rules for this locale - * @return the String, converted to lowercase. + * @return the {@code String}, converted to lowercase. * @see java.lang.String#toLowerCase() * @see java.lang.String#toUpperCase() * @see java.lang.String#toUpperCase(Locale) @@ -2553,22 +2553,22 @@ public final class String } /** - * Converts all of the characters in this String to lower + * Converts all of the characters in this {@code String} to lower * case using the rules of the default locale. This is equivalent to calling - * toLowerCase(Locale.getDefault()). + * {@code toLowerCase(Locale.getDefault())}. *

    * Note: This method is locale sensitive, and may produce unexpected * results if used for strings that are intended to be interpreted locale * independently. * Examples are programming language identifiers, protocol keys, and HTML * tags. - * For instance, "TITLE".toLowerCase() in a Turkish locale - * returns "t\u005Cu0131tle", where '\u005Cu0131' is the + * For instance, {@code "TITLE".toLowerCase()} in a Turkish locale + * returns {@code "t\u005Cu0131tle"}, where '\u005Cu0131' is the * LATIN SMALL LETTER DOTLESS I character. * To obtain correct results for locale insensitive strings, use - * toLowerCase(Locale.ENGLISH). + * {@code toLowerCase(Locale.ENGLISH)}. *

    - * @return the String, converted to lowercase. + * @return the {@code String}, converted to lowercase. * @see java.lang.String#toLowerCase(Locale) */ public String toLowerCase() { @@ -2576,11 +2576,11 @@ public final class String } /** - * Converts all of the characters in this String to upper - * case using the rules of the given Locale. Case mapping is based + * Converts all of the characters in this {@code String} to upper + * case using the rules of the given {@code Locale}. Case mapping is based * on the Unicode Standard version specified by the {@link java.lang.Character Character} * class. Since case mappings are not always 1:1 char mappings, the resulting - * String may be a different length than the original String. + * {@code String} may be a different length than the original {@code String}. *

    * Examples of locale-sensitive and 1:M case mappings are in the following table. *

    @@ -2617,7 +2617,7 @@ public final class String * * * @param locale use the case transformation rules for this locale - * @return the String, converted to uppercase. + * @return the {@code String}, converted to uppercase. * @see java.lang.String#toUpperCase() * @see java.lang.String#toLowerCase() * @see java.lang.String#toLowerCase(Locale) @@ -2716,22 +2716,22 @@ public final class String } /** - * Converts all of the characters in this String to upper + * Converts all of the characters in this {@code String} to upper * case using the rules of the default locale. This method is equivalent to - * toUpperCase(Locale.getDefault()). + * {@code toUpperCase(Locale.getDefault())}. *

    * Note: This method is locale sensitive, and may produce unexpected * results if used for strings that are intended to be interpreted locale * independently. * Examples are programming language identifiers, protocol keys, and HTML * tags. - * For instance, "title".toUpperCase() in a Turkish locale - * returns "T\u005Cu0130TLE", where '\u005Cu0130' is the + * For instance, {@code "title".toUpperCase()} in a Turkish locale + * returns {@code "T\u005Cu0130TLE"}, where '\u005Cu0130' is the * LATIN CAPITAL LETTER I WITH DOT ABOVE character. * To obtain correct results for locale insensitive strings, use - * toUpperCase(Locale.ENGLISH). + * {@code toUpperCase(Locale.ENGLISH)}. *

    - * @return the String, converted to uppercase. + * @return the {@code String}, converted to uppercase. * @see java.lang.String#toUpperCase(Locale) */ public String toUpperCase() { @@ -2742,21 +2742,21 @@ public final class String * Returns a copy of the string, with leading and trailing whitespace * omitted. *

    - * If this String object represents an empty character + * If this {@code String} object represents an empty character * sequence, or the first and last characters of character sequence - * represented by this String object both have codes - * greater than '\u0020' (the space character), then a - * reference to this String object is returned. + * represented by this {@code String} object both have codes + * greater than {@code '\u005Cu0020'} (the space character), then a + * reference to this {@code String} object is returned. *

    * Otherwise, if there is no character with a code greater than - * '\u0020' in the string, then a new - * String object representing an empty string is created + * {@code '\u005Cu0020'} in the string, then a new + * {@code String} object representing an empty string is created * and returned. *

    * Otherwise, let k be the index of the first character in the - * string whose code is greater than '\u0020', and let + * string whose code is greater than {@code '\u005Cu0020'}, and let * m be the index of the last character in the string whose code - * is greater than '\u0020'. A new String + * is greater than {@code '\u005Cu0020'}. A new {@code String} * object is created, representing the substring of this string that * begins with the character at index k and ends with the * character at index m-that is, the result of @@ -2893,12 +2893,12 @@ public final class String } /** - * Returns the string representation of the Object argument. + * Returns the string representation of the {@code Object} argument. * - * @param obj an Object. - * @return if the argument is null, then a string equal to - * "null"; otherwise, the value of - * obj.toString() is returned. + * @param obj an {@code Object}. + * @return if the argument is {@code null}, then a string equal to + * {@code "null"}; otherwise, the value of + * {@code obj.toString()} is returned. * @see java.lang.Object#toString() */ public static String valueOf(Object obj) { @@ -2906,12 +2906,12 @@ public final class String } /** - * Returns the string representation of the char array + * Returns the string representation of the {@code char} array * argument. The contents of the character array are copied; subsequent * modification of the character array does not affect the newly * created string. * - * @param data a char array. + * @param data a {@code char} array. * @return a newly allocated string representing the same sequence of * characters contained in the character array argument. */ @@ -2921,24 +2921,24 @@ public final class String /** * Returns the string representation of a specific subarray of the - * char array argument. + * {@code char} array argument. *

    - * The offset argument is the index of the first - * character of the subarray. The count argument + * The {@code offset} argument is the index of the first + * character of the subarray. The {@code count} argument * specifies the length of the subarray. The contents of the subarray * are copied; subsequent modification of the character array does not * affect the newly created string. * * @param data the character array. * @param offset the initial offset into the value of the - * String. - * @param count the length of the value of the String. + * {@code String}. + * @param count the length of the value of the {@code String}. * @return a string representing the sequence of characters contained * in the subarray of the character array argument. - * @exception IndexOutOfBoundsException if offset is - * negative, or count is negative, or - * offset+count is larger than - * data.length. + * @exception IndexOutOfBoundsException if {@code offset} is + * negative, or {@code count} is negative, or + * {@code offset+count} is larger than + * {@code data.length}. */ public static String valueOf(char data[], int offset, int count) { return new String(data, offset, count); @@ -2951,7 +2951,7 @@ public final class String * @param data the character array. * @param offset initial offset of the subarray. * @param count length of the subarray. - * @return a String that contains the characters of the + * @return a {@code String} that contains the characters of the * specified subarray of the character array. */ public static String copyValueOf(char data[], int offset, int count) { @@ -2964,7 +2964,7 @@ public final class String * array specified. * * @param data the character array. - * @return a String that contains the characters of the + * @return a {@code String} that contains the characters of the * character array. */ public static String copyValueOf(char data[]) { @@ -2972,24 +2972,24 @@ public final class String } /** - * Returns the string representation of the boolean argument. + * Returns the string representation of the {@code boolean} argument. * - * @param b a boolean. - * @return if the argument is true, a string equal to - * "true" is returned; otherwise, a string equal to - * "false" is returned. + * @param b a {@code boolean}. + * @return if the argument is {@code true}, a string equal to + * {@code "true"} is returned; otherwise, a string equal to + * {@code "false"} is returned. */ public static String valueOf(boolean b) { return b ? "true" : "false"; } /** - * Returns the string representation of the char + * Returns the string representation of the {@code char} * argument. * - * @param c a char. - * @return a string of length 1 containing - * as its single character the argument c. + * @param c a {@code char}. + * @return a string of length {@code 1} containing + * as its single character the argument {@code c}. */ public static String valueOf(char c) { char data[] = {c}; @@ -2997,13 +2997,13 @@ public final class String } /** - * Returns the string representation of the int argument. + * Returns the string representation of the {@code int} argument. *

    * The representation is exactly the one returned by the - * Integer.toString method of one argument. + * {@code Integer.toString} method of one argument. * - * @param i an int. - * @return a string representation of the int argument. + * @param i an {@code int}. + * @return a string representation of the {@code int} argument. * @see java.lang.Integer#toString(int, int) */ public static String valueOf(int i) { @@ -3011,13 +3011,13 @@ public final class String } /** - * Returns the string representation of the long argument. + * Returns the string representation of the {@code long} argument. *

    * The representation is exactly the one returned by the - * Long.toString method of one argument. + * {@code Long.toString} method of one argument. * - * @param l a long. - * @return a string representation of the long argument. + * @param l a {@code long}. + * @return a string representation of the {@code long} argument. * @see java.lang.Long#toString(long) */ public static String valueOf(long l) { @@ -3025,13 +3025,13 @@ public final class String } /** - * Returns the string representation of the float argument. + * Returns the string representation of the {@code float} argument. *

    * The representation is exactly the one returned by the - * Float.toString method of one argument. + * {@code Float.toString} method of one argument. * - * @param f a float. - * @return a string representation of the float argument. + * @param f a {@code float}. + * @return a string representation of the {@code float} argument. * @see java.lang.Float#toString(float) */ public static String valueOf(float f) { @@ -3039,13 +3039,13 @@ public final class String } /** - * Returns the string representation of the double argument. + * Returns the string representation of the {@code double} argument. *

    * The representation is exactly the one returned by the - * Double.toString method of one argument. + * {@code Double.toString} method of one argument. * - * @param d a double. - * @return a string representation of the double argument. + * @param d a {@code double}. + * @return a string representation of the {@code double} argument. * @see java.lang.Double#toString(double) */ public static String valueOf(double d) { @@ -3056,17 +3056,17 @@ public final class String * Returns a canonical representation for the string object. *

    * A pool of strings, initially empty, is maintained privately by the - * class String. + * class {@code String}. *

    * When the intern method is invoked, if the pool already contains a - * string equal to this String object as determined by + * string equal to this {@code String} object as determined by * the {@link #equals(Object)} method, then the string from the pool is - * returned. Otherwise, this String object is added to the - * pool and a reference to this String object is returned. + * returned. Otherwise, this {@code String} object is added to the + * pool and a reference to this {@code String} object is returned. *

    - * It follows that for any two strings s and t, - * s.intern() == t.intern() is true - * if and only if s.equals(t) is true. + * It follows that for any two strings {@code s} and {@code t}, + * {@code s.intern() == t.intern()} is {@code true} + * if and only if {@code s.equals(t)} is {@code true}. *

    * All literal strings and string-valued constant expressions are * interned. String literals are defined in section 3.10.5 of the diff --git a/jdk/src/share/classes/java/util/Properties.java b/jdk/src/share/classes/java/util/Properties.java index 1cd19a0e40e..7c7e13b6a9d 100644 --- a/jdk/src/share/classes/java/util/Properties.java +++ b/jdk/src/share/classes/java/util/Properties.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,8 +37,8 @@ import java.io.BufferedWriter; import java.lang.reflect.*; /** - * The Properties class represents a persistent set of - * properties. The Properties can be saved to a stream + * The {@code Properties} class represents a persistent set of + * properties. The {@code Properties} can be saved to a stream * or loaded from a stream. Each key and its corresponding value in * the property list is a string. *

    @@ -46,17 +46,17 @@ import java.lang.reflect.*; * "defaults"; this second property list is searched if * the property key is not found in the original property list. *

    - * Because Properties inherits from Hashtable, the - * put and putAll methods can be applied to a - * Properties object. Their use is strongly discouraged as they + * Because {@code Properties} inherits from {@code Hashtable}, the + * {@code put} and {@code putAll} methods can be applied to a + * {@code Properties} object. Their use is strongly discouraged as they * allow the caller to insert entries whose keys or values are not - * Strings. The setProperty method should be used - * instead. If the store or save method is called - * on a "compromised" Properties object that contains a - * non-String key or value, the call will fail. Similarly, - * the call to the propertyNames or list method - * will fail if it is called on a "compromised" Properties - * object that contains a non-String key. + * {@code Strings}. The {@code setProperty} method should be used + * instead. If the {@code store} or {@code save} method is called + * on a "compromised" {@code Properties} object that contains a + * non-{@code String} key or value, the call will fail. Similarly, + * the call to the {@code propertyNames} or {@code list} method + * will fail if it is called on a "compromised" {@code Properties} + * object that contains a non-{@code String} key. * *

    * The {@link #load(java.io.Reader) load(Reader)} / @@ -146,15 +146,15 @@ class Properties extends Hashtable { } /** - * Calls the Hashtable method put. Provided for + * Calls the Hashtable method {@code put}. Provided for * parallelism with the getProperty method. Enforces use of * strings for property keys and values. The value returned is the - * result of the Hashtable call to put. + * result of the Hashtable call to {@code put}. * * @param key the key to be placed into this property list. * @param value the value corresponding to key. * @return the previous value of the specified key in this property - * list, or null if it did not have one. + * list, or {@code null} if it did not have one. * @see #getProperty * @since 1.2 */ @@ -171,13 +171,13 @@ class Properties extends Hashtable { * kinds of line, natural lines and logical lines. * A natural line is defined as a line of * characters that is terminated either by a set of line terminator - * characters (\n or \r or \r\n) + * characters ({@code \n} or {@code \r} or {@code \r\n}) * or by the end of the stream. A natural line may be either a blank line, * a comment line, or hold all or some of a key-element pair. A logical * line holds all the data of a key-element pair, which may be spread * out across several adjacent natural lines by escaping * the line terminator sequence with a backslash character - * \. Note that a comment line cannot be extended + * {@code \}. Note that a comment line cannot be extended * in this manner; every natural line that is a comment must have * its own comment indicator, as described below. Lines are read from * input until the end of the stream is reached. @@ -185,13 +185,13 @@ class Properties extends Hashtable { *

    * A natural line that contains only white space characters is * considered blank and is ignored. A comment line has an ASCII - * '#' or '!' as its first non-white + * {@code '#'} or {@code '!'} as its first non-white * space character; comment lines are also ignored and do not * encode key-element information. In addition to line * terminators, this format considers the characters space - * (' ', '\u0020'), tab - * ('\t', '\u0009'), and form feed - * ('\f', '\u000C') to be white + * ({@code ' '}, {@code '\u005Cu0020'}), tab + * ({@code '\t'}, {@code '\u005Cu0009'}), and form feed + * ({@code '\f'}, {@code '\u005Cu000C'}) to be white * space. * *

    @@ -215,31 +215,31 @@ class Properties extends Hashtable { *

    * The key contains all of the characters in the line starting * with the first non-white space character and up to, but not - * including, the first unescaped '=', - * ':', or white space character other than a line + * including, the first unescaped {@code '='}, + * {@code ':'}, or white space character other than a line * terminator. All of these key termination characters may be * included in the key by escaping them with a preceding backslash * character; for example,

    * - * \:\=

    + * {@code \:\=}

    * - * would be the two-character key ":=". Line - * terminator characters can be included using \r and - * \n escape sequences. Any white space after the + * would be the two-character key {@code ":="}. Line + * terminator characters can be included using {@code \r} and + * {@code \n} escape sequences. Any white space after the * key is skipped; if the first non-white space character after - * the key is '=' or ':', then it is + * the key is {@code '='} or {@code ':'}, then it is * ignored and any white space characters after it are also * skipped. All remaining characters on the line become part of * the associated element string; if there are no remaining * characters, the element is the empty string - * "". Once the raw character sequences + * {@code ""}. Once the raw character sequences * constituting the key and element are identified, escape * processing is performed as described above. * *

    * As an example, each of the following three lines specifies the key - * "Truth" and the associated element value - * "Beauty": + * {@code "Truth"} and the associated element value + * {@code "Beauty"}: *

    *

          * Truth = Beauty
    @@ -254,11 +254,11 @@ class Properties extends Hashtable {
          *                                  cantaloupe, watermelon, \
          *                                  kiwi, mango
          * 
    - * The key is "fruits" and the associated element is: + * The key is {@code "fruits"} and the associated element is: *

    *

    "apple, banana, pear, cantaloupe, watermelon, kiwi, mango"
    - * Note that a space appears before each \ so that a space - * will appear after each comma in the final result; the \, + * Note that a space appears before each {@code \} so that a space + * will appear after each comma in the final result; the {@code \}, * line terminator, and leading white space on the continuation line are * merely discarded and are not replaced by one or more other * characters. @@ -267,8 +267,8 @@ class Properties extends Hashtable { *

    *

    cheeses
          * 
    - * specifies that the key is "cheeses" and the associated - * element is the empty string "".

    + * specifies that the key is {@code "cheeses"} and the associated + * element is the empty string {@code ""}.

    *

    * * @@ -283,17 +283,17 @@ class Properties extends Hashtable { *

      *
    • Octal escapes are not recognized. * - *
    • The character sequence \b does not + *
    • The character sequence {@code \b} does not * represent a backspace character. * *
    • The method does not treat a backslash character, - * \, before a non-valid escape character as an + * {@code \}, before a non-valid escape character as an * error; the backslash is silently dropped. For example, in a - * Java string the sequence "\z" would cause a + * Java string the sequence {@code "\z"} would cause a * compile time error. In contrast, this method silently drops * the backslash. Therefore, this method treats the two character - * sequence "\b" as equivalent to the single - * character 'b'. + * sequence {@code "\b"} as equivalent to the single + * character {@code 'b'}. * *
    • Escapes are not necessary for single and double quotes; * however, by the rule above, single and double quote characters @@ -689,20 +689,20 @@ class Properties extends Hashtable { } /** - * Calls the store(OutputStream out, String comments) method + * Calls the {@code store(OutputStream out, String comments)} method * and suppresses IOExceptions that were thrown. * * @deprecated This method does not throw an IOException if an I/O error * occurs while saving the property list. The preferred way to save a - * properties list is via the store(OutputStream out, - * String comments) method or the - * storeToXML(OutputStream os, String comment) method. + * properties list is via the {@code store(OutputStream out, + * String comments)} method or the + * {@code storeToXML(OutputStream os, String comment)} method. * * @param out an output stream. * @param comments a description of the property list. - * @exception ClassCastException if this Properties object + * @exception ClassCastException if this {@code Properties} object * contains any keys or values that are not - * Strings. + * {@code Strings}. */ @Deprecated public void save(OutputStream out, String comments) { @@ -714,37 +714,37 @@ class Properties extends Hashtable { /** * Writes this property list (key and element pairs) in this - * Properties table to the output character stream in a + * {@code Properties} table to the output character stream in a * format suitable for using the {@link #load(java.io.Reader) load(Reader)} * method. *

      - * Properties from the defaults table of this Properties + * Properties from the defaults table of this {@code Properties} * table (if any) are not written out by this method. *

      - * If the comments argument is not null, then an ASCII # + * If the comments argument is not null, then an ASCII {@code #} * character, the comments string, and a line separator are first written - * to the output stream. Thus, the comments can serve as an + * to the output stream. Thus, the {@code comments} can serve as an * identifying comment. Any one of a line feed ('\n'), a carriage * return ('\r'), or a carriage return followed immediately by a line feed - * in comments is replaced by a line separator generated by the Writer - * and if the next character in comments is not character # or - * character ! then an ASCII # is written out + * in comments is replaced by a line separator generated by the {@code Writer} + * and if the next character in comments is not character {@code #} or + * character {@code !} then an ASCII {@code #} is written out * after that line separator. *

      * Next, a comment line is always written, consisting of an ASCII - * # character, the current date and time (as if produced - * by the toString method of Date for the - * current time), and a line separator as generated by the Writer. + * {@code #} character, the current date and time (as if produced + * by the {@code toString} method of {@code Date} for the + * current time), and a line separator as generated by the {@code Writer}. *

      - * Then every entry in this Properties table is + * Then every entry in this {@code Properties} table is * written out, one per line. For each entry the key string is - * written, then an ASCII =, then the associated + * written, then an ASCII {@code =}, then the associated * element string. For the key, all space characters are - * written with a preceding \ character. For the + * written with a preceding {@code \} character. For the * element, leading space characters, but not embedded or trailing - * space characters, are written with a preceding \ - * character. The key and element characters #, - * !, =, and : are written + * space characters, are written with a preceding {@code \} + * character. The key and element characters {@code #}, + * {@code !}, {@code =}, and {@code :} are written * with a preceding backslash to ensure that they are properly loaded. *

      * After the entries have been written, the output stream is flushed. @@ -755,9 +755,9 @@ class Properties extends Hashtable { * @param comments a description of the property list. * @exception IOException if writing this property list to the specified * output stream throws an IOException. - * @exception ClassCastException if this Properties object - * contains any keys or values that are not Strings. - * @exception NullPointerException if writer is null. + * @exception ClassCastException if this {@code Properties} object + * contains any keys or values that are not {@code Strings}. + * @exception NullPointerException if {@code writer} is null. * @since 1.6 */ public void store(Writer writer, String comments) @@ -771,11 +771,11 @@ class Properties extends Hashtable { /** * Writes this property list (key and element pairs) in this - * Properties table to the output stream in a format suitable - * for loading into a Properties table using the + * {@code Properties} table to the output stream in a format suitable + * for loading into a {@code Properties} table using the * {@link #load(InputStream) load(InputStream)} method. *

      - * Properties from the defaults table of this Properties + * Properties from the defaults table of this {@code Properties} * table (if any) are not written out by this method. *

      * This method outputs the comments, properties keys and values in @@ -786,12 +786,12 @@ class Properties extends Hashtable { *

    • The stream is written using the ISO 8859-1 character encoding. * *
    • Characters not in Latin-1 in the comments are written as - * \uxxxx for their appropriate unicode + * {@code \u005Cu}xxxx for their appropriate unicode * hexadecimal value xxxx. * - *
    • Characters less than \u0020 and characters greater - * than \u007E in property keys or values are written - * as \uxxxx for the appropriate hexadecimal + *
    • Characters less than {@code \u005Cu0020} and characters greater + * than {@code \u005Cu007E} in property keys or values are written + * as {@code \u005Cu}xxxx for the appropriate hexadecimal * value xxxx. *
    *

    @@ -802,9 +802,9 @@ class Properties extends Hashtable { * @param comments a description of the property list. * @exception IOException if writing this property list to the specified * output stream throws an IOException. - * @exception ClassCastException if this Properties object - * contains any keys or values that are not Strings. - * @exception NullPointerException if out is null. + * @exception ClassCastException if this {@code Properties} object + * contains any keys or values that are not {@code Strings}. + * @exception NullPointerException if {@code out} is null. * @since 1.2 */ public void store(OutputStream out, String comments) @@ -857,7 +857,7 @@ class Properties extends Hashtable { * results in an IOException. * @throws InvalidPropertiesFormatException Data on input stream does not * constitute a valid XML document with the mandated document type. - * @throws NullPointerException if in is null. + * @throws NullPointerException if {@code in} is null. * @see #storeToXML(OutputStream, String, String) * @since 1.5 */ @@ -879,14 +879,14 @@ class Properties extends Hashtable { * props.storeToXML(os, comment, "UTF-8");. * * @param os the output stream on which to emit the XML document. - * @param comment a description of the property list, or null + * @param comment a description of the property list, or {@code null} * if no comment is desired. * @throws IOException if writing to the specified output stream * results in an IOException. - * @throws NullPointerException if os is null. - * @throws ClassCastException if this Properties object + * @throws NullPointerException if {@code os} is null. + * @throws ClassCastException if this {@code Properties} object * contains any keys or values that are not - * Strings. + * {@code Strings}. * @see #loadFromXML(InputStream) * @since 1.5 */ @@ -907,13 +907,13 @@ class Properties extends Hashtable { * <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> * * - *

    If the specified comment is null then no comment + *

    If the specified comment is {@code null} then no comment * will be stored in the document. * *

    The specified stream remains open after this method returns. * * @param os the output stream on which to emit the XML document. - * @param comment a description of the property list, or null + * @param comment a description of the property list, or {@code null} * if no comment is desired. * @param encoding the name of a supported * @@ -921,11 +921,11 @@ class Properties extends Hashtable { * * @throws IOException if writing to the specified output stream * results in an IOException. - * @throws NullPointerException if os is null, - * or if encoding is null. - * @throws ClassCastException if this Properties object + * @throws NullPointerException if {@code os} is {@code null}, + * or if {@code encoding} is {@code null}. + * @throws ClassCastException if this {@code Properties} object * contains any keys or values that are not - * Strings. + * {@code Strings}. * @see #loadFromXML(InputStream) * @since 1.5 */ @@ -941,7 +941,7 @@ class Properties extends Hashtable { * Searches for the property with the specified key in this property list. * If the key is not found in this property list, the default property list, * and its defaults, recursively, are then checked. The method returns - * null if the property is not found. + * {@code null} if the property is not found. * * @param key the property key. * @return the value in this property list with the specified key value.