Kotlin SMAPs in synthetic classes should be processed#1985
Conversation
|
Hi @Godin I wonder whether this change has side effects: So far we did not process synthetic classes at all and did not report them. Now we process them and report them to |
|
@marchof see #817 - since quite some time "empty" classes do not increase counters and we deliberately preserve them in our XML reports, while do not show in HTML and CSV reports. So new behavior in respect to synthetic classes is IMO not quite new in respect to empty classes. And more consistent - for example for the following enum Example {
E;
static void example(Example e) {
switch (e) {
}
}
public static void main(String[] args) {
example(E);
}
}
interface I {
}execution of
shows 3 produced class files and execution of clearly shows that execution data contains without this change does not show this class while shows empty class of interface and after this change will show Note that as far as I know Java compiler generates synthetic classes only in two cases:
Also after this change will be unambiguously clear that classes not presented in XML report are the ones that user explicitly excluded or not included from/into analysis. Of course this PR can be changed to read SMAPs from synthetic classes while not passing them to
(in both Kotlin compiler generates synthetic classes whose content should appear in coverage reports) one will need new internal filtering API to be able to exclude class from We also briefly discussed such change some time ago, but at that time it was postponed - see #668 (comment) Seems that time to reconsider has come 😉 |
|
Many thanks for the detailed explanation! |
|
@marchof actually I forgot one more case of synthetic class in Java - if users in case of split packages perform analysis without proper split on bundles and for the same package there are two
execution of after this change will lead to Unfortunately to get aggregated reports users have (or at least had in past) tendency to mix multiple modules without proper split on bundles - see #858 which was about As is one will need to explicitly exclude Or we can restore exclusion of synthetic classes in Analyzer, but only for WDYT? |
|
@Godin I don't see a use case of |
No description provided.