@Test public void testExtendInsNinsInOr() throws Exception { QueryExpression in1 = inq("f2", "1", "2", "3"); QueryExpression v1 = vcmp("f2", "=", "4"); QueryExpression q = _or(v1, in1); QueryExpression newq = rw.rewrite(q); System.out.println(q + " ->\n" + newq); Assert.assertFalse(exists(newq, v1)); Assert.assertFalse(exists(newq, in1)); Assert.assertTrue(exists(newq, inq("f2", "1", "2", "3", "4"))); }
@Override public QueryExpression rewrite(QueryExpression q) { QueryExpression trc = q; QueryExpression newq; boolean done = false; do { newq = rewriteIteration(trc); LOGGER.debug("Rewrite iteration pre={}", trc); LOGGER.debug("Rewrite iteration post={}", newq); if (newq == trc) { done = true; } trc = newq; } while (!done); return newq; }
QueryRewriter extends Rewriter { @Override public QueryExpression rewrite(QueryExpression q) { QueryExpression trc = q; QueryExpression newq; boolean done = false; do { newq = rewriteIteration(trc); LOGGER.debug("Rewrite iteration pre={}", trc); LOGGER.debug("Rewrite iteration post={}", newq); if (newq == trc) { done = true; } trc = newq; } while (!done); return newq; } }
QueryRewriter extends Rewriter { @Override public QueryExpression rewrite(QueryExpression q) { QueryExpression trc = q; QueryExpression newq; boolean done = false; do { newq = rewriteIteration(trc); LOGGER.debug("Rewrite iteration pre={}", trc); LOGGER.debug("Rewrite iteration post={}", newq); if (newq == trc) { done = true; } trc = newq; } while (!done); return newq; } QueryRewriter();  QueryRewriter(boolean withDefaultRules); }
QueryRewriter extends Rewriter { @Override public QueryExpression rewrite(QueryExpression q) { QueryExpression trc = q; QueryExpression newq; boolean done = false; do { newq = rewriteIteration(trc); LOGGER.debug("Rewrite iteration pre={}", trc); LOGGER.debug("Rewrite iteration post={}", newq); if (newq == trc) { done = true; } trc = newq; } while (!done); return newq; } QueryRewriter();  QueryRewriter(boolean withDefaultRules); void register(Rewriter rule); @Override QueryExpression rewrite(QueryExpression q); }
QueryRewriter extends Rewriter { @Override public QueryExpression rewrite(QueryExpression q) { QueryExpression trc = q; QueryExpression newq; boolean done = false; do { newq = rewriteIteration(trc); LOGGER.debug("Rewrite iteration pre={}", trc); LOGGER.debug("Rewrite iteration post={}", newq); if (newq == trc) { done = true; } trc = newq; } while (!done); return newq; } QueryRewriter();  QueryRewriter(boolean withDefaultRules); void register(Rewriter rule); @Override QueryExpression rewrite(QueryExpression q);  }