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 0CF3119ED7 for ; Wed, 23 Mar 2016 09:13:45 +0000 (UTC) Received: (qmail 46844 invoked by uid 500); 23 Mar 2016 09:13:44 -0000 Delivered-To: apmail-groovy-users-archive@groovy.apache.org Received: (qmail 46812 invoked by uid 500); 23 Mar 2016 09:13:44 -0000 Mailing-List: contact users-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.apache.org Delivered-To: mailing list users@groovy.apache.org Received: (qmail 46800 invoked by uid 99); 23 Mar 2016 09:13:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Mar 2016 09:13:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 51D2318021D for ; Wed, 23 Mar 2016 09:13:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.288 X-Spam-Level: * X-Spam-Status: No, score=1.288 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=misys0365.onmicrosoft.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id hLV-I7HVvS_L for ; Wed, 23 Mar 2016 09:13:41 +0000 (UTC) Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [208.87.233.190]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 25B9C5FB22 for ; Wed, 23 Mar 2016 09:13:40 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01lp0211.outbound.protection.outlook.com [213.199.154.211]) by rly08g.srv.mailcontrol.com (MailControl) with ESMTPS id u2N9DMAY043085 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=OK); Wed, 23 Mar 2016 09:13:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=misys0365.onmicrosoft.com; s=selector1-misys-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=iqORe8Kyq6H/yKA4w84tTCV9p6WZuIRAv4NVyLXPbr4=; b=B/KY2jwxC+k/dPYZVKQBkXX5FA+zkczI7o+0frO8Ild6teaaJVvlc56soO4IHDzzdxV0Q/EgMvgL93C8/pwOaGZum/FbOCW7+gpAFVTq+ZaIJKWlt4rkvNDE722H+McWfyvR5EhO65HaUURVAmHbFbK9bFkHZbDMs38rPDYEeoA= Received: from VI1PR06MB1822.eurprd06.prod.outlook.com (10.165.237.152) by VI1PR06MB1822.eurprd06.prod.outlook.com (10.165.237.152) with Microsoft SMTP Server (TLS) id 15.1.443.12; Wed, 23 Mar 2016 09:13:21 +0000 Received: from VI1PR06MB1822.eurprd06.prod.outlook.com ([10.165.237.152]) by VI1PR06MB1822.eurprd06.prod.outlook.com ([10.165.237.152]) with mapi id 15.01.0443.015; Wed, 23 Mar 2016 09:13:21 +0000 From: "Marshall, Simon" To: "users@groovy.apache.org" , "Loic.DECLOEDT@cea.fr" CC: PAOLI Pierre EVADERIS , GUIU Vincent EVADERIS Subject: RE: Groovy runtime issue with multiple directories install Thread-Topic: Groovy runtime issue with multiple directories install Thread-Index: AdGE4CB7UtJL4TUgRRGiR//Lj4b+4gAAzGDw Date: Wed, 23 Mar 2016 09:13:21 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: authentication-results: groovy.apache.org; dkim=none (message not signed) header.d=none;groovy.apache.org; dmarc=none action=none header.from=misys.com; x-originating-ip: [109.176.92.70] x-ms-office365-filtering-correlation-id: a7458a00-cca6-4c25-2488-08d352fb61a2 x-microsoft-exchange-diagnostics: 1;VI1PR06MB1822;5:tihBH8jVP41GauwmBDHC8pCZYN8ToQk8I545Bp1FqTndS6sj3kCenZxdY2fGq/PHAb06ktEhZ19pJ2hYxFV1Ze6RlWxSk+SJ9YWEiML6ydr84O6ppNVk52+J9HvNXPvcJBAdU66QdDUoD9+b9OVExA==;24:JpJsRkJtz1kYzCdaH63o378AdT7gNk/xHZtEcDXkhV0ve+5JKknWU4EAsTujoniccr0LhrQmcckdyIt21yRr/gCQofid/oqAmsBsFH6KkC0= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR06MB1822; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(102415293)(102615271)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:VI1PR06MB1822;BCL:0;PCL:0;RULEID:;SRVR:VI1PR06MB1822; x-forefront-prvs: 08902E536D x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(76576001)(5001770100001)(19625215002)(5004730100002)(66066001)(76176999)(54356999)(86362001)(99936001)(50986999)(92566002)(19627595001)(74316001)(87936001)(586003)(17760045003)(189998001)(5003600100002)(33656002)(81166005)(10400500002)(2906002)(3280700002)(11100500001)(19300405004)(3660700001)(2501003)(102836003)(1220700001)(2900100001)(4326007)(19580395003)(16236675004)(6116002)(1096002)(19580405001)(790700001)(2950100001)(122556002)(3846002)(77096005)(15975445007)(5008740100001)(5002640100001)(18206015028)(5890100001);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR06MB1822;H:VI1PR06MB1822.eurprd06.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: multipart/related; boundary="_004_VI1PR06MB1822ED5BDFDEABDCB9D9BCCB94810VI1PR06MB1822eurp_"; type="multipart/alternative" MIME-Version: 1.0 X-OriginatorOrg: misys.com X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Mar 2016 09:13:21.7031 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d71c8ba3-6fff-4c9f-a6b4-3cac43ce65d7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR06MB1822 X-Scanned-By: MailControl 44278.1202 (www.mailcontrol.com) on 10.71.0.118 --_004_VI1PR06MB1822ED5BDFDEABDCB9D9BCCB94810VI1PR06MB1822eurp_ Content-Type: multipart/alternative; boundary="_000_VI1PR06MB1822ED5BDFDEABDCB9D9BCCB94810VI1PR06MB1822eurp_" --_000_VI1PR06MB1822ED5BDFDEABDCB9D9BCCB94810VI1PR06MB1822eurp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable The name of the enum is Gender, not Sex, so the decl of gender in C1 looks = dubious. The error message (referring to Sex) doesn=92t match the code (us= ing Gender), so I=92m wondering if the error message wasn=92t a result of t= he version of the code you pasted below? From: DECLOEDT Loic EVADERIS [mailto:Loic.DECLOEDT@cea.fr] Sent: 23 March 2016 09:02 To: users@groovy.apache.org Cc: PAOLI Pierre EVADERIS; GUIU Vincent EVADERIS Subject: Groovy runtime issue with multiple directories install Hi, I have a problem starting up a groovy project structured like this: project/ classes/ person/ C1.groovy scripts run.groovy The C1.groovy file contains the following code: package person import groovy.transform.ToString @ToString class C1 { enum Gender { M, F} String name Sex gender } And the run.groovy file contains the following code: import person.C1 //import person.C1.Gender def m =3D person.C1.Gender.M def f =3D person.C1.Gender.F println "genders: ${m}, ${f}" abstract class CScript extends groovy.lang.Script { public C1 addC1(String name, person.C1.Gender g) { return new C1(name:name, gender:g) } } def c =3D new C1(name: "max", gender: person.C1.Gender.M) println "c =3D ${c}" I have the following error when executing this code with the following comm= and from the project dir: groovy -cp $PWD/classes scripts/run.groovy org.codehaus.groovy.control.MultipleCompilationErrorsException: startup fai= led: /home/ldecloed/Groovy/workspace/issueImportEnum/scripts/run.groovy: 13: una= ble to resolve class person.C1.Sex @ line 13, column 32. public C1 addC1(String name, person.C1.Sex g) { ^ 1 error However, all errors disapear when commenting out the whole CScript class de= claration. As a result, the person.C1.Sex enum can be used outside the CSc= ript class declaration but not inside. In addtion, I tested a static compilation of the whole code and it works co= rrectly in this case. Can you clarify whether this code is valid ? If so, do you plan to improve = groovy to support it ? This test has been made with groovy 2.4.6. I can provide the sources if you= want a test-case. Regards, Lo=EFc. -- Lo=EFc Decloedt CAD & Software Manager eVaderis [eVaderis-logo-CMJN-small1] Minatec Entreprise BHT 7, Parvis Louis N=E9el 38054 Grenoble Cedex 9 France Office : 04 38 7 80874 "Misys" is the trade name of the Misys group of companies. This email and a= ny attachments have been scanned for known viruses using multiple scanners.= This email message is intended for the named recipient only. It may be pri= vileged and/or confidential. If you are not the named recipient of this ema= il please notify us immediately and do not copy it or use it for any purpos= e, nor disclose its contents to any other person. This email does not const= itute the commencement of legal relations between you and Misys. Please ref= er to the executed contract between you and the relevant member of the Misy= s group for the identity of the contracting party with which you are dealin= g. --_000_VI1PR06MB1822ED5BDFDEABDCB9D9BCCB94810VI1PR06MB1822eurp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable

The name of the enum i= s Gender, not Sex, so the decl of gender in C1 looks dubious.  The err= or message (referring to Sex) doesn=92t match the code (using Gender), so I= =92m wondering if the error message wasn=92t a result of the version of the code you pasted below?

 

From: DECLOEDT Loic EVADERIS [mailto:Loic.DECLOEDT@cea.fr]
Sent: 23 March 2016 09:02
To: users@groovy.apache.org
Cc: PAOLI Pierre EVADERIS; GUIU Vincent EVADERIS
Subject: Groovy runtime issue with multiple directories install=

 

Hi,

I have a problem starting up a = groovy project structured like this:

project/

 classes/

   person/

      C1.groovy

  scripts

   run.groovy

 

The C1.groovy file contains the= following code:

package person

import groovy.transform.ToString

 

@ToString

class C1 {

  enum Gender { M, F}

 

  String name

  Sex gender

}

 

And the run.groovy file contain= s the following code:

import person.C1

//import person.C1.Gender

def m =3D person.C1.Gender.M

def f =3D person.C1.Gender.F

println "genders: ${m}, ${f}"

 

abstract class CScript extends groovy.lang.Script {

  public C1 addC1(String name, person.C1.Gender g)= {

    return new C1(name:name, gender:g)

  }

}

 

def c =3D new C1(name: "max", gender: person.C1.Ge= nder.M)

 

println "c =3D ${c}"

 

I have the following error when= executing this code with the following command from the project dir:<= /o:p>

groovy -cp $PWD/classes scripts/run.groovy=

org.codehaus.groovy.control.MultipleCompilationErrorsExcepti= on: startup failed:

/home/ldecloed/Groovy/workspace/issueImportEnum/scripts/run.= groovy: 13: unable to resolve class person.C1.Sex

 @ line 13, column 32.

     public C1 addC1(String name, person= .C1.Sex g) {

          =             &nb= sp;           ^=

 

1 error

 

However, all errors disapear wh= en commenting out the whole CScript class declaration.  As a result, t= he person.C1.Sex enum can be used outside the CScript class declaration but= not inside.

In addtion, I tested a static c= ompilation of the whole code and it works correctly in this case.

Can you clarify whether this co= de is valid ? If so, do you plan to improve groovy to support it ?

This test has been made with gr= oovy 2.4.6. I can provide the sources if you want a test-case.

 

Regards,

Lo=EFc.

 

--

Lo=EFc Decloedt<= /span>

CAD & Software Manager<= o:p>

eVaderis<= /p>

3D"eVaderis-logo-CM=

 

Minatec Entreprise BHT

7, Parvis Louis N=E9el

38054 Grenoble Cedex 9

France

Office : 04 38 7 80874

 

"Misys" is the trade name of the Misys group of companies. This e= mail and any attachments have been scanned for known viruses using multiple= scanners. This email message is intended for the named recipient only. It = may be privileged and/or confidential. If you are not the named recipient of this email please notify us immediately= and do not copy it or use it for any purpose, nor disclose its contents to= any other person. This email does not constitute the commencement of legal= relations between you and Misys. Please refer to the executed contract between you and the relevant member = of the Misys group for the identity of the contracting party with which you= are dealing. --_000_VI1PR06MB1822ED5BDFDEABDCB9D9BCCB94810VI1PR06MB1822eurp_-- --_004_VI1PR06MB1822ED5BDFDEABDCB9D9BCCB94810VI1PR06MB1822eurp_ Content-Type: image/png; name="image001.png" Content-Description: image001.png Content-Disposition: inline; filename="image001.png"; size=2354; creation-date="Wed, 23 Mar 2016 09:13:21 GMT"; modification-date="Wed, 23 Mar 2016 09:13:21 GMT" Content-ID: Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAD4AAAASCAYAAAADr20JAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAO xAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUATWljcm9zb2Z0IE9mZmljZX/tNXEAAAiySURBVFhH 1VgHVFRnFv5Ghg5SpYiCoIISEUExgrAoIioJBoRFEIMaFaJo7LFELLEFl9gCrooFFDULG5Um6FpW LKCIBUMLNgQVBaRJm8Lkvn9gKOIxx3P2JHvPmQPz3v//9333fve79w1fImmRoFvjsatlryqRm/8U eYXP0FD3FqUVNahvFqK5oRnowYOqsgLGOAyFv7cLeDxuz3uO697Jn3aV/65nKeB8AppyLoOBGfqJ KaZ4OKK3oQ597yHbIhaLcSfnESKiTmPn/jOI3fstLAb2/b8A3wU4DyICc/hYKopLXsPX0xnWVv27 xKY9o3JycrCzMUfM3pVYuy0a7tNCcS15Bwz1tf/y4DsA56Gqug4/RsRjsLkxtoR+9Qdo2BYEHjav nonUS9nYHhmPnd8H/4G9f+6SVuA8vKmqxbbw4/D1Hgs720Gob2jC0bgLuHW3ECqKinBxsoY30R3o ro65APDg+4UTjsVdREtLC3r04Erir1vvBJwHgUCIf/wUB18fF6KuBdG8DBP9QlFWUQVbqwFoIjGL Op4K3zRnRO9eCj5frtt06Wpr4C0FTCAUQUlR4SNSKtUXqf1vg8YyfpBq2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