ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [3/3] ant git commit: use FileUtils
Date Tue, 20 Dec 2016 21:35:23 GMT
use FileUtils


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/20026444
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/20026444
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/20026444

Branch: refs/heads/master
Commit: 20026444c48d2aa705aef34f9b75e2860b1bd41e
Parents: c939c1f
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Tue Dec 20 22:35:04 2016 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Tue Dec 20 22:35:04 2016 +0100

----------------------------------------------------------------------
 .../tools/ant/taskdefs/optional/sound/AntSoundPlayer.java      | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/20026444/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java b/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java
index f2ad686..47e2014 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java
@@ -36,7 +36,7 @@ import javax.sound.sampled.UnsupportedAudioFileException;
 import org.apache.tools.ant.BuildEvent;
 import org.apache.tools.ant.BuildListener;
 import org.apache.tools.ant.Project;
-
+import org.apache.tools.ant.util.FileUtils;
 
 
 /**
@@ -135,9 +135,7 @@ public class AntSoundPlayer implements LineListener, BuildListener {
                 }
                 audioClip.drain();
             } finally {
-                if (audioClip != null) {
-                    audioClip.close();
-                }
+                FileUtils.close(audioClip);
             }
         } else {
             project.log("Can't get data from file " + file.getName());


Mime
View raw message