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; ** *
- *charvalues 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: * **- *
* @param locale use the case transformation rules for this locale - * @return theThe 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 ofb. + * 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
IOExceptionother - * thanEOFExceptionis thrown. + * which case an {@code IOException} other + * than {@code EOFException} is thrown. *- * If
bisnull, - * aNullPointerExceptionis thrown. - * Ifb.lengthis 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 elementb[0], - * the next one intob[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 ofbhave 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 { /** * - * Readslen+ * Reads {@code len} * bytes from * an input stream. *@@ -244,32 +244,32 @@ interface DataInput { * blocks until one of the following conditions * occurs:
*
- *
*lenbytes + *- {@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
IOExceptionother - * thanEOFExceptionis thrown. + * which case an {@code IOException} other + * than {@code EOFException} is thrown. *- * If
bisnull, - * aNullPointerExceptionis thrown. - * Ifoffis negative, orlen- * is negative, oroff+lenis - * greater than the length of the arrayb, - * then anIndexOutOfBoundsException+ * 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. - * Iflenis zero, + * If {@code len} is zero, * then no bytes are read. Otherwise, the first - * byte read is stored into elementb[off], - * the next one intob[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 tolen. + * 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 - *nbytes + * {@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 beforenbytes + * end of file before {@code n} bytes * have been skipped is * only one possibility. - * This method never throws anEOFException. + * 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 - *trueif that byte is nonzero, - *falseif 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 thewriteBoolean- * method of interfaceDataOutput. + * the byte written by the {@code writeBoolean} + * method of interface {@code DataOutput}. * - * @return thebooleanvalue 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-128through127, + * the range {@code -128} through {@code 127}, * inclusive. * This method is suitable for - * reading the byte written by thewriteByte- * method of interfaceDataOutput. + * 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 typeint, and returns + * it to type {@code int}, and returns * the result, which is therefore in the range - *0- * through255. + * {@code 0} + * through {@code 255}. * This method is suitable for reading - * the byte written by thewriteByte- * method of interfaceDataOutput- * if the argument towriteByte+ * 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 - *0through255. + * {@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 - * ashortvalue. Leta- * be the first byte read andb+ * 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 thewriteShortmethod of - * interfaceDataOutput. + * 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 - * anintvalue in the range0- * through65535. Leta+ * 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: ** This method is suitable for reading the bytes - * written by the(((a & 0xff) << 8) | (b & 0xff)) *writeShortmethod - * of interfaceDataOutputif - * the argument towriteShort+ * 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 - *0through65535. + * {@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 acharvalue. - * Leta- * be the first byte read andb+ * 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: ** This method * is suitable for reading bytes written by - * the(char)((a << 8) | (b & 0xff)) *writeCharmethod of interface - *DataOutput. + * the {@code writeChar} method of interface + * {@code DataOutput}. * - * @return thecharvalue 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 - *intvalue. Leta-d+ * {@code int} value. Let {@code a-d} * be the first through fourth bytes read. The value returned is: - *- ** * - * @param ignoreCase if+ ** This method is suitable - * for reading bytes written by the* (((a & 0xff) << 24) | ((b & 0xff) << 16) | * ((c & 0xff) << 8) | (d & 0xff)) *writeInt- * method of interfaceDataOutput. + * for reading bytes written by the {@code writeInt} + * method of interface {@code DataOutput}. * - * @return theintvalue 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 - * alongvalue. Leta-h+ * a {@code long} value. Let {@code a-h} * be the first through eighth bytes read. * The value returned is: - **+ *position** (((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 interfaceDataOutput. + * for reading bytes written by the {@code writeLong} + * method of interface {@code DataOutput}. * - * @return thelongvalue 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 - * afloatvalue. It does this - * by first constructing anint+ * a {@code float} value. It does this + * by first constructing an {@code int} * value in exactly the manner - * of thereadInt- * method, then converting thisint- * value to afloatin - * exactly the manner of the methodFloat.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 thewriteFloat- * method of interfaceDataOutput. + * bytes written by the {@code writeFloat} + * method of interface {@code DataOutput}. * - * @return thefloatvalue 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 - * adoublevalue. It does this - * by first constructing along+ * a {@code double} value. It does this + * by first constructing a {@code long} * value in exactly the manner - * of thereadlong- * method, then converting thislong- * value to adoublein exactly - * the manner of the methodDouble.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 thewriteDouble- * method of interfaceDataOutput. + * bytes written by the {@code writeDouble} + * method of interface {@code DataOutput}. * - * @return thedoublevalue 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 aString. 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 typechar- * 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, aString+ * 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, - * ornullif 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 ofreadUTF+ * 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 aString. + * 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- * (wherexmeans "may be0- * or1"), 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 bytea- * and a second byteb. If there - * is no byteb(because byte - *awas the last of the bytes - * to be read), or if bytebdoes - * not match the bit pattern10xxxxxx, - * then aUTFDataFormatException+ * 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:*
* If the first byte of a group - * matches the bit pattern(char)(((a& 0x1F) << 6) | (b & 0x3F)) *1110xxxx, - * then the group consists of that bytea- * and two more bytesbandc. - * If there is no bytec(because - * byteawas 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 - * bytebor bytec- * does not match the bit pattern10xxxxxx, - * then aUTFDataFormatException+ * 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:*
* If the first byte of a group matches the - * pattern* (char)(((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F)) *1111xxxxor the pattern - *10xxxxxx, then aUTFDataFormatException+ * 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
EOFExceptionis 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 interfaceDataOutput+ * 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 - *1when areadreturns 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 anintin the range - *0to255. 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 - *-1is 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
readmethod of - *LineNumberInputStreamcalls theread+ * 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-1if 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 tolenbytes 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
readmethod of - *LineNumberInputStreamrepeatedly calls the - *readmethod 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 - *-1if 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 discardsnbytes of data from this - * input stream. Theskipmethod 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, - * possibly0. The actual number of bytes skipped is - * returned. Ifnis 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
skipmethod ofLineNumberInputStreamcreates + * The {@code skip} method of {@code LineNumberInputStream} creates * a byte array and then repeatedly reads into it until - *nbytes 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 - *
LineNumberInputStreamcan 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 theresetmethod 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
markmethod of - *LineNumberInputStreamremembers the current line - * number in a private variable, and then calls themark+ * 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 - *markmethod was last called on this input stream. + * {@code mark} method was last called on this input stream. *- * The
resetmethod of - *LineNumberInputStreamresets the line number to be - * the line number at the time themarkmethod was - * called, and then calls theresetmethod 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 - *
getFilePointermethod and set by theseek+ * {@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, anIOExceptionother - * thanEOFExceptionis thrown. In particular, an - *IOExceptionmay 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
checkReadmethod - * is called with thenameargument + * 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 - *checkWritemethod - * is also called with thenameargument + * {@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 - *checkReadmethod 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 - *checkWritemethod 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
checkReadmethod is - * called with the pathname of thefileargument 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
checkWritemethod 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 - *checkReadmethod 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 - *checkWritemethod 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() - *
} 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 inmode+ * opened in read-write mode if the O_RDWR bit in {@code mode} * is true, else the file is opened as read-only. - * If thenamerefers 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
RandomAccessFileis 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-1if 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 tolenbytes 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
RandomAccessFileis 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 arrayb+ * @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 - *-1if 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 Ifbisnull. - * @exception IndexOutOfBoundsException Ifoffis negative, - *lenis negative, orlenis 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 tob.lengthbytes 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
RandomAccessFileis 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 - *-1if 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 Ifbisnull. + * @exception NullPointerException If {@code b} is {@code null}. */ public int read(byte b[]) throws IOException { return readBytes(b, 0, b.length); } /** - * Readsb.lengthbytes 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 exactlylenbytes 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 overnbytes 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
nbytes have been skipped is only one - * possibility. This method never throws anEOFException. - * The actual number of bytes skipped is returned. Ifn+ * 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 thebyteto 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; /** - * Writesb.lengthbytes 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 { } /** - * Writeslenbytes from the specified byte array - * starting at offsetoffto 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 ifposis less than - *0or 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 - *
lengthmethod is greater than thenewLength+ * {@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 thegetFilePointermethod is greater - * thannewLengththen after this method returns the offset - * will be equal tonewLength. + * 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 - *
lengthmethod is smaller than thenewLength+ * {@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 abooleanfrom 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 of0represents - *false. Any other value representstrue. + * 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 thebooleanvalue 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 isb, where + * If the byte read is {@code b}, where *0 <= b <= 255, * then the result is: ** - * These are the characters@@ -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 - *b1andb2, where each of the two values is - * between0and255, 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: ** - * These are the characters* (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 - *b1andb2, where + * {@code b1} and {@code b2}, where *0 <= b1, b2 <= 255, * then the result is equal to: ** - * These are@@ -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 - *b1andb2, where + * {@code b1} and {@code b2}, where *0 <= b1, b2 <= 255, * then the result is equal to: ** - * These are the characters@@ -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, areb1, - *b2,b3, andb4, 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: ** - * These are the characters@@ -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, andb8,where: + * {@code b1}, {@code b2}, {@code b3}, + * {@code b4}, {@code b5}, {@code b6}, + * {@code b7}, and {@code b8,} where: *@@ -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 - ** 0 <= b1, b2, b3, b4, b5, b6, b7, b8 <=255, *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 afloatfrom this file. This method reads an - *intvalue, starting at the current file pointer, - * as if by thereadIntmethod - * and then converts thatintto afloat- * using theintBitsToFloatmethod 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 adoublefrom this file. This method reads a - *longvalue, starting at the current file pointer, - * as if by thereadLongmethod - * and then converts thatlongto adouble- * using thelongBitsToDoublemethod in - * classDouble. + * 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 abooleanto the file as a one-byte value. The - * valuetrueis written out as the value - *(byte)1; the valuefalseis 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 abooleanvalue 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 abyteto 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 abytevalue 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 ashortto 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 ashortto 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 acharto 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 acharvalue 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 anintto 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 anintto 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 alongto 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 alongto 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 anintusing the - *floatToIntBitsmethod in classFloat, - * and then writes thatintvalue 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 afloatvalue 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 alongusing the - *doubleToLongBitsmethod in classDouble, - * and then writes thatlongvalue 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 adoublevalue 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 - *writeCharmethod. The write starts at the current + * {@code writeChar} method. The write starts at the current * position of the file pointer. * - * @param s aStringvalue 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 - *
writeShortmethod 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; /** - * TheStreamTokenizerclass 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 - *
nextTokenmethod in each iteration of the loop until - * it returns the valueTT_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 thenextTokenmethod, 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_WORDindicates that the token is a word. - *TT_NUMBERindicates that the token is a number. - *TT_EOLindicates 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 - *
eolIsSignificantmethod has been called with the - * argumenttrue. - *TT_EOFindicates 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 - *
ttypefield isTT_WORD. The current token is - * a quoted string token when the value of thettypefield 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
ttypefield isTT_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
ordinaryCharmethod + * "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 - *ordinaryCharmethod 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 setsttypefield 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
StreamTokenizerto count - * lines. Thelinenomethod 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
nextTokenmethod encounters a string - * constant, thettypefield is set to the string - * delimiter and thesvalfield 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 valueTT_NUMBERand putting the numeric - * value of the token into thenvalfield. + * 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; thenextTokenmethod returns - *TT_EOLand also sets thettypefield 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
flagis 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 flagtrueindicates that end-of-line characters - * are separate tokens;falseindicates 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 istrue, 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 flagtrueindicates 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 istrue, 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 flagtrueindicates 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 istrue, then the value in the - *svalfield is lowercased whenever a word token is - * returned (thettypefield has the - * valueTT_WORDby thenextTokenmethod + * 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 - *svalfield is not modified. + * If the flag argument is {@code false}, then the + * {@code sval} field is not modified. * - * @param fltrueindicates 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 thettype+ * The type of the next token is returned in the {@code ttype} * field. Additional information about the token may be in the - *nvalfield or thesvalfield 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
ttypefield. + * @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 thenextTokenmethod of this - * tokenizer to return the current value in thettype- * field, and not to modify the value in thenvalor - *svalfield. + * 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: *- *
- * If the- The
minimumCapacityargument. - *- Twice the old capacity, plus
2. + *- The {@code minimumCapacity} argument. + *
- Twice the old capacity, plus {@code 2}. *
minimumCapacityargument 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 thannewLength, 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 thenewLengthargument 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
newLengthargument 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 thenewLengthargument. + * ({@code '\u005Cu0000'}) are appended so that + * length becomes the {@code newLength} argument. *- * The
newLengthargument must be greater than or equal - * to0. + * The {@code newLength} argument must be greater than or equal + * to {@code 0}. * * @param newLength the new length * @throws IndexOutOfBoundsException if the - *newLengthargument 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 thecharvalue in this sequence at the specified index. - * The firstcharvalue is at index0, 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
charvalue 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
charvalue. - * @return thecharvalue at the specified index. - * @throws IndexOutOfBoundsException ifindexis - * negative or greater than or equal tolength(). + * @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 tocharvalues - * (Unicode code units) and ranges from0to - * {@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
charvalue 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 - *
charvalue 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, - * thecharvalue at the given index is returned. + * the {@code char} value at the given index is returned. * - * @param index the index to thecharvalues + * @param index the index to the {@code char} values * @return the code point value of the character at the - *index- * @exception IndexOutOfBoundsException if theindex+ * {@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 tocharvalues - * (Unicode code units) and ranges from1to {@link + * index. The index refers to {@code char} values + * (Unicode code units) and ranges from {@code 1} to {@link * #length()}. * - *If the
charvalue at(index - 1)- * is in the low-surrogate range,(index - 2)is not - * negative, and thecharvalue 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
charvalue atindex - - * 1is 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 theindex+ * @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 - *beginIndexand extends to thecharat - * indexendIndex - 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 firstcharof + * @param beginIndex the index to the first {@code char} of * the text range. - * @param endIndex the index after the lastcharof + * @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 - *beginIndexis negative, orendIndex+ * {@code beginIndex} is negative, or {@code endIndex} * is larger than the length of this sequence, or - *beginIndexis larger thanendIndex. + * {@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 - * givenindexbycodePointOffsetcode + * given {@code index} by {@code codePointOffset} code * points. Unpaired surrogates within the text range given by - *indexandcodePointOffsetcount 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 ifindex+ * @exception IndexOutOfBoundsException if {@code index} * is negative or larger then the length of this sequence, - * or ifcodePointOffsetis positive and the subsequence - * starting withindexhas fewer than - *codePointOffsetcode points, - * or ifcodePointOffsetis negative and the subsequence - * beforeindexhas fewer than the absolute value of - *codePointOffsetcode 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 arraydst. The first character to - * be copied is at indexsrcBegin; the last character to - * be copied is at indexsrcEnd-1. The total number of - * characters to be copied issrcEnd-srcBegin. The - * characters are copied into the subarray ofdststarting - * at indexdstBeginand 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: *@@ -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* dstbegin + (srcEnd-srcBegin) - 1 *dst. - * @throws NullPointerException ifdstis - *null. + * @param dstBegin offset into {@code dst}. + * @throws NullPointerException if {@code dst} is + * {@code null}. * @throws IndexOutOfBoundsException if any of the following is true: *- *
*/ 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 tosrcBeginis negative - *dstBeginis negative - *- the
srcBeginargument is greater than - * thesrcEndargument. - *srcEndis greater than - *this.length(). - *dstBegin+srcEnd-srcBeginis 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} *
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 - * characterchat positionindex. + * 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 ifindexis - * negative or greater than or equal tolength(). + * @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 thecharat the specified position in this - * sequence. This sequence is shortened by onechar. + * 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)), - * wherethisSequenceis 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 ofcharto remove + * @param index Index of {@code char} to remove * @return This object. - * @throws StringIndexOutOfBoundsException if theindex+ * @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 specifiedString. The substring - * begins at the specifiedstartand extends to the character - * at indexend - 1or 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 - *Stringis inserted atstart. (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 ifstart- * is negative, greater thanlength(), or - * greater thanend. + * @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 newStringthat 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 ifstartis + * @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 newStringthat 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 specifiedstartand - * extends to the character at indexend - 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 ifstart- * orendare negative or greater than - *length(), orstartis - * greater thanend. + * @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 { *- * is* this.toString().startsWith(str, k) *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,-1is returned. - * @throws java.lang.NullPointerException ifstris - *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 ifstris - *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 valuethis.length(). + * considered to occur at the index value {@code this.length()}. * The returned index is the largest value k such that ** - * These are* 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,-1is returned. - * @throws java.lang.NullPointerException ifstris - *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 ifstris - *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 incharvalues) just prior to - * execution of thereversemethod. 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
Stringobject is allocated and initialized to + * A new {@code String} object is allocated and initialized to * contain the character sequence currently represented by this - * object. ThisStringis 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: **
@@ -208,7 +208,7 @@ public final class Double extends Number implements Comparable- 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)}. *{ * - 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} * '\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} * '\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} * '\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} * '\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} * '\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} * '\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; /** - * TheStringclass 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
Stringincludes 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 theStringBuilder(orStringBuffer) - * class and itsappendmethod. + * through the {@code StringBuilder}(or {@code StringBuffer}) + * class and its {@code append} method. * String conversions are implemented through the method - *toString, defined byObjectand + * {@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
Stringrepresents 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
Characterclass for + * Character Representations in the {@code Character} class for * more information). - * Index values refer tocharcode units, so a supplementary - * character uses two positions in aString. - *The
Stringclass 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.,
charvalues). + * 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: *- *- * The String is written by methodTC_STRING(utf String) + * {@code TC_STRING} (utf String) *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 thecharvalue at the - * specified index. An index ranges from0to - *length() - 1. The firstcharvalue of the sequence - * is at index0, the next at index1, + * 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
charvalue 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
charvalue. - * @return thecharvalue at the specified index of this string. - * The firstcharvalue is at index0. - * @exception IndexOutOfBoundsException if theindex+ * @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 tocharvalues - * (Unicode code units) and ranges from0to - * {@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
charvalue 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 - *charvalue 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, - * thecharvalue at the given index is returned. + * the {@code char} value at the given index is returned. * - * @param index the index to thecharvalues + * @param index the index to the {@code char} values * @return the code point value of the character at the - *index- * @exception IndexOutOfBoundsException if theindex+ * {@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 tocharvalues - * (Unicode code units) and ranges from1to {@link + * index. The index refers to {@code char} values + * (Unicode code units) and ranges from {@code 1} to {@link * CharSequence#length() length}. * - *If the
charvalue at(index - 1)- * is in the low-surrogate range,(index - 2)is not - * negative, and thecharvalue 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
charvalue atindex - - * 1is 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 theindex+ * @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 thisString. The text range begins at the - * specifiedbeginIndexand extends to the - *charat indexendIndex - 1. Thus the - * length (inchars) 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 firstcharof + * @param beginIndex the index to the first {@code char} of * the text range. - * @param endIndex the index after the lastcharof + * @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 - *beginIndexis negative, orendIndex- * is larger than the length of thisString, or - *beginIndexis larger thanendIndex. + * {@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 thisStringthat is - * offset from the givenindexby - *codePointOffsetcode points. Unpaired surrogates - * within the text range given byindexand - *codePointOffsetcount 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 thisString- * @exception IndexOutOfBoundsException ifindex+ * @return the index within this {@code String} + * @exception IndexOutOfBoundsException if {@code index} * is negative or larger then the length of this - *String, or ifcodePointOffsetis positive - * and the substring starting withindexhas fewer - * thancodePointOffsetcode points, - * or ifcodePointOffsetis negative and the substring - * beforeindexhas fewer than the absolute value - * ofcodePointOffsetcode 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 indexsrcEnd-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 ofdststarting at indexdstBegin+ * {@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: - **/ 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 - *
srcBeginis negative. - *srcBeginis greater thansrcEnd- *srcEndis 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 - *
dstBeginis negative - *dstBegin+(srcEnd-srcBegin)is larger than - *dst.length- {@code dstBegin} is negative + *
- {@code dstBegin+(srcEnd-srcBegin)} is larger than + * {@code dst.length}
Stringobject 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 thisStringobject + * a negative integer if this {@code String} object * lexicographically precedes the argument string. The result is a - * positive integer if thisStringobject lexicographically + * positive integer if this {@code String} object lexicographically * follows the argument string. The result is zero if the strings - * are equal;compareToreturns0exactly when - * the {@link #equals(Object)} method would returntrue. + * 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,
compareToreturns the - * difference of the two character values at positionkin + * 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: ** If there is no index position at which they differ, then the shorter * string lexicographically precedes the longer string. In this case, - ** this.charAt(k)-anotherString.charAt(k) *compareToreturns the difference of the lengths of the + * {@code compareTo} returns the difference of the lengths of the * strings -- that is, the value: ** - * @param anotherString the* this.length()-anotherString.length() *Stringto be compared. - * @return the value0if the argument string is equal to - * this string; a value less than0if 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 than0if 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 ordersStringobjects 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
compareTowith 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
Stringto 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. - * @returntrueif 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; - *falseotherwise. + * {@code false} otherwise. */ public boolean regionMatches(int toffset, String other, int ooffset, int len) { @@ -1360,7 +1360,7 @@ public final class String *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. - * @returntrueif the specified subregion of this string + * @return {@code true} if the specified subregion of this string * matches the specified subregion of the string argument; - *falseotherwise. Whether the matching is exact - * or case insensitive depends on theignoreCase+ * {@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. - * @returntrueif 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 indextoffset;falseotherwise. - * The result isfalseiftoffsetis + * at index {@code toffset}; {@code false} otherwise. + * The result is {@code false} if {@code toffset} is * negative or greater than the length of this - *Stringobject; 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. - * @returntrueif 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;falseotherwise. - * Note also thattruewill 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 - *Stringobject 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. - * @returntrueif 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;falseotherwise. Note that the - * result will betrueif the argument is the - * empty string or is equal to thisStringobject + * 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 - *Stringobject is computed as + * {@code String} object is computed as *- * using* s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1] *intarithmetic, wheres[i]is the - * ith character of the string,nis 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 - *choccurs in the character sequence represented by - * thisStringobject, 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 ofchin 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: *- * is true. For other values of* this.charAt(k) == ch *ch, it is the + * is true. For other values of {@code ch}, it is the * smallest value k such that: ** is true. In either case, if no such character occurs in this - * string, then* this.codePointAt(k) == ch *-1is 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 - *-1if 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
choccurs in the - * character sequence represented by thisString- * object at an index no smaller thanfromIndex, 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 - * ofchin 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: *- * is true. For other values of* (this.charAt(k) == ch) && (k >= fromIndex) *ch, it is the + * is true. For other values of {@code ch}, it is the * smallest value k such that: ** is true. In either case, if no such character occurs in this - * string at or after position* (this.codePointAt(k) == ch) && (k >= fromIndex) *fromIndex, then - *-1is 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:-1is returned. + * this string: {@code -1} is returned. * - *All indices are specified in
charvalues + *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 ofchin 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: *- * is true. For other values of* this.charAt(k) == ch *ch, it is the + * is true. For other values of {@code ch}, it is the * largest value k such that: ** is true. In either case, if no such character occurs in this - * string, then* this.codePointAt(k) == ch *-1is returned. The - *Stringis 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 - *-1if 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 ofchin 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: *- * is true. For other values of* (this.charAt(k) == ch) && (k <= fromIndex) *ch, it is the + * is true. For other values of {@code ch}, it is the * largest value k such that: ** is true. In either case, if no such character occurs in this - * string at or before position* (this.codePointAt(k) == ch) && (k <= fromIndex) *fromIndex, then - *-1is returned. + * string at or before position {@code fromIndex}, then + * {@code -1} is returned. * - *All indices are specified in
charvalues + *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 tofromIndex, 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 - *beginIndexis negative or larger than the - * length of thisStringobject. + * {@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 specifiedbeginIndexand - * extends to the character at indexendIndex - 1. - * Thus the length of the substring isendIndex-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 - *beginIndexis negative, or - *endIndexis larger than the length of - * thisStringobject, or - *beginIndexis 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 - *Stringobject is returned. Otherwise, a new - *Stringobject 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 thisStringobject and the character + * represented by this {@code String} object and the character * sequence represented by the argument string.* Examples: *
* - * @param str the@@ -2011,8 +2011,8 @@ public final class String * "to".concat("get").concat("her") returns "together" *Stringthat is concatenated to the end - * of thisString. + * @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 - *oldCharin this string withnewChar. + * {@code oldChar} in this string with {@code newChar}. *- * If the character
oldChardoes not occur in the - * character sequence represented by thisStringobject, - * then a reference to thisStringobject is returned. - * Otherwise, a newStringobject 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 thisStringobject, except that every - * occurrence ofoldCharis replaced by an occurrence - * ofnewChar. + * 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 ofoldCharwithnewChar. + * 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 containss, false otherwise - * @throws NullPointerException ifsisnull+ * @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 iftargetor - *replacementisnull. + * @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 thisStringto lower - * case using the rules of the givenLocale. 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 - *Stringmay be a different length than the originalString. + * {@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 theString, 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 thisStringto 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 thisStringto upper - * case using the rules of the givenLocale. 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 - *Stringmay be a different length than the originalString. + * {@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 * *
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 thisStringto 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
Stringobject 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 thisStringobject both have codes - * greater than'\u0020'(the space character), then a - * reference to thisStringobject 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 - *Stringobject 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 newString+ * 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 theObjectargument. + * Returns the string representation of the {@code Object} argument. * - * @param obj anObject. - * @return if the argument isnull, 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 thechararray + * 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 achararray. + * @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 - *chararray argument. + * {@code char} array argument. *- * The
offsetargument is the index of the first - * character of the subarray. Thecountargument + * 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 theString. + * {@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 ifoffsetis - * negative, orcountis negative, or - *offset+countis 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 aStringthat 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 aStringthat 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 thebooleanargument. + * Returns the string representation of the {@code boolean} argument. * - * @param b aboolean. - * @return if the argument istrue, 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 thechar+ * Returns the string representation of the {@code char} * argument. * - * @param c achar. - * @return a string of length1containing - * as its single character the argumentc. + * @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 theintargument. + * Returns the string representation of the {@code int} argument. ** The representation is exactly the one returned by the - *
Integer.toStringmethod of one argument. + * {@code Integer.toString} method of one argument. * - * @param i anint. - * @return a string representation of theintargument. + * @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 thelongargument. + * Returns the string representation of the {@code long} argument. ** The representation is exactly the one returned by the - *
Long.toStringmethod of one argument. + * {@code Long.toString} method of one argument. * - * @param l along. - * @return a string representation of thelongargument. + * @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 thefloatargument. + * Returns the string representation of the {@code float} argument. ** The representation is exactly the one returned by the - *
Float.toStringmethod of one argument. + * {@code Float.toString} method of one argument. * - * @param f afloat. - * @return a string representation of thefloatargument. + * @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 thedoubleargument. + * Returns the string representation of the {@code double} argument. ** The representation is exactly the one returned by the - *
Double.toStringmethod of one argument. + * {@code Double.toString} method of one argument. * - * @param d adouble. - * @return a string representation of thedoubleargument. + * @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
Stringobject 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, thisStringobject is added to the - * pool and a reference to thisStringobject 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
sandt, - *s.intern() == t.intern()istrue- * if and only ifs.equals(t)istrue. + * 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
Propertiesclass represents a persistent set of - * properties. ThePropertiescan 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
Propertiesinherits fromHashtable, the - *putandputAllmethods can be applied to a - *Propertiesobject. 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. ThesetPropertymethod should be used - * instead. If thestoreorsavemethod is called - * on a "compromised"Propertiesobject that contains a - * non-Stringkey or value, the call will fail. Similarly, - * the call to thepropertyNamesorlistmethod - * will fail if it is called on a "compromised"Properties- * object that contains a non-Stringkey. + * {@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