diff options
author | Oliver Nguyen <olivernguyen@google.com> | 2020-07-09 15:11:30 -0700 |
---|---|---|
committer | Oliver Nguyen <olivernguyen@google.com> | 2020-08-11 10:58:54 -0700 |
commit | 28558ef2ec7635c0a7e10fbb1fe9b8a80d32b636 (patch) | |
tree | ff121ba8fcc1140f854ff568722192877ffeae6a /org.jacoco.cli/src | |
parent | bdbfb7047d87e8e790260a0fffb1afdf37ed3dc8 (diff) | |
download | jacoco-28558ef2ec7635c0a7e10fbb1fe9b8a80d32b636.tar.gz |
Add IExecutionData interface and move all usage to the interface.
Abstracts the underlying execution data implementation to allow for more
complex execution data storage mechanisms.
For offline instrumentation, classes store the IExecutionData object and
make calls into it to set probe data. This results in additional
overhead of looking up the vtable for the interface and making the
method call, rather than just directly setting the value in the boolean
array.
Bug: 147904124
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true and verify
Java coverage collection and parsing
Change-Id: I41235626b1040a6a21c6aef300f2dfe064393e1f
Diffstat (limited to 'org.jacoco.cli/src')
-rw-r--r-- | org.jacoco.cli/src/org/jacoco/cli/internal/commands/ExecInfo.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/org.jacoco.cli/src/org/jacoco/cli/internal/commands/ExecInfo.java b/org.jacoco.cli/src/org/jacoco/cli/internal/commands/ExecInfo.java index cacf4cbe..4519d28f 100644 --- a/org.jacoco.cli/src/org/jacoco/cli/internal/commands/ExecInfo.java +++ b/org.jacoco.cli/src/org/jacoco/cli/internal/commands/ExecInfo.java @@ -20,7 +20,7 @@ import java.util.Date; import java.util.List; import org.jacoco.cli.internal.Command; -import org.jacoco.core.data.ExecutionData; +import org.jacoco.core.data.IExecutionData; import org.jacoco.core.data.ExecutionDataReader; import org.jacoco.core.data.IExecutionDataVisitor; import org.jacoco.core.data.ISessionInfoVisitor; @@ -68,13 +68,15 @@ public class ExecInfo extends Command { } }); reader.setExecutionDataVisitor(new IExecutionDataVisitor() { - public void visitClassExecution(final ExecutionData data) { + // BEGIN android-change + public void visitClassExecution(final IExecutionData data) { out.printf("%016x %3d of %3d %s%n", Long.valueOf(data.getId()), - Integer.valueOf(getHitCount(data.getProbes())), - Integer.valueOf(data.getProbes().length), + Integer.valueOf(getHitCount(data.getProbesCopy())), + Integer.valueOf(data.getProbeCount()), data.getName()); } + // END android-change }); reader.read(); in.close(); |