Return-Path: X-Original-To: apmail-groovy-users-archive@minotaur.apache.org Delivered-To: apmail-groovy-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 16358175F4 for ; Tue, 5 May 2015 17:42:59 +0000 (UTC) Received: (qmail 44085 invoked by uid 500); 5 May 2015 17:42:58 -0000 Delivered-To: apmail-groovy-users-archive@groovy.apache.org Received: (qmail 44051 invoked by uid 500); 5 May 2015 17:42:58 -0000 Mailing-List: contact users-help@groovy.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.incubator.apache.org Delivered-To: mailing list users@groovy.incubator.apache.org Received: (qmail 44041 invoked by uid 99); 5 May 2015 17:42:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2015 17:42:58 +0000 X-ASF-Spam-Status: No, hits=1.0 required=5.0 tests=SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of ysb33r@gmail.com does not designate 54.191.145.13 as permitted sender) Received: from [54.191.145.13] (HELO mx1-us-west.apache.org) (54.191.145.13) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2015 17:42:53 +0000 Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id DACA824E99 for ; Tue, 5 May 2015 17:42:32 +0000 (UTC) Received: by widdi4 with SMTP id di4so156115740wid.0 for ; Tue, 05 May 2015 10:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=LqklD5H7dZ4P5W3wGrvuEwD6n4NClhEh08pmnhD+Rqk=; b=gpuOt478/DZQ2Nychl8Uer9wtGtsiga6h5id2uVCUrWpfahc8mfDJJiTC1om0kNB8a jkJe/PyAhM5GizqteYzg5uIXlVb0I4wefKIhdz73K79OLrMjUUqPnAsmSTVgQkV7EFYD oN+AIjtrVgELN6pOE3sassn1V8cH4D6vKhcFnW8IYPoHI9NzEBIHCqYiJic84axH4TRa LwGxxJbnFrQJXyYI4YZu/n6mOjbEaQsW2thzcuSlKTYx/kVn7u3jvAXYSvj9cuLN40VY vEzuoJo6MlSNw0dwfDMAfZVDWXnKwu8UheT0tDU2oTExiI6pbkQvWQSIDYwyEZk3RE4+ U4BA== X-Received: by 10.194.122.200 with SMTP id lu8mr14700600wjb.30.1430847706503; Tue, 05 May 2015 10:41:46 -0700 (PDT) Received: from icidi.local (cpc66935-ayle3-2-0-cust217.15-2.cable.virginm.net. [81.108.68.218]) by mx.google.com with ESMTPSA id b10sm17205161wiz.9.2015.05.05.10.41.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 May 2015 10:41:45 -0700 (PDT) Message-ID: <554900D8.9050408@gmail.com> Date: Tue, 05 May 2015 18:41:44 +0100 From: =?UTF-8?B?U2NoYWxrIENyb25qw6k=?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: users@groovy.incubator.apache.org Subject: Re: respondsTo and constructors References: <55439256.8010304@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org I did this for the time being. It works, but I'm not happy about it. https://github.com/ysb33r/gradleTest/blob/master/src/main/groovy/org/ysb33r/gradle/gradletest/internal/Unpacker.groovy#L37 Lines 37-43. On 03/05/2015 15:56, Dinko Srkoč wrote: > On 1 May 2015 at 16:48, Schalk Cronjé wrote: >> I cannot figure out how to check for a constructor using respondsTo. If I >> had the following >> >> class ABC { >> ABC(String s, File f) {} >> } >> >> How can I use respondsTo to see if the constructor exists? > It appears that you cannot. There's a > `MetaClassImpl#retrieveConstructor(Class[])` that may help, or one can > always fallback to Java reflection API. > > Cheers, > Dinko > >> -- >> Schalk W. Cronjé >> Twitter / Ello / Toeter : @ysb33r -- Schalk W. Cronjé Twitter / Ello / Toeter : @ysb33r