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
@@ -1,4 +1,13 @@
package com.jayway.jsonpath.internal;

public class EvaluationAbortException extends RuntimeException {

private static final long serialVersionUID = 4419305302960432348L;

// this is just a marker exception to abort evaluation, we don't care about
// the stack
@Override
public Throwable fillInStackTrace() {
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
*/
public class EvaluationContextImpl implements EvaluationContext {

private static final EvaluationAbortException ABORT_EVALUATION = new EvaluationAbortException();

private final Configuration configuration;
private final Object valueResult;
private final Object pathResult;
Expand Down Expand Up @@ -84,7 +86,7 @@ public void addResult(String path, PathRef operation, Object model) {
for (EvaluationListener listener : configuration().getEvaluationListeners()) {
EvaluationListener.EvaluationContinuation continuation = listener.resultFound(new FoundResultImpl(idx, path, model));
if(EvaluationListener.EvaluationContinuation.ABORT == continuation){
throw new EvaluationAbortException();
throw ABORT_EVALUATION;
}
}
}
Expand Down