Skip to content

Commit d42de08

Browse files
Bananeweizengaul
authored andcommitted
Fix recommendation for Files.newOutputStream()
The replacement of the new FileInputStream(..., append) methods needs to use the APPEND option, in addition to CREATE and WRITE.
1 parent aa3cf2b commit d42de08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modernizer-maven-plugin/src/main/resources/modernizer.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ violation names use the same format that javap emits.
12501250
<violation>
12511251
<name>java/io/FileOutputStream."&lt;init&gt;":(Ljava/lang/String;Z)V</name>
12521252
<version>7</version>
1253-
<comment>Prefer java.nio.file.Files.newOutputStream(java.nio.file.Paths.get(String), java.nio.file.StandardOpenOption.CREATE, java.nio.file.StandardOpenOption.CREATE)</comment>
1253+
<comment>Prefer java.nio.file.Files.newOutputStream(java.nio.file.Paths.get(String), CREATE, APPEND, WRITE)</comment>
12541254
</violation>
12551255

12561256
<violation>
@@ -1262,7 +1262,7 @@ violation names use the same format that javap emits.
12621262
<violation>
12631263
<name>java/io/FileOutputStream."&lt;init&gt;":(Ljava/io/File;Z)V</name>
12641264
<version>7</version>
1265-
<comment>Prefer java.nio.file.Files.newOutputStream(java.nio.file.Path, java.nio.file.StandardOpenOption.CREATE, java.nio.file.StandardOpenOption.CREATE)</comment>
1265+
<comment>Prefer java.nio.file.Files.newOutputStream(Path, CREATE, APPEND, WRITE)</comment>
12661266
</violation>
12671267

12681268
<violation>

0 commit comments

Comments
 (0)