Negative coverage in report for records

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • None
    • Affects Version/s: None
    • Component/s: tools
    • None

      Reproducer:
      --------------------------------------------------------------------
      #!/bin/sh -x
      export PATH=$JAVA_HOME/bin:$PATH
      cat > Main.java <<EOT
      public class Main {
          record Point(int x, int y) {}
          public static void main(String[] args) {
              System.out.println(new Point(0, 0).x);
              System.out.println(new Point(0, 0).y);
          }
      }
      EOT
      javac -d `pwd` Main.java
      if [ ! -d orig ]
      then
          mkdir orig
      fi
      cp *.class orig
      java -jar $JCOV_JAR Instr `find . -name "*.class"`
      java -cp `pwd`:`dirname $JCOV_JAR`/jcov_file_saver.jar Main
      java --add-exports jdk.jdeps/com.sun.tools.javap=ALL-UNNAMED -jar $JCOV_JAR RepGen -javap orig -o report result.xml
      java --add-exports jdk.jdeps/com.sun.tools.javap=ALL-UNNAMED -jar $JCOV_JAR RepGen -src . -o report_java result.xml
      --------------------------------------------------------------------

      Both reports show line coverage as "-20%(-1/5)"

        1. defectReport.jpg
          defectReport.jpg
          147 kB
        2. fixedReport.jpg
          fixedReport.jpg
          153 kB
        3. negative.png
          negative.png
          9 kB

            Assignee:
            Leonid Kuskov
            Reporter:
            Aleksandre Iline
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: