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

2023-06-21 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on MNG-7302:
-

arturobernalg closed pull request #587: [MNG-7302] - Replace construction of 
FileInputStream and FileOutputStream objects with Files NIO APIs.
URL: https://github.com/apache/maven/pull/587




> 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)


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

2023-06-12 Thread ASF GitHub Bot (Jira)


[ 
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)


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

2022-06-26 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on MNG-7302:
-

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


##
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:
   IntelliJ suggests with comment: _The streams created using Files methods are 
usually more efficient than those created by stream constructors._
   





> 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.7#820007)