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

Instrumenters ignore savepoints defined by unqualified method names

XMLWordPrintable

    • 1.1
    • generic
    • generic
    • Verified



      Name: dkR10031 Date: 06/18/2003



      Current implementation of Jcov does not generate coverage data for the
      unqualified named while '-savebefore' and '-saveafter' instrumenter
      options is used.

      Jcov User Guide reads in section "B.2.3 Shared Instrumenter Options":
      "The method name can be qualified as well as non-qualified. If it is
      qualified, then the class file is searched for a method of a particular
      class. If not, then any method with the specified name will match."

      To reproduce this bug please run the following example using script
      below (this script compiles the sources, run test class using dynamic
      instrumenter, and finally, tryes to dump coverage datafile):
      -------------------------- source begin ------------------------------
      class a {

          public static void foo(){
              System.out.println("a.foo");
          }
      }
      public class test { // +

          public static void main (String[] args) {

              a.foo();
              System.out.println("----------");
              System.exit(0);
          }
      }
      -------------------------- source end --------------------------------
      -------------------------- script begin ------------------------------
      TESTED_JAVA=/export/home/jdk1.4.1/linux/bin/java
      TESTED_JAVAC=/export/home/jdk1.4.1/linux/bin/javac

      JCOV_JAR=/export/home/gary/QA.JCOV/ws-test/test.solaris-sparc/unzip/lib/jcov.ja
      export CLASSPATH=${JCOV_JAR}:.

      $TESTED_JAVAC -Xjcov test.java

      $TESTED_JAVA com.sun.tdk.jcov.collect.RunMain -commonTimeStamp -saveafter=foo -savebefore=foo test
      cat java.jcov
      -------------------------- script ------------------------------------
      -------------------------- output begin ------------------------------
      [gary@linux-11 xxxxxxxx(2)]# ./run.ksh
      a.foo
      ----------
      cat: java.jcov: No such file or directory
      [gary@linux-11 xxxxxxxx(2)]#
      -------------------------- output end --------------------------------
      ======================================================================

            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: