[jira] [Commented] (GROOVY-8332) Packaging issue for Antlr4-related jars

2017-09-28 Thread Paul King (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16185380#comment-16185380
 ] 

Paul King commented on GROOVY-8332:
---

It's still not clear to me if it's required. We'd want @NonNull checking when 
we compile the grammar but after that?

> Packaging issue for Antlr4-related jars
> ---
>
> Key: GROOVY-8332
> URL: https://issues.apache.org/jira/browse/GROOVY-8332
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.6.0-alpha-1
>Reporter: Paul King
>
> The 2.6.0-alpha-1 jars have some incorrect service metadata.
> To reproduce, create a gradle project containing the following files:
> {code:title=Calc.java}
> public class Calc {
> public static int sum(int a, int b) { return a + b; }
> }
> {code}
> {code:title=CalcTest.groovy}
> class CalcTest extends GroovyTestCase {
> void testSum() { assert 3 == Calc.sum(1, 2) }
> }
> {code}
> {code:title=build.gradle}
> group 'calc'
> version '1.0-SNAPSHOT'
> apply plugin: 'groovy'
> sourceCompatibility = 1.8
> repositories {
> mavenCentral()
> }
> dependencies {
> compile 'org.codehaus.groovy:groovy-all:2.6.0-alpha-1'
> testCompile 'junit:junit:4.12'
> }
> {code}
> When invoking the {{test}} task via gradle, the following error is observed:
> {noformat}
> :compileJava
> error: Bad service configuration file, or exception thrown while constructing 
> Processor object: javax.annotation.processing.Processor: Provider 
> org.antlr.v4.runtime.misc.RuleDependencyProcessor not found
> :compileJava FAILED
> {noformat}
> I believe we need to reference:
> {{groovyjarjarantlr4.v4.runtime.misc.RuleDependencyProcessor}}
> instead of:
> {{org.antlr.v4.runtime.misc.RuleDependencyProcessor}}
> in our jarjar'd jar files within this file:
> {{META-INF/services/javax.annotation.processing.Processor}}
> We might need to roll this by hand since I suspect we won't be able to 
> configure the antlr gradle plugin to do such a change.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (GROOVY-8333) Create an optional unicode reader for the Parrot parser

2017-09-28 Thread Daniel Sun (JIRA)

 [ 
https://issues.apache.org/jira/browse/GROOVY-8333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Sun updated GROOVY-8333:
---
External issue URL: https://issues.apache.org/jira/browse/GROOVY-8312

> Create an optional unicode reader for the Parrot parser
> ---
>
> Key: GROOVY-8333
> URL: https://issues.apache.org/jira/browse/GROOVY-8333
> Project: Groovy
>  Issue Type: Improvement
>Reporter: Daniel Sun
>Priority: Minor
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-8332) Packaging issue for Antlr4-related jars

2017-09-28 Thread Daniel Sun (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16185347#comment-16185347
 ] 

Daniel Sun commented on GROOVY-8332:


I guess annotations like @NotNull requires the processor.

> Packaging issue for Antlr4-related jars
> ---
>
> Key: GROOVY-8332
> URL: https://issues.apache.org/jira/browse/GROOVY-8332
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.6.0-alpha-1
>Reporter: Paul King
>
> The 2.6.0-alpha-1 jars have some incorrect service metadata.
> To reproduce, create a gradle project containing the following files:
> {code:title=Calc.java}
> public class Calc {
> public static int sum(int a, int b) { return a + b; }
> }
> {code}
> {code:title=CalcTest.groovy}
> class CalcTest extends GroovyTestCase {
> void testSum() { assert 3 == Calc.sum(1, 2) }
> }
> {code}
> {code:title=build.gradle}
> group 'calc'
> version '1.0-SNAPSHOT'
> apply plugin: 'groovy'
> sourceCompatibility = 1.8
> repositories {
> mavenCentral()
> }
> dependencies {
> compile 'org.codehaus.groovy:groovy-all:2.6.0-alpha-1'
> testCompile 'junit:junit:4.12'
> }
> {code}
> When invoking the {{test}} task via gradle, the following error is observed:
> {noformat}
> :compileJava
> error: Bad service configuration file, or exception thrown while constructing 
> Processor object: javax.annotation.processing.Processor: Provider 
> org.antlr.v4.runtime.misc.RuleDependencyProcessor not found
> :compileJava FAILED
> {noformat}
> I believe we need to reference:
> {{groovyjarjarantlr4.v4.runtime.misc.RuleDependencyProcessor}}
> instead of:
> {{org.antlr.v4.runtime.misc.RuleDependencyProcessor}}
> in our jarjar'd jar files within this file:
> {{META-INF/services/javax.annotation.processing.Processor}}
> We might need to roll this by hand since I suspect we won't be able to 
> configure the antlr gradle plugin to do such a change.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-8332) Packaging issue for Antlr4-related jars

2017-09-28 Thread Paul King (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16185330#comment-16185330
 ] 

Paul King commented on GROOVY-8332:
---

jarjar does some reference replacement but obviously doesn't know about the 
reference in this file. Actually, I am wondering if we even need a reference to 
that processor at all or is it only needed during grammar generation. I haven't 
looked into that part of antlr4 yet.

> Packaging issue for Antlr4-related jars
> ---
>
> Key: GROOVY-8332
> URL: https://issues.apache.org/jira/browse/GROOVY-8332
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.6.0-alpha-1
>Reporter: Paul King
>
> The 2.6.0-alpha-1 jars have some incorrect service metadata.
> To reproduce, create a gradle project containing the following files:
> {code:title=Calc.java}
> public class Calc {
> public static int sum(int a, int b) { return a + b; }
> }
> {code}
> {code:title=CalcTest.groovy}
> class CalcTest extends GroovyTestCase {
> void testSum() { assert 3 == Calc.sum(1, 2) }
> }
> {code}
> {code:title=build.gradle}
> group 'calc'
> version '1.0-SNAPSHOT'
> apply plugin: 'groovy'
> sourceCompatibility = 1.8
> repositories {
> mavenCentral()
> }
> dependencies {
> compile 'org.codehaus.groovy:groovy-all:2.6.0-alpha-1'
> testCompile 'junit:junit:4.12'
> }
> {code}
> When invoking the {{test}} task via gradle, the following error is observed:
> {noformat}
> :compileJava
> error: Bad service configuration file, or exception thrown while constructing 
> Processor object: javax.annotation.processing.Processor: Provider 
> org.antlr.v4.runtime.misc.RuleDependencyProcessor not found
> :compileJava FAILED
> {noformat}
> I believe we need to reference:
> {{groovyjarjarantlr4.v4.runtime.misc.RuleDependencyProcessor}}
> instead of:
> {{org.antlr.v4.runtime.misc.RuleDependencyProcessor}}
> in our jarjar'd jar files within this file:
> {{META-INF/services/javax.annotation.processing.Processor}}
> We might need to roll this by hand since I suspect we won't be able to 
> configure the antlr gradle plugin to do such a change.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-8312) [Parrot]Deprecate useless features on unicode sequences

2017-09-28 Thread Paul King (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16185304#comment-16185304
 ] 

Paul King commented on GROOVY-8312:
---

Thanks!

> [Parrot]Deprecate useless features on unicode sequences
> ---
>
> Key: GROOVY-8312
> URL: https://issues.apache.org/jira/browse/GROOVY-8312
> Project: Groovy
>  Issue Type: Improvement
>Affects Versions: 2.6.0-alpha-1
>Reporter: Daniel Sun
>Assignee: Daniel Sun
> Fix For: 2.6.0-alpha-2
>
>
> 1) Declaring identifier with unicode sequences , e.g.  `def \u4e00\u9fa5 =
> 123`
> 2) All source code is written in unicode sequence, e.g. `\u0064\u0065\u0066
> \u0061 \u003d \u0031\u0032\u0033`, the corresponding readable code is `def a
> = 123` 
> 3) Unicode sequences like `\uu9fa5` is allowed in Groovy



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-8332) Packaging issue for Antlr4-related jars

2017-09-28 Thread Daniel Sun (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16185290#comment-16185290
 ] 

Daniel Sun commented on GROOVY-8332:


Is it possible to replace org.antlr.v4.runtime.misc.RuleDependencyProcessor 
with groovyjarjarantlr4.v4.runtime.misc.RuleDependencyProcessor in the jarjar 
task?

> Packaging issue for Antlr4-related jars
> ---
>
> Key: GROOVY-8332
> URL: https://issues.apache.org/jira/browse/GROOVY-8332
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.6.0-alpha-1
>Reporter: Paul King
>
> The 2.6.0-alpha-1 jars have some incorrect service metadata.
> To reproduce, create a gradle project containing the following files:
> {code:title=Calc.java}
> public class Calc {
> public static int sum(int a, int b) { return a + b; }
> }
> {code}
> {code:title=CalcTest.groovy}
> class CalcTest extends GroovyTestCase {
> void testSum() { assert 3 == Calc.sum(1, 2) }
> }
> {code}
> {code:title=build.gradle}
> group 'calc'
> version '1.0-SNAPSHOT'
> apply plugin: 'groovy'
> sourceCompatibility = 1.8
> repositories {
> mavenCentral()
> }
> dependencies {
> compile 'org.codehaus.groovy:groovy-all:2.6.0-alpha-1'
> testCompile 'junit:junit:4.12'
> }
> {code}
> When invoking the {{test}} task via gradle, the following error is observed:
> {noformat}
> :compileJava
> error: Bad service configuration file, or exception thrown while constructing 
> Processor object: javax.annotation.processing.Processor: Provider 
> org.antlr.v4.runtime.misc.RuleDependencyProcessor not found
> :compileJava FAILED
> {noformat}
> I believe we need to reference:
> {{groovyjarjarantlr4.v4.runtime.misc.RuleDependencyProcessor}}
> instead of:
> {{org.antlr.v4.runtime.misc.RuleDependencyProcessor}}
> in our jarjar'd jar files within this file:
> {{META-INF/services/javax.annotation.processing.Processor}}
> We might need to roll this by hand since I suspect we won't be able to 
> configure the antlr gradle plugin to do such a change.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-8312) [Parrot]Deprecate useless features on unicode sequences

2017-09-28 Thread Daniel Sun (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16185293#comment-16185293
 ] 

Daniel Sun commented on GROOVY-8312:


 GROOVY-8333 was created just now

> [Parrot]Deprecate useless features on unicode sequences
> ---
>
> Key: GROOVY-8312
> URL: https://issues.apache.org/jira/browse/GROOVY-8312
> Project: Groovy
>  Issue Type: Improvement
>Affects Versions: 2.6.0-alpha-1
>Reporter: Daniel Sun
>Assignee: Daniel Sun
> Fix For: 2.6.0-alpha-2
>
>
> 1) Declaring identifier with unicode sequences , e.g.  `def \u4e00\u9fa5 =
> 123`
> 2) All source code is written in unicode sequence, e.g. `\u0064\u0065\u0066
> \u0061 \u003d \u0031\u0032\u0033`, the corresponding readable code is `def a
> = 123` 
> 3) Unicode sequences like `\uu9fa5` is allowed in Groovy



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GROOVY-8333) Create an optional unicode reader for the Parrot parser

2017-09-28 Thread Daniel Sun (JIRA)
Daniel Sun created GROOVY-8333:
--

 Summary: Create an optional unicode reader for the Parrot parser
 Key: GROOVY-8333
 URL: https://issues.apache.org/jira/browse/GROOVY-8333
 Project: Groovy
  Issue Type: Improvement
Reporter: Daniel Sun
Priority: Minor






--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-8312) [Parrot]Deprecate useless features on unicode sequences

2017-09-28 Thread Daniel Sun (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16185283#comment-16185283
 ] 

Daniel Sun commented on GROOVY-8312:


Not yet...

> [Parrot]Deprecate useless features on unicode sequences
> ---
>
> Key: GROOVY-8312
> URL: https://issues.apache.org/jira/browse/GROOVY-8312
> Project: Groovy
>  Issue Type: Improvement
>Affects Versions: 2.6.0-alpha-1
>Reporter: Daniel Sun
>Assignee: Daniel Sun
> Fix For: 2.6.0-alpha-2
>
>
> 1) Declaring identifier with unicode sequences , e.g.  `def \u4e00\u9fa5 =
> 123`
> 2) All source code is written in unicode sequence, e.g. `\u0064\u0065\u0066
> \u0061 \u003d \u0031\u0032\u0033`, the corresponding readable code is `def a
> = 123` 
> 3) Unicode sequences like `\uu9fa5` is allowed in Groovy



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-4610) GroovyInterceptable (AOP) not working with closures

2017-09-28 Thread John Mercier (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-4610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16184454#comment-16184454
 ] 

John Mercier commented on GROOVY-4610:
--

Is there a workaround for this issue?

> GroovyInterceptable (AOP) not working with closures
> ---
>
> Key: GROOVY-4610
> URL: https://issues.apache.org/jira/browse/GROOVY-4610
> Project: Groovy
>  Issue Type: Bug
>  Components: groovy-runtime
> Environment: JDK 1.6.x, Grails 1.2.1
>Reporter: Sunny Thandassery
>
> I've got a grails app with Service classes that inherit from Groovy's 
> GroovyInterceptable: 
> [code] 
> class customerSerrvice implements GroovyInterceptable { 
> private List customers 
> def invokeMethod(String name, args) { 
> log.debug "===>INVOKING method [$name] with args:$args" 
> } 
> void foo() { 
> customers.each { doSomething(it) } 
> } 
> void doSomething(Customer cust) { log.debug "doSomething invoked with 
> $cust" } 
> } 
> [/code] 
> If I call foo() or doSomething() **directly** from another class, the 
> invokeMethod gets called like it is supposed to. However, when foo() calls 
> doSomething(), that call is not intercepted in invokeMethod. 
> If I change from   
> `customers.each { doSomething(it) }`   
> to   
> `for(Customer cust: customers) { doSomething(cust) }`   
> then the invokeMethod gets called just fine. 
> There appears to be an ExpandoMetaClass bug that prevents closures and 
> GroovyInterceptable from working together.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-8312) [Parrot]Deprecate useless features on unicode sequences

2017-09-28 Thread Paul King (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16183916#comment-16183916
 ] 

Paul King commented on GROOVY-8312:
---

[~daniel_sun] Has an issue been created for the optional unicode reader idea?

> [Parrot]Deprecate useless features on unicode sequences
> ---
>
> Key: GROOVY-8312
> URL: https://issues.apache.org/jira/browse/GROOVY-8312
> Project: Groovy
>  Issue Type: Improvement
>Affects Versions: 2.6.0-alpha-1
>Reporter: Daniel Sun
>Assignee: Daniel Sun
> Fix For: 2.6.0-alpha-2
>
>
> 1) Declaring identifier with unicode sequences , e.g.  `def \u4e00\u9fa5 =
> 123`
> 2) All source code is written in unicode sequence, e.g. `\u0064\u0065\u0066
> \u0061 \u003d \u0031\u0032\u0033`, the corresponding readable code is `def a
> = 123` 
> 3) Unicode sequences like `\uu9fa5` is allowed in Groovy



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (GROOVY-8332) Packaging issue for Antlr4-related jars

2017-09-28 Thread Paul King (JIRA)

 [ 
https://issues.apache.org/jira/browse/GROOVY-8332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King updated GROOVY-8332:
--
Description: 
The 2.6.0-alpha-1 jars have some incorrect service metadata.

To reproduce, create a gradle project containing the following files:
{code:title=Calc.java}
public class Calc {
public static int sum(int a, int b) { return a + b; }
}
{code}
{code:title=CalcTest.groovy}
class CalcTest extends GroovyTestCase {
void testSum() { assert 3 == Calc.sum(1, 2) }
}
{code}
{code:title=build.gradle}
group 'calc'
version '1.0-SNAPSHOT'

apply plugin: 'groovy'

sourceCompatibility = 1.8

repositories {
mavenCentral()
}

dependencies {
compile 'org.codehaus.groovy:groovy-all:2.6.0-alpha-1'
testCompile 'junit:junit:4.12'
}
{code}
When invoking the {{test}} task via gradle, the following error is observed:
{noformat}
:compileJava
error: Bad service configuration file, or exception thrown while constructing 
Processor object: javax.annotation.processing.Processor: Provider 
org.antlr.v4.runtime.misc.RuleDependencyProcessor not found
:compileJava FAILED
{noformat}
I believe we need to reference:
{{groovyjarjarantlr4.v4.runtime.misc.RuleDependencyProcessor}}
instead of:
{{org.antlr.v4.runtime.misc.RuleDependencyProcessor}}
in our jarjar'd jar files within this file:
{{META-INF/services/javax.annotation.processing.Processor}}

We might need to roll this by hand since I suspect we won't be able to 
configure the antlr gradle plugin to do such a change.

> Packaging issue for Antlr4-related jars
> ---
>
> Key: GROOVY-8332
> URL: https://issues.apache.org/jira/browse/GROOVY-8332
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.6.0-alpha-1
>Reporter: Paul King
>
> The 2.6.0-alpha-1 jars have some incorrect service metadata.
> To reproduce, create a gradle project containing the following files:
> {code:title=Calc.java}
> public class Calc {
> public static int sum(int a, int b) { return a + b; }
> }
> {code}
> {code:title=CalcTest.groovy}
> class CalcTest extends GroovyTestCase {
> void testSum() { assert 3 == Calc.sum(1, 2) }
> }
> {code}
> {code:title=build.gradle}
> group 'calc'
> version '1.0-SNAPSHOT'
> apply plugin: 'groovy'
> sourceCompatibility = 1.8
> repositories {
> mavenCentral()
> }
> dependencies {
> compile 'org.codehaus.groovy:groovy-all:2.6.0-alpha-1'
> testCompile 'junit:junit:4.12'
> }
> {code}
> When invoking the {{test}} task via gradle, the following error is observed:
> {noformat}
> :compileJava
> error: Bad service configuration file, or exception thrown while constructing 
> Processor object: javax.annotation.processing.Processor: Provider 
> org.antlr.v4.runtime.misc.RuleDependencyProcessor not found
> :compileJava FAILED
> {noformat}
> I believe we need to reference:
> {{groovyjarjarantlr4.v4.runtime.misc.RuleDependencyProcessor}}
> instead of:
> {{org.antlr.v4.runtime.misc.RuleDependencyProcessor}}
> in our jarjar'd jar files within this file:
> {{META-INF/services/javax.annotation.processing.Processor}}
> We might need to roll this by hand since I suspect we won't be able to 
> configure the antlr gradle plugin to do such a change.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GROOVY-8332) Packaging issue for Antlr4-related jars

2017-09-28 Thread Paul King (JIRA)
Paul King created GROOVY-8332:
-

 Summary: Packaging issue for Antlr4-related jars
 Key: GROOVY-8332
 URL: https://issues.apache.org/jira/browse/GROOVY-8332
 Project: Groovy
  Issue Type: Bug
Affects Versions: 2.6.0-alpha-1
Reporter: Paul King






--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-7906) groovy-2.4.7/bin/startGroovy: line 275: syntax error: bad substitution

2017-09-28 Thread Keegan Witt (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-7906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16183756#comment-16183756
 ] 

Keegan Witt commented on GROOVY-7906:
-

Agreed.  I left this issue open so we can do a more permanent fix.

> groovy-2.4.7/bin/startGroovy: line 275: syntax error: bad substitution
> --
>
> Key: GROOVY-7906
> URL: https://issues.apache.org/jira/browse/GROOVY-7906
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.4.7
> Environment: Alpine linux (=> no bash, busybox only)
>Reporter: Peter Butkovic
>
> running groovy in alpine linux results in:
> {code}
> /tmp/groovy-2.4.7/bin/startGroovy: line 275: syntax error: bad substitution
> {code}
> as a workaround I'm running:
> {code}
> sed -ie '274,275d' /tmp/groovy-2.4.7/bin/startGroovy
> {code}
> prior to invoking groovy



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (GROOVY-8220) GroovyCastException with CompileStatic

2017-09-28 Thread paolo di tommaso (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16183715#comment-16183715
 ] 

paolo di tommaso edited comment on GROOVY-8220 at 9/28/17 6:09 AM:
---

Yes, now the CI build is 
[green|http://ci.groovy-lang.org/viewLog.html?buildTypeId=JointBuilds_Nextflow_Groovy24xJointBuild=42830]!
 Thanks you all.  


was (Author: pablo72):
Yes, the the CI build is 
[green|http://ci.groovy-lang.org/viewLog.html?buildTypeId=JointBuilds_Nextflow_Groovy24xJointBuild=42830]!
 Thanks you all.  

> GroovyCastException with CompileStatic
> --
>
> Key: GROOVY-8220
> URL: https://issues.apache.org/jira/browse/GROOVY-8220
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.5.0-beta-1, 2.4.12
>Reporter: paolo di tommaso
>Assignee: John Wagenleitner
> Fix For: 2.4.13
>
>
> {code}
> @groovy.transform.CompileStatic
> class Foo {
> CharSequence makeEnv( env, StringBuilder result = new StringBuilder() ) {
> if( env instanceof File ) {
> env = env.toPath()
> }
> if( env instanceof String && env.contains('=') ) {
> result << 'export ' << env << ';'
> }
> return result.toString()
> }
> }
> assert new Foo().makeEnv('X=1') == 'export X=1;'
> Exception thrown
> org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast 
> object 'X=1' with class 'java.lang.String' to class 'java.lang.Iterable'
>   at Foo.makeEnv(ConsoleScript5:10)
>   at Foo.makeEnv(ConsoleScript5:4)
>   at Foo$makeEnv.call(Unknown Source)
>   at ConsoleScript5.run(ConsoleScript5:20)
> {code}
> Without CompileStatic it works as expected. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-8220) GroovyCastException with CompileStatic

2017-09-28 Thread paolo di tommaso (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16183715#comment-16183715
 ] 

paolo di tommaso commented on GROOVY-8220:
--

Yes, the the CI build is 
[green|http://ci.groovy-lang.org/viewLog.html?buildTypeId=JointBuilds_Nextflow_Groovy24xJointBuild=42830]!
 Thanks you all.  

> GroovyCastException with CompileStatic
> --
>
> Key: GROOVY-8220
> URL: https://issues.apache.org/jira/browse/GROOVY-8220
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.5.0-beta-1, 2.4.12
>Reporter: paolo di tommaso
>Assignee: John Wagenleitner
> Fix For: 2.4.13
>
>
> {code}
> @groovy.transform.CompileStatic
> class Foo {
> CharSequence makeEnv( env, StringBuilder result = new StringBuilder() ) {
> if( env instanceof File ) {
> env = env.toPath()
> }
> if( env instanceof String && env.contains('=') ) {
> result << 'export ' << env << ';'
> }
> return result.toString()
> }
> }
> assert new Foo().makeEnv('X=1') == 'export X=1;'
> Exception thrown
> org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast 
> object 'X=1' with class 'java.lang.String' to class 'java.lang.Iterable'
>   at Foo.makeEnv(ConsoleScript5:10)
>   at Foo.makeEnv(ConsoleScript5:4)
>   at Foo$makeEnv.call(Unknown Source)
>   at ConsoleScript5.run(ConsoleScript5:20)
> {code}
> Without CompileStatic it works as expected. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)