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:52:27 UTC

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

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

Batuhan Bayrakçı updated GROOVY-7641:
-------------------------------------
    Summary: StackOverflow Exception when calling method that has same signature as one that inside Closure.groovy  (was: StackOverflow Exception when calling method that has same signature as one that inside a Closure.groovy)

> StackOverflow Exception when calling method that has same signature as one that inside Closure.groovy
> -----------------------------------------------------------------------------------------------------
>
>                 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().method()}} call runs as expected, {{new ImplClass().closureAsMethod()}} attempts to call "run" method in Closure.groovy instead of "run" in ImplClass.groovy, then it causes StackOverflow exception. Stack trace is in attachment.
> In {{CallClosureFieldAsMethodTest.groovy}}, comment says that _"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)