-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ignore synthetic class created for switch on enum #660
Comments
@pbludov What you see here is a synthetic class created by the compiler to implement a switch on values. This class should be filtered at all. We're currently in the process of adding different filters. I add this to our list. Stay tuned. |
@marchof do we really want to detect solely
? To me seems that this will require examination of bytecode pattern in static initialization method of such classes, or ability for filters to detect presence of synthetic field that holds "switch map", while much simpler to detect any synthetic classes. The only known to me examples of synthetic classes are this one for enums and an empty one which is created in case class Example {
class C {
private C() {
}
}
void fun() {
new C();
}
} to give an access to private constructor:
While we can do additional tests using big set of classes as before to be sure that those are the only cases, I don't think that this is necessary and strongly believe that we won't find anything else. Also should be noted that in case of switch on enum WDYT? |
@Godin I fully agree. Let's filter all synthetic classes in a first step. |
Steps to reproduce
JaCoCo version: 0.8.0
Operating system: Ubuntu 16.04/MacOSX 10.12
Tool integration: Maven
TestClass.java
TestClassTest.java
pom.xml
Expected behaviour
Actual behaviour
Extra notes
The command
mvn clean verify
succeeded, the target level of 100% coverage is achieved.Only the report says 'there is a missing line'
The text was updated successfully, but these errors were encountered: