A DESCRIPTION OF THE PROBLEM :
The following RandomAccessFile constructor's first parameter is a 'name' string.
And the comment describes that it is the system-dependent filename as follows:
/**
...
* @param name the system-dependent filename
* @param mode the access <a href="#mode">mode</a>
*/
RandomAccessFile constructor:
public RandomAccessFile(String name, String mode)
throws FileNotFoundException
{
this(name != null ? new File(name) : null, mode);
}
BUT, it is actually a pathname string.
/**
* Creates a new <code>File</code> instance by converting the given
* pathname string into an abstract pathname. If the given string is
* the empty string, then the result is the empty abstract pathname.
*
* @param pathname A pathname string
* @throws NullPointerException
* If the <code>pathname</code> argument is <code>null</code>
*/
File constructor:
public File(String pathname) {
if (pathname == null) {
throw new NullPointerException();
}
this.path = fs.normalize(pathname);
this.prefixLength = fs.prefixLength(this.path);
}
The following RandomAccessFile constructor's first parameter is a 'name' string.
And the comment describes that it is the system-dependent filename as follows:
/**
...
* @param name the system-dependent filename
* @param mode the access <a href="#mode">mode</a>
*/
RandomAccessFile constructor:
public RandomAccessFile(String name, String mode)
throws FileNotFoundException
{
this(name != null ? new File(name) : null, mode);
}
BUT, it is actually a pathname string.
/**
* Creates a new <code>File</code> instance by converting the given
* pathname string into an abstract pathname. If the given string is
* the empty string, then the result is the empty abstract pathname.
*
* @param pathname A pathname string
* @throws NullPointerException
* If the <code>pathname</code> argument is <code>null</code>
*/
File constructor:
public File(String pathname) {
if (pathname == null) {
throw new NullPointerException();
}
this.path = fs.normalize(pathname);
this.prefixLength = fs.prefixLength(this.path);
}
- csr for
-
JDK-8314669 Name of first parameter of RandomAccessFile(String,String) is inconsistent
-
- Closed
-