@Override public Expr inline(final QueryContext qc, final VarScope scp, final Var var, final Expr ex) throws QueryException { boolean change = false; try { final Expr sub = expr.inline(qc, scp, var, ex); if (sub != null) { if (sub.isValue()) return optPre(sub, qc); expr = sub; change = true; } } catch (final QueryException qe) { if (!qe.isCatchable()) throw qe; for (final Catch c : catches) { if (c.matches(qe)) { // found a matching clause, inline variable and error message final Catch nw = c.inline(qc, scp, var, ex); return optPre((nw == null ? c : nw).asExpr(qe, qc, scp), qc); } } throw qe; } for (final Catch c : catches) change |= c.inline(qc, scp, var, ex) != null; return change ? this : null; }