/** * Returns a {@code String} representation of a sequence of statements, with semicolons and * newlines. */ private static String printStatements(Context context, Iterable<JCStatement> statements) { StringWriter writer = new StringWriter(); try { pretty(context, writer).printStats(com.sun.tools.javac.util.List.from(statements)); } catch (IOException e) { throw new AssertionError("StringWriter cannot throw IOExceptions"); } return writer.toString(); }
/** * Returns a {@code String} representation of a sequence of statements, with semicolons and * newlines. */ private static String printStatements(Context context, Iterable<JCStatement> statements) { StringWriter writer = new StringWriter(); try { pretty(context, writer).printStats(com.sun.tools.javac.util.List.from(statements)); } catch (IOException e) { throw new AssertionError("StringWriter cannot throw IOExceptions"); } return writer.toString(); }
/** Print a block. */ public void printBlock(List<? extends JCTree> stats) throws IOException { print("{"); println(); indent(); printStats(stats); undent(); align(); print("}"); }
/** Print a block. */ public void printBlock(List<? extends JCTree> stats) throws IOException { print("{"); println(); indent(); printStats(stats); undent(); align(); print("}"); }
/** Print a block. */ public void printBlock(List<? extends JCTree> stats) throws IOException { print("{"); println(); indent(); printStats(stats); undent(); align(); print("}"); }
/** Print a block. */ public void printBlock(List<? extends JCTree> stats) throws IOException { print("{"); println(); indent(); printStats(stats); undent(); align(); print("}"); }
public void visitCase(JCCase tree) { try { if (tree.pat == null) { print("default"); } else { print("case "); printExpr(tree.pat); } print(": "); println(); indent(); printStats(tree.stats); undent(); align(); } catch (IOException e) { throw new UncheckedIOException(e); } }
public void visitCase(JCCase tree) { try { if (tree.pat == null) { print("default"); } else { print("case "); printExpr(tree.pat); } print(": "); println(); indent(); printStats(tree.stats); undent(); align(); } catch (IOException e) { throw new UncheckedIOException(e); } }
public void visitCase(JCCase tree) { try { if (tree.pat == null) { print("default"); } else { print("case "); printExpr(tree.pat); } print(": "); println(); indent(); printStats(tree.stats); undent(); align(); } catch (IOException e) { throw new UncheckedIOException(e); } }
public void visitCase(JCCase tree) { try { if (tree.pat == null) { print("default"); } else { print("case "); printExpr(tree.pat); } print(": "); println(); indent(); printStats(tree.stats); undent(); align(); } catch (IOException e) { throw new UncheckedIOException(e); } }
public void visitSwitch(JCSwitch tree) { try { print("switch "); if (tree.selector.tag == JCTree.PARENS) { printExpr(tree.selector); } else { print("("); printExpr(tree.selector); print(")"); } print(" {"); println(); printStats(tree.cases); align(); print("}"); } catch (IOException e) { throw new UncheckedIOException(e); } }
public void visitSwitch(JCSwitch tree) { try { print("switch "); if (tree.selector.getTag() == JCTree.PARENS) { printExpr(tree.selector); } else { print("("); printExpr(tree.selector); print(")"); } print(" {"); println(); printStats(tree.cases); align(); print("}"); } catch (IOException e) { throw new UncheckedIOException(e); } }
public void visitSwitch(JCSwitch tree) { try { print("switch "); if (tree.selector.hasTag(PARENS)) { printExpr(tree.selector); } else { print("("); printExpr(tree.selector); print(")"); } print(" {"); println(); printStats(tree.cases); align(); print("}"); } catch (IOException e) { throw new UncheckedIOException(e); } }
public void visitSwitch(JCSwitch tree) { try { print("switch "); if (tree.selector.hasTag(PARENS)) { printExpr(tree.selector); } else { print("("); printExpr(tree.selector); print(")"); } print(" {"); println(); printStats(tree.cases); align(); print("}"); } catch (IOException e) { throw new UncheckedIOException(e); } }