ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [6/6] ant git commit: bring back early exit that was there before Java8 refactoring
Date Sat, 17 Feb 2018 17:26:11 GMT
bring back early exit that was there before Java8 refactoring


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

Branch: refs/heads/master
Commit: 0a3b2c002b018f6eca717e47c17bcacd881fd44c
Parents: 4d0a7d5
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Sat Feb 17 17:49:02 2018 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Sat Feb 17 17:49:02 2018 +0100

----------------------------------------------------------------------
 src/main/org/apache/tools/ant/util/ScriptRunnerBase.java | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/0a3b2c00/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java b/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java
index 6cf3962..707d154 100644
--- a/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java
+++ b/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java
@@ -222,6 +222,9 @@ public abstract class ScriptRunnerBase {
      */
     public void setSrc(File file) {
         String filename = file.getPath();
+        if (!file.exists()) {
+            throw new BuildException("file " + filename + " not found.");
+        }
 
         try (InputStream in = Files.newInputStream(file.toPath())) {
             final Charset charset = null == encoding ? Charset.defaultCharset()


Mime
View raw message