Groovy 2.x @CompileStatic annotation causes static methods to be ignored by Clover

XMLWordPrintable

    • Severity 3 - Minor

      Adding @CompileStatic to a tested Groovy class results in 0% coverage for static methods.

      e.g.

      //All ok here
      class MyClass{
        String sayHello(){
          'hello' //Full coverage shown by Clover
        } 
      
        static String sayHelloAgain(){
          'hello again' //Full coverage shown by Clover
        }
      }
      
      //Same class with the annotation
      @CompileStatic
      class MyClass{
        String sayHello(){
          'hello' //Full coverage shown by Clover
        } 
      
        static String sayHelloAgain(){
          'hello again' //***No coverage shown by Clover***
        }
      }
      

      Can anyone confirm this? Thanks.

        1. MyClass.class
          6 kB
        2. MyClass.class.decompiled
          19 kB
        3. MyClass.groovy
          0.5 kB
        4. MyClass.groovy.after.clovered
          4 kB
        5. MyClass.groovy.before.clovered
          3 kB

              Assignee:
              Unassigned
              Reporter:
              Steve Quinlan
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: