You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/06/12 20:06:00 UTC

[jira] [Commented] (MNG-7302) Replace construction of FileInputStream and FileOutputStream objects with Files NIO APIs.

    [ https://issues.apache.org/jira/browse/MNG-7302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17731762#comment-17731762 ] 

ASF GitHub Bot commented on MNG-7302:
-------------------------------------

gnodet commented on code in PR #587:
URL: https://github.com/apache/maven/pull/587#discussion_r1227179496


##########
maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java:
##########
@@ -271,7 +271,7 @@ protected void createArtifact( Artifact artifact, ArtifactRepository repository
         {
             artifactFile.getParentFile().mkdirs();
         }
-        try ( Writer writer = new OutputStreamWriter( new FileOutputStream( artifactFile ), StandardCharsets.ISO_8859_1) )
+        try ( Writer writer = new OutputStreamWriter( Files.newOutputStream( artifactFile.toPath() ), StandardCharsets.ISO_8859_1) )

Review Comment:
   This should use `Files.newBufferedWriter` instead imho





> Replace construction of FileInputStream and FileOutputStream objects with Files NIO APIs.
> -----------------------------------------------------------------------------------------
>
>                 Key: MNG-7302
>                 URL: https://issues.apache.org/jira/browse/MNG-7302
>             Project: Maven
>          Issue Type: Sub-task
>            Reporter: Arturo Bernal
>            Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)