Don't generate stacktrace for TimeExceededException (#12335)

The exception is package private and never rethrown, we can avoid
generating a stacktrace for it.
This commit is contained in:
Luca Cavanna 2023-05-30 10:29:46 +02:00 committed by GitHub
parent d1850e44f3
commit 72b91156f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -41,6 +41,12 @@ final class TimeLimitingBulkScorer extends BulkScorer {
private TimeExceededException() {
super("TimeLimit Exceeded");
}
@Override
public Throwable fillInStackTrace() {
// never re-thrown so we can save the expensive stacktrace
return this;
}
}
private final BulkScorer in;