8219567: Name of first parameter of RandomAccessFile(String,String) is inconsistent

Reviewed-by: jlu, vtewari, rriggs, jpai
This commit is contained in:
Brian Burkhalter 2023-08-24 18:18:16 +00:00
parent 8e4240c316
commit 2624324ac2

View File

@ -92,7 +92,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
/** /**
* Creates a random access file stream to read from, and optionally * Creates a random access file stream to read from, and optionally
* to write to, a file with the specified name. A new * to write to, a file with the specified pathname. A new
* {@link FileDescriptor} object is created to represent the * {@link FileDescriptor} object is created to represent the
* connection to the file. * connection to the file.
* *
@ -103,25 +103,25 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* *
* <p> * <p>
* If there is a security manager, its {@code checkRead} method * If there is a security manager, its {@code checkRead} method
* is called with the {@code name} argument * is called with the {@code pathname} argument
* as its argument to see if read access to the file is allowed. * as its argument to see if read access to the file is allowed.
* If the mode allows writing, the security manager's * If the mode allows writing, the security manager's
* {@code checkWrite} method * {@code checkWrite} method
* is also called with the {@code name} argument * is also called with the {@code pathname} argument
* as its argument to see if write access to the file is allowed. * as its argument to see if write access to the file is allowed.
* *
* @param name the system-dependent filename * @param pathname the system-dependent pathname string
* @param mode the access <a href="#mode">mode</a> * @param mode the access <a href="#mode">mode</a>
* @throws IllegalArgumentException if the mode argument is not equal * @throws IllegalArgumentException if the mode argument is not equal
* to one of {@code "r"}, {@code "rw"}, {@code "rws"}, or * to one of {@code "r"}, {@code "rw"}, {@code "rws"}, or
* {@code "rwd"} * {@code "rwd"}
* @throws FileNotFoundException * @throws FileNotFoundException
* if the mode is {@code "r"} but the given string does not * if the mode is {@code "r"} but the given pathname string does not
* denote an existing regular file, or if the mode begins with * denote an existing regular file, or if the mode begins with
* {@code "rw"} but the given string does not denote an * {@code "rw"} but the given pathname string does not denote an
* existing, writable regular file and a new regular file of * existing, writable regular file and a new regular file of
* that name cannot be created, or if some other error occurs * that pathname cannot be created, or if some other error
* while opening or creating the file * occurs while opening or creating the file
* @throws SecurityException if a security manager exists and its * @throws SecurityException if a security manager exists and its
* {@code checkRead} method denies read access to the file * {@code checkRead} method denies read access to the file
* or the mode is {@code "rw"} and the security manager's * or the mode is {@code "rw"} and the security manager's
@ -130,10 +130,10 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* @see java.lang.SecurityManager#checkRead(java.lang.String) * @see java.lang.SecurityManager#checkRead(java.lang.String)
* @see java.lang.SecurityManager#checkWrite(java.lang.String) * @see java.lang.SecurityManager#checkWrite(java.lang.String)
*/ */
public RandomAccessFile(String name, String mode) public RandomAccessFile(String pathname, String mode)
throws FileNotFoundException throws FileNotFoundException
{ {
this(name != null ? new File(name) : null, mode); this(pathname != null ? new File(pathname) : null, mode);
} }
/** /**
@ -191,8 +191,8 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* called with the pathname of the {@code file} argument as its * 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 * argument to see if read access to the file is allowed. If the mode
* allows writing, the security manager's {@code checkWrite} method is * allows writing, the security manager's {@code checkWrite} method is
* also called with the path argument to see if write access to the file is * also called with the pathname of the {@code file} argument to see if
* allowed. * write access to the file is allowed.
* *
* @param file the file object * @param file the file object
* @param mode the access mode, as described * @param mode the access mode, as described
@ -205,8 +205,8 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* not denote an existing regular file, or if the mode begins * not denote an existing regular file, or if the mode begins
* with {@code "rw"} but the given file object does not denote * with {@code "rw"} but the given file object does not denote
* an existing, writable regular file and a new regular file of * an existing, writable regular file and a new regular file of
* that name cannot be created, or if some other error occurs * that pathname cannot be created, or if some other error
* while opening or creating the file * occurs while opening or creating the file
* @throws SecurityException if a security manager exists and its * @throws SecurityException if a security manager exists and its
* {@code checkRead} method denies read access to the file * {@code checkRead} method denies read access to the file
* or the mode is {@code "rw"} and the security manager's * or the mode is {@code "rw"} and the security manager's