ClassCastException: o.c.g.a.e.ClosureExpression cannot be cast to o.c.g.a.e.ClassExpression
Reported by Evgeny Goldin | February 20th, 2012 @ 12:00 PM | in 1.2.6
@Ensures({ result })
abstract List<String> sources()
causes
java.lang.ClassCastException: org.codehaus.groovy.ast.expr.ClosureExpression cannot be cast to org.codehaus.groovy.ast.expr.ClassExpression
at org.gcontracts.generation.BaseGenerator.addCallsToSuperMethodNodeAnnotationClosure(BaseGenerator.java:145)
at org.gcontracts.generation.PostconditionGenerator.generateDefaultPostconditionStatement(PostconditionGenerator.java:91)
at org.gcontracts.common.impl.lc.PostconditionLifecycle.generatePostcondition(PostconditionLifecycle.java:66)
at org.gcontracts.common.impl.lc.PostconditionLifecycle.afterProcessingMethodNode(PostconditionLifecycle.java:56)
at org.gcontracts.ast.visitor.LifecycleAfterTransformationVisitor.visitClass(LifecycleAfterTransformationVisitor.java:70)
at org.gcontracts.ast.GContractsASTTransformation.visit(GContractsASTTransformation.java:111)
at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:302)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:843)
... 30 more
Comments and changes to this ticket
-
me (at andresteingress) February 23rd, 2012 @ 09:13 PM
- State changed from new to open
- Assigned user set to me (at andresteingress)
- Milestone set to 1.2.6
- Milestone order changed from 1 to 0
-
me (at andresteingress) February 23rd, 2012 @ 09:40 PM
what's the groovy version you're running this example with?
this one works with 1.8.6:
import org.gcontracts.annotations.* abstract class Base { @Ensures({ result }) abstract List<String> sources() }
-
Evgeny Goldin February 23rd, 2012 @ 10:31 PM
1.8.6, I'll add a link to the code where it happened a bit later.
-
Evgeny Goldin February 24th, 2012 @ 08:45 PM
Here the line, uncommenting it I get "log.txt" attached.
-
me (at andresteingress) February 29th, 2012 @ 08:23 AM
(from [3ca99dbc7d97123e9e5a7c8fb22b92931dadaa1a]) inheritance test case based on [#37] https://github.com/andresteingress/gcontracts/commit/3ca99dbc7d9712...
-
me (at andresteingress) February 29th, 2012 @ 08:52 AM
- State changed from open to resolved
-
me (at andresteingress) February 29th, 2012 @ 08:52 AM
(from [24535307de16097201a9b44b5c526ef9b42fca33]) fixed [#37] ClassCastException: o.c.g.a.e.ClosureExpression cannot be cast to o.c.g.a.e.ClassExpression https://github.com/andresteingress/gcontracts/commit/24535307de1609...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
core module