You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Files.newBufferedWriter() takes a Path object, but incorrectly passed a File object #271
In Tutorials > The Java I/O API > File Operations Basics > Releasing Resources and Catching Exceptions, "Catching Exceptions" section, the sample code creates a File object and passes it into Files.newBufferedWriter().
However, according to the Java Docs, this method takes a java.nio.file.Path object, not a java.io.File object.
Activity
authentictech commentedon Aug 13, 2026
Same is true for the second sample code:
authentictech commentedon Aug 15, 2026
Same issue on Tutorials > The Java I/O API > File Operations Basics > Reading and Writing Text Files, section Writing a Text File by Using Buffered Stream I/O