[jira] [Resolved] (GROOVY-7312) Compiler generates invalid inner class constructor

2016-02-24 Thread Shil Sinha (JIRA)

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

Shil Sinha resolved GROOVY-7312.

   Resolution: Fixed
Fix Version/s: 2.4.7

> Compiler generates invalid inner class constructor
> --
>
> Key: GROOVY-7312
> URL: https://issues.apache.org/jira/browse/GROOVY-7312
> Project: Groovy
>  Issue Type: Bug
>  Components: class generator, Compiler
>Affects Versions: 2.4.0
>Reporter: Adam Lewandowski
>Assignee: Shil Sinha
>Priority: Minor
> Fix For: 2.4.7
>
>
> replacement description:
> {code:title=Intf.groovy|borderStyle=solid}
> interface Intf {
>   def foo = { "bar" }
> }
> {code}
> Will create an inner class that lacks the static modifier for the inner class 
> table. Compare with
> {code:title=JavaInterface.java}
> public interface JavaInterface {
>   class NestedInInterface {}
> }
> {code}for reference
> Original description:
> The JLS specifies that an implicitly-declared constructor of a non-private 
> inner class "implicitly declares one formal parameter representing the 
> immediately enclosing instance of the class" ([Section 
> 8.8.9|http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.8.9], 
> see also 
> [8.8.1|http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.8.1]).
>  
> {code:title=Intf.groovy|borderStyle=solid}
> interface Intf {
>   def foo = { "bar" }
> }
> {code}
> The above code creates an inner class (Intf$1, not exactly sure what it's 
> for) with a default constructor that has no parameters:
> {noformat}
> $ javap -p -classpath classes 'Intf$1'
> Compiled from "Intf.groovy"
> class Intf$1 implements groovy.lang.GroovyObject {
>   ...
>   public Intf$1();
>   ...
> }
> {noformat}
> While not a major issue, this non-conformance can break interoperability with 
> anything that expects to work with Java classes. This particular example came 
> up while trying to use a similarly-declared Groovy class from a Scala class, 
> where the Scala compiler was unable to parse the generated inner class.
> For reference, here is an example Java Inner class and it's compiled 
> representation. Note the constructor parameter on the inner class.
> {code:title=JavaObj.java|borderStyle=solid}
> public class JavaObj {
>   public class Inner {}
> }
> {code}
> {noformat}
> $ javap -p -classpath classes 'JavaObj$Inner'
> public class JavaObj$Inner {
>   final JavaObj this$0;
>   public JavaObj$Inner(JavaObj);
> }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (GROOVY-7312) Compiler generates invalid inner class constructor

2016-02-24 Thread Shil Sinha (JIRA)

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

Shil Sinha reassigned GROOVY-7312:
--

Assignee: Shil Sinha

> Compiler generates invalid inner class constructor
> --
>
> Key: GROOVY-7312
> URL: https://issues.apache.org/jira/browse/GROOVY-7312
> Project: Groovy
>  Issue Type: Bug
>  Components: class generator, Compiler
>Affects Versions: 2.4.0
>Reporter: Adam Lewandowski
>Assignee: Shil Sinha
>Priority: Minor
> Fix For: 2.4.7
>
>
> replacement description:
> {code:title=Intf.groovy|borderStyle=solid}
> interface Intf {
>   def foo = { "bar" }
> }
> {code}
> Will create an inner class that lacks the static modifier for the inner class 
> table. Compare with
> {code:title=JavaInterface.java}
> public interface JavaInterface {
>   class NestedInInterface {}
> }
> {code}for reference
> Original description:
> The JLS specifies that an implicitly-declared constructor of a non-private 
> inner class "implicitly declares one formal parameter representing the 
> immediately enclosing instance of the class" ([Section 
> 8.8.9|http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.8.9], 
> see also 
> [8.8.1|http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.8.1]).
>  
> {code:title=Intf.groovy|borderStyle=solid}
> interface Intf {
>   def foo = { "bar" }
> }
> {code}
> The above code creates an inner class (Intf$1, not exactly sure what it's 
> for) with a default constructor that has no parameters:
> {noformat}
> $ javap -p -classpath classes 'Intf$1'
> Compiled from "Intf.groovy"
> class Intf$1 implements groovy.lang.GroovyObject {
>   ...
>   public Intf$1();
>   ...
> }
> {noformat}
> While not a major issue, this non-conformance can break interoperability with 
> anything that expects to work with Java classes. This particular example came 
> up while trying to use a similarly-declared Groovy class from a Scala class, 
> where the Scala compiler was unable to parse the generated inner class.
> For reference, here is an example Java Inner class and it's compiled 
> representation. Note the constructor parameter on the inner class.
> {code:title=JavaObj.java|borderStyle=solid}
> public class JavaObj {
>   public class Inner {}
> }
> {code}
> {noformat}
> $ javap -p -classpath classes 'JavaObj$Inner'
> public class JavaObj$Inner {
>   final JavaObj this$0;
>   public JavaObj$Inner(JavaObj);
> }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] groovy pull request: GROOVY-7312 Add ACC_STATIC flag to inner clas...

2016-02-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/groovy/pull/257


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] groovy pull request: Update style-guide.adoc

2016-02-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/groovy/pull/273


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] groovy pull request: Update style-guide.adoc

2016-02-24 Thread leoxy520
GitHub user leoxy520 opened a pull request:

https://github.com/apache/groovy/pull/273

Update style-guide.adoc

Could it be a typo on the operator ==~ ?

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/leoxy520/groovy patch-1

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/groovy/pull/273.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #273


commit 585ba0e8eba8ddd748cd23e0515c356754928c7a
Author: Leo Jiapei Lin 
Date:   2016-02-12T20:12:43Z

Update style-guide.adoc

Could it be a typo on the operator ==~ ?




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Created] (GROOVY-7767) Single-parameter method chosen zero parameters passed

2016-02-24 Thread Mike Martin (JIRA)
Mike Martin created GROOVY-7767:
---

 Summary: Single-parameter method chosen zero parameters passed
 Key: GROOVY-7767
 URL: https://issues.apache.org/jira/browse/GROOVY-7767
 Project: Groovy
  Issue Type: Bug
Affects Versions: 2.4.6
Reporter: Mike Martin


When there is a single variant of a given method name, and that method has a 
single parameter, then calls to that method with zero arguments will result in 
a call to the method with a value of {{null}}, even though the no argument is 
present in the actual method call. This is surprising and leads to silent 
errors. Instead, I would expect groovy to throw an error saying that no 
matching method could be found.

Example:
{code}
new A()

class A {

A(){
m()
}

void m(String param){
println "param: $param"
}
}
{code}

Running the code above yields:
{code}
param: null
{code}

But I would expect it to yield something like:
{code}
Caught: groovy.lang.MissingMethodException: No signature of method: A.m() is 
applicable for argument types: () values: []
Possible solutions: m(java.lang.String), is(java.lang.Object), dump(), any(), 
any(groovy.lang.Closure), use([Ljava.lang.Object;)
groovy.lang.MissingMethodException: No signature of method: A.m() is applicable 
for argument types: () values: []
Possible solutions: m(java.lang.String), is(java.lang.Object), dump(), any(), 
any(groovy.lang.Closure), use([Ljava.lang.Object;)
at A.(testClass2.groovy:8)
at testClass2.run(testClass2.groovy:3)
{code}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] groovy pull request: Update external libraries

2016-02-24 Thread oreissig
GitHub user oreissig opened a pull request:

https://github.com/apache/groovy/pull/272

Update external libraries

I did some minor updates for external libraries used by Groovy. None of 
this should be breaking in any way.

What I didn't update for now:
* log4j 2.3 -> 2.5 broke some tests in a way I could not resolve immediately
* servlet-api 2.4 -> 2.5 was not immediately clear to me whether this was 
fully compatible, left alone updating to servlet-api 3.x

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/oreissig/groovy update-libs

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/groovy/pull/272.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #272


commit 64e353a579a0b1a0650226232e682334220cb45c
Author: oreissig 
Date:   2016-02-24T21:16:57Z

update asm 5.0.3 -> 5.0.4

commit 69806c2e4c298e0f23f3b5cec58c098b9b473dfa
Author: oreissig 
Date:   2016-02-24T21:17:11Z

update jline 2.12 -> 2.13

commit ad3b004f9852b60692b2ee6be5dfda651a528b35
Author: oreissig 
Date:   2016-02-24T21:17:26Z

update testng 6.9.4 -> 6.9.10

commit 6affd6b3506bd96e07e6f9121c502d4ecaff4265
Author: oreissig 
Date:   2016-02-24T21:32:17Z

update hsqldb 2.3.2 -> 2.3.3

commit 3bf37c92b47b69cd3abc2d6ee23ae1377cd42739
Author: oreissig 
Date:   2016-02-24T21:32:41Z

update commons-math3 3.5 -> 3.6

commit 9d45d850a7afd8046a1c9269e07afce45527d66f
Author: oreissig 
Date:   2016-02-24T21:33:02Z

update slf4j 1.7.12 -> 1.7.16

commit d45f6bc9523062210bc81b699ff6a96b42237022
Author: oreissig 
Date:   2016-02-24T21:33:25Z

update logback 1.1.3 -> 1.1.5




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Created] (GROOVY-7765) Dollar Slashy String in assert not working left hand side

2016-02-24 Thread dariusan (JIRA)
dariusan created GROOVY-7765:


 Summary: Dollar Slashy String in assert not working left hand side 
 Key: GROOVY-7765
 URL: https://issues.apache.org/jira/browse/GROOVY-7765
 Project: Groovy
  Issue Type: Bug
Affects Versions: 2.4.5
Reporter: dariusan


{code}
assert 'aaa'==$/aaa/$ //works 

assert $/aaa/$=='aaa' //fails with Invalid variable name. Must include a letter 
but only found: $

{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)