Skip to content

Commit

Permalink
Fix recommendation for Files.newOutputStream()
Browse files Browse the repository at this point in the history
The replacement of the new FileInputStream(..., append) methods needs to
use the APPEND option, in addition to CREATE and WRITE.
  • Loading branch information
Bananeweizen authored and gaul committed Jan 3, 2025
1 parent aa3cf2b commit d42de08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modernizer-maven-plugin/src/main/resources/modernizer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ violation names use the same format that javap emits.
<violation>
<name>java/io/FileOutputStream."&lt;init&gt;":(Ljava/lang/String;Z)V</name>
<version>7</version>
<comment>Prefer java.nio.file.Files.newOutputStream(java.nio.file.Paths.get(String), java.nio.file.StandardOpenOption.CREATE, java.nio.file.StandardOpenOption.CREATE)</comment>
<comment>Prefer java.nio.file.Files.newOutputStream(java.nio.file.Paths.get(String), CREATE, APPEND, WRITE)</comment>
</violation>

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

<violation>
Expand Down

0 comments on commit d42de08

Please sign in to comment.