Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clover instrumentation tool processes source files at minimum supported source level, instead of the most appropriate source level, when it does not recognize specified source level #127

Open
klawson88 opened this issue Apr 25, 2020 · 0 comments

Comments

@klawson88
Copy link

klawson88 commented Apr 25, 2020

When the instrumentation tool receives a source argument which does not match any of those which it recognizes...

Expected behavior:

  • It attempts to override the argument using the following values, in order:
    1. The value determined by JavaEnvUtils#getJavaVersion
    2. The minimum source level which the tool supports
  • It logs a message stating that it has overriden the source argument, specifies the values involved in the override, and details why the override is occurring.

Actual behavior:

  • It overrides the argument to be the minimum source level which it supports
  • It does not log a message stating that it has overriden the source argument

Cause:

The source determination logic only runs when a source argument has not been specified; it does not also run when the argument is not recognized.

The getter for this value consists of an equality-based conditional expression featuring the source values the tool does recognize, which it feeds the specified (or determined, but not in this case) source value to. When the getter is invoked, execution falls through to a catch-all clause in the aforementioned expression which returns the minimum source level which the tool supports.

Effect:

Instrumentation is attempted at a source level less than that which was explicitly specified, which, depending on the contents of the source files to be processed, could result in instrumentation failure or malfunction (in my case, the default test detection logic broke, causing test file data to appear in the application file section of the coverage report).

@klawson88 klawson88 changed the title Clover instrumentation tool redefines the source level it processes files at to be 1.3 if argument source level is greater than the max supported Clover instrumentation tool processes source files at minimum supported source level, instead of the most appropriate source level, when it does not recognize specified source level Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant