RFR: 7904066: Make some plugin tests runnable with JTReg

Leonid Kuskov lkuskov at openjdk.org
Mon Jul 14 18:21:58 UTC 2025


On Fri, 11 Jul 2025 23:30:58 GMT, Alexandre Iline <shurailine at openjdk.org> wrote:

>> Adding necessary TEST.ROOT files.
>> Fixing up a few tests.
>> Fixing a problem in the code.
>
> plugins/coverage_reports/src/openjdk/codetools/jcov/report/jcov/JCovCoverageComparison.java line 102:
> 
>> 100:                         var isOldMethod = oldSource == null || oldMethodsCache.containsKey(id);
>> 101:                         DataMethod oldMethod = isOldMethod ? oldMethodsCache.get(id) : null;
>> 102:                         var newLineCoverage = new MethodCoverage(newMethod, false).getLineCoverage();
> 
> @lkuskov 
> 
> Regarding this and similar changes in the files.
> The countBlocks parameter: https://github.com/openjdk/jcov/blob/a48fd09dbc21607414c4018d7028809024532e2a/src/classes/com/sun/tdk/jcov/report/MethodCoverage.java#L59
> was set to "true" everywhere in the coverage reports plugin. However, in the next constructor it is interpreted as "javapCoverage": https://github.com/openjdk/jcov/blob/a48fd09dbc21607414c4018d7028809024532e2a/src/classes/com/sun/tdk/jcov/report/MethodCoverage.java#L68C54-L68C63
> 
> Is counting blocks equivalent to generating Java reports, or how do I interpret this?
> 
> I am guessing this is the outcome from your recent javap report fixup.
> 
> I have changed all the values to false because what I need in the reports is line coverage.
> 
> Can you advise?

The parameter countBlocks, which was never actually used, was repurposed as an indicator for javapReporting.
Jcov's functionality did not change, and the reporting system did not lose its ability to generate all types of reports.
 The fix LGTM

-------------

PR Review Comment: https://git.openjdk.org/jcov/pull/64#discussion_r2205535780


More information about the jcov-dev mailing list