From notifications-return-30113-archive-asf-public=cust-asf.ponee.io@ant.apache.org Sat Feb 17 18:26:09 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 952CE180780 for ; Sat, 17 Feb 2018 18:26:08 +0100 (CET) Received: (qmail 16406 invoked by uid 500); 17 Feb 2018 17:26:07 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 16134 invoked by uid 99); 17 Feb 2018 17:26:07 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Feb 2018 17:26:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DA8CFE38C5; Sat, 17 Feb 2018 17:26:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bodewig@apache.org To: notifications@ant.apache.org Date: Sat, 17 Feb 2018 17:26:11 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [6/6] ant git commit: bring back early exit that was there before Java8 refactoring 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 Authored: Sat Feb 17 17:49:02 2018 +0100 Committer: Stefan Bodewig 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()