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 DC1B02009C6 for ; Mon, 16 May 2016 11:47:42 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DAE881609B0; Mon, 16 May 2016 09:47:42 +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 2EB24160A19 for ; Mon, 16 May 2016 11:47:42 +0200 (CEST) Received: (qmail 63677 invoked by uid 500); 16 May 2016 09:47:41 -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 63667 invoked by uid 99); 16 May 2016 09:47:41 -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; Mon, 16 May 2016 09:47:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1A42DDFFF9; Mon, 16 May 2016 09:47:41 +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: Mon, 16 May 2016 09:47:43 -0000 Message-Id: In-Reply-To: <2806d4d9171847e0844b46cbcbc6116f@git.apache.org> References: <2806d4d9171847e0844b46cbcbc6116f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/3] ant git commit: whitespace archived-at: Mon, 16 May 2016 09:47:43 -0000 whitespace Project: http://git-wip-us.apache.org/repos/asf/ant/repo Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/24f3afe7 Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/24f3afe7 Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/24f3afe7 Branch: refs/heads/master Commit: 24f3afe7920e414a0ef83732fe4ea5aa58d17bce Parents: 04b9e2b Author: Stefan Bodewig Authored: Mon May 16 11:46:04 2016 +0200 Committer: Stefan Bodewig Committed: Mon May 16 11:46:04 2016 +0200 ---------------------------------------------------------------------- .../tools/ant/taskdefs/SetPermissions.java | 36 ++++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant/blob/24f3afe7/src/main/org/apache/tools/ant/taskdefs/SetPermissions.java ---------------------------------------------------------------------- diff --git a/src/main/org/apache/tools/ant/taskdefs/SetPermissions.java b/src/main/org/apache/tools/ant/taskdefs/SetPermissions.java index e78914b..8716bee 100644 --- a/src/main/org/apache/tools/ant/taskdefs/SetPermissions.java +++ b/src/main/org/apache/tools/ant/taskdefs/SetPermissions.java @@ -143,29 +143,29 @@ public class SetPermissions extends Task { } Resource currentResource = null; try { - for (Resource r : resources) { - currentResource = r; - try { - PermissionUtils.setPermissions(r, permissions, this::posixPermissionsNotSupported); - } catch (IOException ioe) { - maybeThrowException(ioe, "Failed to set permissions on '%s' due to %s", r, ioe.getMessage()); - } - } + for (Resource r : resources) { + currentResource = r; + try { + PermissionUtils.setPermissions(r, permissions, this::posixPermissionsNotSupported); + } catch (IOException ioe) { + maybeThrowException(ioe, "Failed to set permissions on '%s' due to %s", r, ioe.getMessage()); + } + } } catch (ClassCastException uoe) { - maybeThrowException(null, "some specified permissions are not of type PosixFilePermission: %s", StringUtils.join(permissions, ", ")); + maybeThrowException(null, "some specified permissions are not of type PosixFilePermission: %s", StringUtils.join(permissions, ", ")); } catch (SecurityException uoe) { - maybeThrowException(null, "the SecurityManager denies role accessUserInformation or write access for SecurityManager.checkWrite for resource '%s'", currentResource); + maybeThrowException(null, "the SecurityManager denies role accessUserInformation or write access for SecurityManager.checkWrite for resource '%s'", currentResource); } } - private void maybeThrowException(Exception ioe, String msgFormat, Object... msgArgs) { - String msg = String.format(msgFormat, msgArgs); - if (failonerror) { - throw new BuildException(msg, ioe); - } else { - log("Warning: " + msg, Project.MSG_ERR); - } - } + private void maybeThrowException(Exception ioe, String msgFormat, Object... msgArgs) { + String msg = String.format(msgFormat, msgArgs); + if (failonerror) { + throw new BuildException(msg, ioe); + } else { + log("Warning: " + msg, Project.MSG_ERR); + } + } private void posixPermissionsNotSupported(Path p) { String msg = String.format("the associated path '%s' does"