When measuring code coverage in the Spring 3 Petclinic sample application I’ve found a totally unexpected 0% branch coverage metric. Reviewing the results in detail, it seems that on some ‘if’ constructs Cobertura has calculated 131072 (a -1 converted to unsigned??) possible branches and this has pulled down the branch metric to the minimum.
This is happening when using Cobertura Maven plug-in only, with Maven site and with Sonar 2.12.
Attached an excerpt of the generated cobertura.xml file. Complete file is 24 MB but I share it if needed.
Petclinic has been downloaded from trunk in SpringSource spring-samples Subversion repo here: https://src.springframework.org/svn/spring-samples/petclinic/
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Excerpt of generated coverage.xml showing 131072 possible branches in Owner class
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Owner class source
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"