Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7900541

JCOV: caller_include/exclude options still work incorrectly when data is 'B'

XMLWordPrintable

    • 1.1
    • generic
    • generic
    • Verified



      Name: kbR10066 Date: 01/25/2002


      Suppose that:
      1. Jcov agent is run with caller_include option, data='B' (include blocks/branches)
      2. Duting execution, a callee method is invoked from a matched caller class
         (i.e. its name satisfies the caller_include/caller_exclude options)
      3. The callee method contains an invokation of some method and
          the callee method's class does not satisfy the caller_include/caller_exclude options.

      Then:
      execution counters for all blocks and branches in the callee method which follow
      the method invokation will not be incremented.

      To reproduce:

      1. Compile the following sources:

      --- cut here ---
      public class aaa {
      static boolean b = true;

      public static void foo() {
      System.out.println("aaa.foo() start");
      ccc.foo();
      if (b)
      System.out.println("aaa.foo() end");
      }
      }

      public class ccc {
      public static void foo() {
      System.out.println("ccc.foo()");
      }
      }

      public class ddd {
      public static void main(String[] args) {
      aaa.foo();
      }
      }
      --- cut here ---

      > javac -Xjcov *.java

      2. Run the program:

      > java -XX:+EnableJVMPIInstructionStartEvent -Xrunjcov:caller_include=ddd -cp . ddd

      The resulting Jcov data for class aaa will be:

      --- cut here ---
      CLASS: aaa [public]
      SRCFILE: aaa.java
      TIMESTAMP: 1011953387627
      DATA: C
      #kind start end count
      METHOD: <init>()V [public]
      1 1024 0 0
      3 1024 0 0
      METHOD: <clinit>()V [static]
      1 2072 2079 1
      3 2072 2079 1
      METHOD: foo()V [public static]
      1 4130 9225 1
      3 5137 5173 1
      8 7189 7189 0
      7 7189 7189 0 # !!!
      3 8217 8251 0 # !!!
      --- cut here ---

      Execution counters marked with '# !!!' should also '1', but they are zeroes.

      ======================================================================

            afedorch Alexey Fedorchenko (Inactive)
            klooney Kevin Looney (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: