From commits-return-9097-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Tue Sep 3 15:38:04 2019 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 15110180637 for ; Tue, 3 Sep 2019 17:38:03 +0200 (CEST) Received: (qmail 153 invoked by uid 500); 3 Sep 2019 17:51:58 -0000 Mailing-List: contact commits-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list commits@groovy.apache.org Received: (qmail 139 invoked by uid 99); 3 Sep 2019 17:51:58 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Sep 2019 17:51:58 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 0031187446; Tue, 3 Sep 2019 15:38:02 +0000 (UTC) Date: Tue, 03 Sep 2019 15:38:02 +0000 To: "commits@groovy.apache.org" Subject: [groovy] branch GROOVY-9240 updated: Added named param annotations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <156752508263.24939.12132668851611737134@gitbox.apache.org> From: emilles@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: groovy X-Git-Refname: refs/heads/GROOVY-9240 X-Git-Reftype: branch X-Git-Oldrev: b13646b11c58a9a2b27fd96c547e9940ec79cbd2 X-Git-Newrev: 8c437f26cfd9986d0d77c9c58931b89b4f02d5b9 X-Git-Rev: 8c437f26cfd9986d0d77c9c58931b89b4f02d5b9 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. emilles pushed a commit to branch GROOVY-9240 in repository https://gitbox.apache.org/repos/asf/groovy.git The following commit(s) were added to refs/heads/GROOVY-9240 by this push: new 8c437f2 Added named param annotations 8c437f2 is described below commit 8c437f26cfd9986d0d77c9c58931b89b4f02d5b9 Author: Eric Milles AuthorDate: Tue Sep 3 10:37:56 2019 -0500 Added named param annotations --- .../groovy/runtime/ResourceGroovyMethods.java | 37 +++++++++++++++++++--- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java index 335086a..a77627a 100644 --- a/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java +++ b/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java @@ -25,6 +25,7 @@ import groovy.io.GroovyPrintWriter; import groovy.lang.Closure; import groovy.lang.MetaClass; import groovy.lang.Writable; +import groovy.transform.NamedParam; import groovy.transform.stc.ClosureParams; import groovy.transform.stc.FromString; import groovy.transform.stc.PickFirstResolver; @@ -1308,8 +1309,23 @@ public class ResourceGroovyMethods extends DefaultGroovyMethodsSupport { * @see groovy.io.FileType * @since 1.7.1 */ - public static void traverse(final File self, final Map options, @ClosureParams(value = SimpleType.class, options = "java.io.File") final Closure closure) - throws FileNotFoundException, IllegalArgumentException { + public static void traverse(final File self, + @NamedParam(value = "type", type = FileType.class) + @NamedParam(value = "preDir", type = Closure.class) + @NamedParam(value = "preRoot", type = Boolean.class) + @NamedParam(value = "postDir", type = Closure.class) + @NamedParam(value = "postRoot", type = Boolean.class) + @NamedParam(value = "visitRoot", type = Boolean.class) + @NamedParam(value = "maxDepth", type = Integer.class) + @NamedParam(value = "filter", type = Object.class) + @NamedParam(value = "nameFilter", type = Object.class) + @NamedParam(value = "excludeFilter", type = Object.class) + @NamedParam(value = "excludeNameFilter", type = Object.class) + @NamedParam(value = "sort", type = Closure.class) + final Map options, + @ClosureParams(value = SimpleType.class, options = "java.io.File") + final Closure closure) + throws FileNotFoundException, IllegalArgumentException { final int maxDepth; final boolean preRoot; final boolean postRoot; @@ -1415,8 +1431,21 @@ public class ResourceGroovyMethods extends DefaultGroovyMethodsSupport { * @see #traverse(java.io.File, java.util.Map, groovy.lang.Closure) * @since 1.7.1 */ - public static void traverse(final File self, final Map options) - throws FileNotFoundException, IllegalArgumentException { + public static void traverse(final File self, + @NamedParam(value = "type", type = FileType.class) + @NamedParam(value = "preDir", type = Closure.class) + @NamedParam(value = "preRoot", type = Boolean.class) + @NamedParam(value = "postDir", type = Closure.class) + @NamedParam(value = "postRoot", type = Boolean.class) + @NamedParam(value = "visitRoot", type = Boolean.class) + @NamedParam(value = "maxDepth", type = Integer.class) + @NamedParam(value = "filter", type = Object.class) + @NamedParam(value = "nameFilter", type = Object.class) + @NamedParam(value = "excludeFilter", type = Object.class) + @NamedParam(value = "excludeNameFilter", type = Object.class) + @NamedParam(value = "sort", type = Closure.class) + final Map options) + throws FileNotFoundException, IllegalArgumentException { final Closure visit = (Closure) options.remove("visit"); traverse(self, options, visit); }