maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ChristianSchulte <...@git.apache.org>
Subject [GitHub] maven-surefire pull request #144: Resource leaks.
Date Sun, 26 Feb 2017 16:59:33 GMT
Github user ChristianSchulte commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/144#discussion_r103110034
  
    --- Diff: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleOutputFileReporter.java
---
    @@ -69,8 +69,8 @@ public void close()
             {
                 try
                 {
    -                fileOutputStream.flush();
    -                fileOutputStream.close();
    +                // fileOutputStream.flush(); Will not call close on exception!
    +                fileOutputStream.close(); // Will implicitly flush.
    --- End diff --
    
    I just wanted to be sure that `close` is always called. See the comment. When `flush`
throws an exception, `close` will never be called and leak resources.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Mime
View raw message