-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.4.0
-
generic
-
generic
Name: nt126004 Date: 08/16/2001
The documentation of the java.lang.io.FileWriter constructors contains
the following description of the IOException that may be thrown:
Throws: IOException - if the specified file is not found or if some other I/O
error occurs.
(http://java.sun.com/j2se/1.4/docs/api/java/io/FileWriter.html)
Since FileWriter is in most cases creating a new file, the first part of the
IOException description ("the specified file is not found") does not apply here.
Such description is even more confusing in the FileWriter(String, boolean)
constructor. Will the constructor throw if FileWriter("foo.txt", true) is
called and "foo.txt" does not exist? Or will it succeed by creating "foo.txt"
in the filesystem?
It appears that the IOException description has been "copied & pasted" across
the constructor JavaDoc comments, and hence some duplication and confustion has
been introduced.
(Review ID: 130108)
======================================================================
- duplicates
-
JDK-4411409 java.io.FileWriter has incorrect throws tags
-
- Closed
-