Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3AEB4200D55 for ; Sat, 9 Dec 2017 19:02:26 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 39660160C0E; Sat, 9 Dec 2017 18:02:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7EC89160BFE for ; Sat, 9 Dec 2017 19:02:25 +0100 (CET) Received: (qmail 24834 invoked by uid 500); 9 Dec 2017 18:02:24 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 24823 invoked by uid 99); 9 Dec 2017 18:02:24 -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, 09 Dec 2017 18:02:24 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0C9A0E38BA; Sat, 9 Dec 2017 18:02:22 +0000 (UTC) From: bodewig To: dev@ant.apache.org Reply-To: dev@ant.apache.org References: In-Reply-To: Subject: [GitHub] ant pull request #49: [master branch] - Fix BZ-58683 Content-Type: text/plain Message-Id: <20171209180223.0C9A0E38BA@git1-us-west.apache.org> Date: Sat, 9 Dec 2017 18:02:22 +0000 (UTC) archived-at: Sat, 09 Dec 2017 18:02:26 -0000 Github user bodewig commented on a diff in the pull request: https://github.com/apache/ant/pull/49#discussion_r155928313 --- Diff: src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java --- @@ -500,18 +502,12 @@ private void doLink(String res, String lnk) throws BuildException { File dir = fs.getDir(getProject()); Stream.of(ds.getIncludedFiles(), ds.getIncludedDirectories()) - .flatMap(Stream::of).forEach(path -> { - try { - File f = new File(dir, path); - File pf = f.getParentFile(); - String name = f.getName(); - if (SYMLINK_UTILS.isSymbolicLink(pf, name)) { - result.add(new File(pf.getCanonicalFile(), name)); - } - } catch (IOException e) { - handleError("IOException: " + path + " omitted"); + .flatMap(Stream::of).forEach(path -> { + final File f = new File(dir, path); + if (Files.isSymbolicLink(f.toPath())) { + result.add(f); --- End diff -- The previous code canonicalized the link's parent directory to deal with symlinks further up the tree, I think this is important for consumers of the returned set like `record` that so merges entries from several "directories" that actually are links to the same directory. To be honest I'm not sure about the real impact but I guess we better keep the existing behavior. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org