[
https://issues.apache.org/jira/browse/GROOVY-10083?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Sun reassigned GROOVY-10083:
-----------------------------------
Fix Version/s: 7.0.0-alpha-1
Assignee: Daniel Sun
> ComposedClosure thrown ClassCastException when owner is not Closure
> -------------------------------------------------------------------
>
> Key: GROOVY-10083
> URL: https://issues.apache.org/jira/browse/GROOVY-10083
> Project: Groovy
> Issue Type: Bug
> Components: groovy-runtime
> Affects Versions: 2.5.14
> Reporter: chunlinyao
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 7.0.0-alpha-1
>
>
> ComposedClosure consider owner is an instance of Closure, But If we changed
> owner property to other class, setResolveStrategy will thrown
> ClassCastException.
> This is a simple test
> {code:java}
> a = {println "aa"}
> b = {println "bb"} >> a
> c = 1
> d = b.rehydrate(c,c,c)
> d.setResolveStrategy(Closure.DELEGATE_FIRST)
> // ERROR java.lang.ClassCastException:
> // java.lang.Integer cannot be cast to groovy.lang.Closure
> {code}
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)