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

No position information when instrumented class is compiled by new javac

    XMLWordPrintable

    Details

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

      Description



      Name: kbR10066 Date: 10/15/2002


      Running instrumened class which has been compiled by new (JDK1.4) javac with
      -Xjcov siwtch produces coverage file without source code positions. Compilation
      by old javac (JDK13/bin/oldjavac -Xjcov a.java) leads to correct results (position
      information will be available)

      To reproduce:

      1. Compile a "Hello world" program by new javac with -Xjcov:
      > <JDK14>/bin/javac -Xjcov a.java

      2. Instrument a.class by static instrumenter:
      > java -cp <jcov.jar> -autocollection -saveatend=a.main -overwrite a.class

      3. Run the program
      > java -cp <jcov.jar>:. a

      4.
      > cat java.jcov
      JCOV-DATA-FILE-VERSION: 2.0
      CLASS: a [public]
      SRCFILE: a.java
      TIMESTAMP: 1034684593233
      DATA: B
      #kind line position count
      METHOD: <init>()V [public]
      1 1 0 0
      3 1 0 0
      METHOD: main([Ljava/lang/String;)V [public static]
      1 3 0 1
      3 3 0 1

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

        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: