Inspectopedia
 
2024.3

Redundant 'File' instance creation

Warning
New
Last modified: 03 December 2024

Reports redundant File creation in one of the following constructors when only String path can be used: FileInputStream, FileOutputStream, FileReader, FileWriter, PrintStream, PrintWriter, Formatter.

Example:

After quick-fix is applied:

New in 2020.3