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

Static Instrumenter should issue a warning if no savepoints met

    XMLWordPrintable

    Details

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

      Description



      Name: dkR10031 Date: 06/03/2003



      Static Instrumenter does not issue any warning or error when it does not
      encounter any save point during instrumentation specified via -save...
      options. This potentially can lead to a confusion - a user would not be
      able to figure out why coverage data is not generated by an instrumented
      program.

      To reproduce this situation run the script below. This script compiles
      Hello.java, instruments all classes in '.' directory by the
      Static Instrumenter using '-saveafter', '-saveatend', '-savebefore',
      and '-savebegin' options with incorrect values.
      ------------ Hello.java Source Begin ---------
      class A {

          public static void a() {

              System.out.println("AAA!");
          }
      }


      public class Hello {

          public static void main(String[] args) {

              A.a();
              System.out.println("Hello world!");
          }
      }
      ------------ Source End ----------------------
      ------------ Script Begin --------------------
      #!/usr/bin/ksh
      uname -a
      export
      JCOV_JAR=/net/linux-11/export/home/gary/QA.JCOV/ws/image/lib/jcov.jar
      export CLASSPATH=${JCOV_JAR}:.

      export JDK=/net/linux-15/export/home/java/jdk1.4.0/sparc
      $JDK/bin/javac -Xjcov Hello.java
      $JDK/bin/java -showversion com.sun.tdk.jcov.InstrMain -commonTimeStamp -savebefore=A.foo -saveafter=B.foo -savebegin=C.foo -saveatend=D.foo -overwrite .

      $JDK/bin/java Hello
      ------------ Script End ----------------------
      ------------ Output Begin --------------------
      bash-2.03$ ksh runtest.ksh
      SunOS novo148 5.8 Generic_108528-20 sun4u sparc SUNW,Ultra-80
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      AAA!
      Hello world!
      ------------ 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: