Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

ClassCastException: o.c.g.a.e.ClosureExpression cannot be cast to o.c.g.a.e.ClassExpression

#37
@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

Reported by Evgeny Goldin · February 20th, 2012 @ 12:00 PM

State: resolved
Milestone: 1.2.6

Activity

  1. Evgeny Goldin
  2. me (at andresteingress)
    me (at andresteingress)
    • 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

    February 23rd, 2012 @ 09:13 PM

  3. me (at andresteingress)
    me (at andresteingress)

    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()
      }
    

    February 23rd, 2012 @ 09:40 PM

  4. Evgeny Goldin
    Evgeny Goldin

    1.8.6, I'll add a link to the code where it happened a bit later.

    February 23rd, 2012 @ 10:31 PM

  5. Evgeny Goldin
    Evgeny Goldin

    Here the line, uncommenting it I get "log.txt" attached.

    February 24th, 2012 @ 08:45 PM

  6. me (at andresteingress)
  7. me (at andresteingress)
    me (at andresteingress)
    • State changed from open to resolved

    February 29th, 2012 @ 08:52 AM

  8. me (at andresteingress)

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.