Skip to content
Merged
Show file tree
Hide file tree
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 @@ -444,8 +444,8 @@ public Sampling getSampling() {
@Override
public InstrumentationResult.Status instrument(
MethodInfo methodInfo, List<DiagnosticMessage> diagnostics, List<ProbeId> probeIds) {
// if evaluation is at exit and with condition, skip collecting data at entry
boolean captureEntry = !(getEvaluateAt() == MethodLocation.EXIT && hasCondition());
// only capture entry values if explicitly not at Exit. By default, we are using evaluateAt=EXIT
boolean captureEntry = getEvaluateAt() != MethodLocation.EXIT;
return new CapturedContextInstrumentor(
this,
methodInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ public void methodProbeAtExit() throws IOException, URISyntaxException {
int result = Reflect.onClass(testClass).call("main", "1").get();
assertEquals(3, result);
Snapshot snapshot = assertOneSnapshot(listener);
assertCaptureArgs(snapshot.getCaptures().getEntry(), "arg", "java.lang.String", "1");
// no entry values capture
assertEquals(CapturedContext.EMPTY_CAPTURING_CONTEXT, snapshot.getCaptures().getEntry());
assertCaptureArgs(snapshot.getCaptures().getReturn(), "arg", "java.lang.String", "1");
assertTrue(snapshot.getDuration() > 0);
assertTrue(snapshot.getStack().size() > 0);
Expand Down
Loading