Skip to content

ConsumerWithDelegate with ComposedClosure will throw exception. #6

@chunlinyao

Description

@chunlinyao

When work with ComposedClosure, it thrown ClassCastException.
Because ComposedClosure overrided setResolveStrategy method, cast its getOwner to Closure. Which be replaced by an outer class.

java.lang.ClassCastException: java.lang.Class cannot be cast to groovy.lang.Closure
        at org.codehaus.groovy.runtime.ComposedClosure.setResolveStrategy(ComposedClosure.java:81) ~[groovy-2.5.14.jar:2.5.14]
        at space.jasan.support.groovy.closure.ConsumerWithDelegate.accept(ConsumerWithDelegate.java:38) ~[groovy-closure-support-0.6.0.jar:?]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions