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

Static Instrumenter called with '-stats' flag does not generate expected statist

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description



      Name: dkR10031 Date: 06/19/2003



      The following documented feature described in section
      "B.2.1 Static Instrumenter" of the Jcov User Guide:
      "-stats: Print statistics to stdout. Number of methods, number of Constant
      Pool elements before and after instrumentation, calculated total number of
      JCov items in the input class file."

      However, current Jcov implementation does not generate any statistics.
      To reproduce this bug please execute the following example using by the
      script below. This script compile the source and instrument class
      using Static Instrumenter which is called with the '-stats' option:
      -------------------------- test.java source begin --------------------
      public class test {

          public static void main(String[] args) {

              System.out.println("-----------");
              java.lang.System.exit(0);
          }
      -------------------------- test.java source end ----------------------
      -------------------------- script begin ------------------------------
      # Setting the classpath
      TESTED_JAVAC=/export/home/jdk1.4.1/linux/bin/javac
      TESTED_JAVA=/export/home/jdk1.4.1/linux/bin/java
      JCOV_JAR=/export/home/gary/QA.JCOV/ws-test/test.linux-x86/lib/jcov.jar

      CLASSPATH=${JCOV_JAR}
      CLASSPATH=${CLASSPATH}:.
      export CLASSPATH

      # Compile the test program
      $TESTED_JAVAC -Xjcov test.java

      # Statically Instrument test.class using '-stats' option
      $TESTED_JAVA -showversion com.sun.tdk.jcov.InstrMain -overwrite -stats -savebefore=java.lang.System.exit test.class
      -------------------------- output begin ------------------------------
      [gary@linux-11 #xxxxxxxx(4)]# uname -a
      Linux linux-11 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 i686 i386 GNU/Linux
      [gary@linux-11 #xxxxxxxx(4)]# ./run.ksh
      java version "1.4.1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
      Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)

      -------------------------- output end --------------------------------

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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: