(final boolean shortCircuit)
| 304 | } |
| 305 | |
| 306 | @SuppressWarnings("unchecked") |
| 307 | private List<T> run(final boolean shortCircuit) { |
| 308 | QueryVisitor v = new QueryVisitor(shortCircuit, null); |
| 309 | try { |
| 310 | v.start(root); |
| 311 | } catch (Stop ignored) { |
| 312 | // short-circuit terminal reached its first match |
| 313 | } |
| 314 | return (List<T>) v.hits; |
| 315 | } |
| 316 | |
| 317 | /** Control-flow signal used to abort the traversal for short-circuiting terminals. */ |
| 318 | private static final class Stop extends RuntimeException { |