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)"
--------------------------------------------------------------------
#!/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)"
- relates to
-
CODETOOLS-7903874 Create a test for CODETOOLS-7903842
-
- Resolved
-
- links to
-
Commit(master) openjdk/jcov/6ce973f5
-
Review(master) openjdk/jcov/48