You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Batuhan Bayrakçı (JIRA)" <ji...@apache.org> on 2015/10/21 22:38:28 UTC

[jira] [Updated] (GROOVY-7641) StackOverflow Exception when calling method that has same signature as one that inside a closure

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

Batuhan Bayrakçı updated GROOVY-7641:
-------------------------------------
    Description: 
When i call a method that has same method signature as one inside Closure.groovy, it causes StackOverflow Exception

I have tried on recent revision of code from github.

{code:title=ImplClass.groovy|borderStyle=solid}
class ImplClass {

    def closureAsMethod = {
        run()
    }

    def method() {
        run()
    }

    def run() {
        println("run implementation")
    }

}
{code}

While {{new ImplClass().closureAsMethod()}} call runs as expected, {{new ImplClass().closureAsMethod()}} causes StackOverflow exception. Stack trace is in attachment.

In {{CallClosureFieldAsMethodTest.groovy}}, comment says _"Check that we can call a closure defined as a field as if it were a normal method"_
So, it is normal to wait same behavior as normal method.


  was:
When calling a method that has same method signature as one inside Closure.groovy causes StackOverflow Exception

I have tried on recent revision of code from github.

{code:title=ImplClass.groovy|borderStyle=solid}
class ImplClass {

    def closureAsMethod = {
        run()
    }

    def method() {
        run()
    }

    def run() {
        println("run implementation")
    }

}
{code}

While {{new ImplClass().closureAsMethod()}} call runs as expected, {{new ImplClass().closureAsMethod()}} causes StackOverflow exception. Stack trace is in attachment.

In {{CallClosureFieldAsMethodTest.groovy}}, comment says _"Check that we can call a closure defined as a field as if it were a normal method"_
So, it is normal to wait same behavior as normal method.



> StackOverflow Exception when calling method that has same signature as one that inside a closure
> ------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-7641
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7641
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-jdk
>         Environment: OSX Yosemite 10.10.5
>            Reporter: Batuhan Bayrakçı
>         Attachments: errorlog.txt
>
>
> When i call a method that has same method signature as one inside Closure.groovy, it causes StackOverflow Exception
> I have tried on recent revision of code from github.
> {code:title=ImplClass.groovy|borderStyle=solid}
> class ImplClass {
>     def closureAsMethod = {
>         run()
>     }
>     def method() {
>         run()
>     }
>     def run() {
>         println("run implementation")
>     }
> }
> {code}
> While {{new ImplClass().closureAsMethod()}} call runs as expected, {{new ImplClass().closureAsMethod()}} causes StackOverflow exception. Stack trace is in attachment.
> In {{CallClosureFieldAsMethodTest.groovy}}, comment says _"Check that we can call a closure defined as a field as if it were a normal method"_
> So, it is normal to wait same behavior as normal method.



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