Skip to content

Preserve empty class and sourcefile nodes in XML report#817

Merged
marchof merged 24 commits into
masterfrom
issue-806
Jan 18, 2019
Merged

Preserve empty class and sourcefile nodes in XML report#817
marchof merged 24 commits into
masterfrom
issue-806

Conversation

@Godin

@Godin Godin commented Jan 6, 2019

Copy link
Copy Markdown
Member

Fixes #806

Our own XML report before this change is 915700 bytes, after is 920811 - increase is just 0.6%.

@marchof

marchof commented Jan 9, 2019

Copy link
Copy Markdown
Member

As we have this snippet now all over the place:

coverage.getInstructionCounter().getTotalCount() == 0

I would like to propose to add a new method to ICoverageNode:

/**
 * Checks whether this is an empty node.
 * 
 * @return <code>true</code> is this node does not contain any instructions
 */
boolean isEmpty();

@Godin

Godin commented Jan 18, 2019

Copy link
Copy Markdown
Member Author

@marchof added

@Godin Godin requested a review from marchof January 18, 2019 15:10
@marchof

marchof commented Jan 18, 2019

Copy link
Copy Markdown
Member

@Godin Thx for adding isEmpty(). I found three more candidates for using it:

  • org.jacoco.core.internal.analysis.ClassAnalyzer.addMethodCoverage(String, String, String, InstructionsBuilder, MethodNode)
  • org.jacoco.ant.ReportTask.checkForMissingDebugInformation(ICoverageNode)
  • org.jacoco.maven.ReportSupport.logBundleInfo(IBundleCoverage, Collection<IClassCoverage>)

@marchof marchof left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will add more isEmpty() use cases in a separate PR.

@Godin

Godin commented Jan 18, 2019

Copy link
Copy Markdown
Member Author

@marchof thanks for spotting this - made changes, hopefully correctly 😉

@marchof marchof merged commit 13f29eb into master Jan 18, 2019
@marchof marchof deleted the issue-806 branch January 18, 2019 17:26
@jacoco jacoco locked as resolved and limited conversation to collaborators May 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Preserve empty IClassCoverage nodes in CoverageBuilder and in XML report

2 participants