@Test public void testAllResolvedManifests() throws Exception { Map<String, String> expected = new HashMap<>(); expected.put("admob", "Reference com.github.jomof:firebase/app:2.1.3-rev8 was not found"); expected.put("fuzz1", "Could not parse main manifest coordinate []"); for (ResolvedManifests.NamedManifest manifest : ResolvedManifests.all()) { BuildFindModuleFunctionTable builder = new BuildFindModuleFunctionTable(); builder.addManifest(manifest.resolved); String expectedFailure = expected.get(manifest.name); try { new RewritingVisitor().visit(builder.build()); if (expectedFailure != null) { fail("Expected failure"); } } catch (RuntimeException e) { if (expectedFailure == null) { throw e; } assertThat(e.getMessage()).contains(expectedFailure); } } }
@NotNull public Expression visit(@NotNull Expression expr) { Expression prior = identity.get(expr); if (prior != null) { return prior; } identity.put(expr, visitNoIdentity(expr)); return visit(expr); }
RewritingVisitor { @NotNull public Expression visit(@NotNull Expression expr) { Expression prior = identity.get(expr); if (prior != null) { return prior; } identity.put(expr, visitNoIdentity(expr)); return visit(expr); } }
RewritingVisitor { @NotNull public Expression visit(@NotNull Expression expr) { Expression prior = identity.get(expr); if (prior != null) { return prior; } identity.put(expr, visitNoIdentity(expr)); return visit(expr); }  }
RewritingVisitor { @NotNull public Expression visit(@NotNull Expression expr) { Expression prior = identity.get(expr); if (prior != null) { return prior; } identity.put(expr, visitNoIdentity(expr)); return visit(expr); }  @NotNull Expression visit(@NotNull Expression expr); @NotNull Expression visitFunctionTableExpression(@NotNull FunctionTableExpression expr); }
RewritingVisitor { @NotNull public Expression visit(@NotNull Expression expr) { Expression prior = identity.get(expr); if (prior != null) { return prior; } identity.put(expr, visitNoIdentity(expr)); return visit(expr); }  @NotNull Expression visit(@NotNull Expression expr); @NotNull Expression visitFunctionTableExpression(@NotNull FunctionTableExpression expr);  }