Skip to content
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

Handle a potential corner case #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,16 @@ public synchronized void endTransaction(final String transactionName,
String hash = entry.getKey();
boolean[] hitArray = entry.getValue().getRight();

if (!ArrayUtils.containsValue(hitArray, true)) {
// although the class has been loaded and instrumented, no line has been covered
activity.put(hash,
new ImmutablePair<String, boolean[]>(entry.getValue().getLeft(), hitArray));
continue;
}

boolean[] cloneHitArray = new boolean[hitArray.length];
System.arraycopy(hitArray, 0, cloneHitArray, 0, hitArray.length);
activity.put(hash,
new ImmutablePair<String, boolean[]>(entry.getValue().getLeft(), cloneHitArray));

if (!ArrayUtils.containsValue(hitArray, true)) {
// although the class has been loaded and instrumented, no line has been covered
continue;
}

// reset probes
for (int i = 0; i < hitArray.length; i++) {
hitArray[i] = false;
Expand Down