Input:
  public Object build(DirectiveBuilder builder,
                      BuildContext bc)
  throws BuildException {
    Object c = builder.getArg(IF_COND, bc);
    boolean cMacro = (c instanceof Macro);
    int elseifCount;
    DirectiveArgs elseArgs;
    DirectiveArgs[] elseifArgs = null;
    if (!cMacro && Expression.isTrue(c))
      return (Block) builder.getArg(IF_BLOCK, bc);
    elseArgs = builder.getSubdirective(IF_ELSE);
    elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF);
    elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length;
    if (elseifCount == 0) {
      if (!cMacro) {
        return (elseArgs != null)
          ? elseArgs.getArg(ELSE_BLOCK, bc) : "";
      }
      else {
        conditions = new Macro[1];
        blocks     = new Block[1];
        conditions[0] = (Macro) c;
        blocks[0]     = (Block) builder.getArg(IF_BLOCK, bc);
        if (elseArgs != null)
          elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc);
        return this;
      }
    }
    else {
      int i=0;
      nConditions=elseifCount;
      if (cMacro)
        ++nConditions;
      conditions = new Macro[nConditions];
      blocks     = new Block[nConditions];
      if (cMacro) {
        conditions[0] = (Macro) c;
        blocks[0]     = (Block) builder.getArg(IF_BLOCK, bc);
        ++i;
      }
      for (int j=0; j < elseifCount; j++) {
        c = elseifArgs[j].getArg(ELSEIF_COND, bc);
        if (c instanceof Macro) {
          conditions[i] = (Macro) c;
          blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc);
          ++i;
        }
        else if (Expression.isTrue(c)) {
          elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc);
          if (i == 0)
            return elseBlock;
          else
            break;
        }
        else {
        }
      }
      if (elseBlock == null && elseArgs != null) {
          elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc);
        if (i == 0)
          return elseBlock;
      }
      if (i < nConditions) {
        nConditions = i;
      }
    }
    return this;
  }

Output:
  public Object build(DirectiveBuilder builder,
                      BuildContext bc)
  throws BuildException {
    Object c = builder.getArg(IF_COND, bc);
    boolean cMacro = (c instanceof Macro);
    int elseifCount;
    DirectiveArgs elseArgs;
    DirectiveArgs[] elseifArgs = null;
    if (!cMacro && Expression.isTrue(c)) {
      return (Block) builder.getArg(IF_BLOCK, bc);
    }
    elseArgs = builder.getSubdirective(IF_ELSE);
    elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF);
    elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length;
    if (elseifCount == 0) {
      if (!cMacro) {
        return (elseArgs != null)
          ? elseArgs.getArg(ELSE_BLOCK, bc) : "";
      }
      else {
        nConditions = 1;
        conditions = new Macro[1];
        blocks     = new Block[1];
        conditions[0] = (Macro) c;
        blocks[0]     = (Block) builder.getArg(IF_BLOCK, bc);
        if (elseArgs != null)
          elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc);
        return this;
      }
    }
    else {
      int i=0;
      nConditions=elseifCount + (cMacro? 1 : 0);
      conditions = new Macro[nConditions];
      blocks     = new Block[nConditions];
      if (cMacro) {
        conditions[0] = (Macro) c;
        blocks[0]     = (Block) builder.getArg(IF_BLOCK, bc);
        ++i;
      }
      for (int j=0; j < elseifCount; j++) {
        c = elseifArgs[j].getArg(ELSEIF_COND, bc);
        if (c instanceof Macro) {
          conditions[i] = (Macro) c;
          blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc);
          ++i;
        }
        else if (Expression.isTrue(c)) {
          elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc);
          if (i == 0)
            return elseBlock;
          else
            break;
        }
        else {
        }
      }
      if (elseBlock == null && elseArgs != null) {
          elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc);
        if (i == 0)
          return elseBlock;
      }
      if (i < nConditions) {
        nConditions = i;
      }
    }
    return this;
  }


Input:
  public static VisualStudioProject getProject(File projectFile, String projectName, List<String> buildConfigurations)
      throws FileNotFoundException, DotNetToolsException {
    VisualStudioProject project = new VisualStudioProject();
    project.setProjectFile(projectFile);
    project.setName(projectName);
    File projectDir = projectFile.getParentFile();
    XPathFactory factory = XPathFactory.newInstance();
    XPath xpath = factory.newXPath();
    ClassLoader savedClassloader = Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(xpath.getClass().getClassLoader());
    try {
      xpath.setNamespaceContext(new VisualStudioNamespaceContext());
      if (buildConfigurations != null) {
        Map<String, File> buildConfOutputDirMap = new HashMap<String, File>();
        for (String config : buildConfigurations) {
          XPathExpression configOutputExpression = xpath.compile("/vst:Project/vst:PropertyGroup[contains(@Condition,'" + config
            + "')]/vst:OutputPath");
          String configOutput = extractProjectProperty(configOutputExpression, projectFile);
          buildConfOutputDirMap.put(config, new File(projectDir, configOutput));
        }
        project.setBuildConfOutputDirMap(buildConfOutputDirMap);
      }
      XPathExpression projectTypeExpression = xpath.compile("/vst:Project/vst:PropertyGroup/vst:OutputType");
      XPathExpression assemblyNameExpression = xpath.compile("/vst:Project/vst:PropertyGroup/vst:AssemblyName");
      XPathExpression rootNamespaceExpression = xpath.compile("/vst:Project/vst:PropertyGroup/vst:RootNamespace");
      XPathExpression debugOutputExpression = xpath.compile("/vst:Project/vst:PropertyGroup[contains(@Condition,'Debug')]/vst:OutputPath");
      XPathExpression releaseOutputExpression = xpath
          .compile("/vst:Project/vst:PropertyGroup[contains(@Condition,'Release')]/vst:OutputPath");
      XPathExpression silverlightExpression = xpath.compile("/vst:Project/vst:PropertyGroup/vst:SilverlightApplication");
      XPathExpression projectGuidExpression = xpath.compile("/vst:Project/vst:PropertyGroup/vst:ProjectGuid");
      String typeStr = extractProjectProperty(projectTypeExpression, projectFile);
      String silverlightStr = extractProjectProperty(silverlightExpression, projectFile);
      String assemblyName = extractProjectProperty(assemblyNameExpression, projectFile);
      String rootNamespace = extractProjectProperty(rootNamespaceExpression, projectFile);
      String debugOutput = extractProjectProperty(debugOutputExpression, projectFile);
      String releaseOutput = extractProjectProperty(releaseOutputExpression, projectFile);
      String projectGuid = extractProjectProperty(projectGuidExpression, projectFile);
      projectGuid = projectGuid.substring(1, projectGuid.length() - 2);
      ArtifactType type = ArtifactType.LIBRARY;
      if (StringUtils.containsIgnoreCase(typeStr, "exe")) {
        type = ArtifactType.EXECUTABLE;
      }
      project.setProjectGuid(UUID.fromString(projectGuid));
      project.setProjectFile(projectFile);
      project.setType(type);
      project.setDirectory(projectDir);
      project.setAssemblyName(assemblyName);
      project.setRootNamespace(rootNamespace);
      project.setDebugOutputDir(new File(projectDir, debugOutput));
      project.setReleaseOutputDir(new File(projectDir, releaseOutput));
      if (StringUtils.isNotEmpty(silverlightStr)) {
        project.setSilverlightProject(true);
      }
      Thread.currentThread().setContextClassLoader(savedClassloader);
      Collection<SourceFile> sourceFiles = project.getSourceFiles();
      project.setAssemblyVersion(findAssemblyVersion(sourceFiles));
      assessTestProject(project, testProjectNamePattern, integTestProjectNamePattern);
      return project;
    } catch (XPathExpressionException xpee) {
      throw new DotNetToolsException("Error while processing the project " + projectFile, xpee);
    } finally {
      Thread.currentThread().setContextClassLoader(savedClassloader);
    }
  }

Output:
  public static VisualStudioProject getProject(File projectFile, String projectName, List<String> buildConfigurations)
      throws FileNotFoundException, DotNetToolsException {
    VisualStudioProject project = new VisualStudioProject();
    project.setProjectFile(projectFile);
    project.setName(projectName);
    File projectDir = projectFile.getParentFile();
    XPathFactory factory = XPathFactory.newInstance();
    XPath xpath = factory.newXPath();
    try {
      xpath.setNamespaceContext(new VisualStudioNamespaceContext());
      if (buildConfigurations != null) {
        Map<String, File> buildConfOutputDirMap = new HashMap<String, File>();
        for (String config : buildConfigurations) {
          XPathExpression configOutputExpression = xpath.compile("/vst:Project/vst:PropertyGroup[contains(@Condition,'" + config
            + "')]/vst:OutputPath");
          String configOutput = extractProjectProperty(configOutputExpression, projectFile);
          buildConfOutputDirMap.put(config, new File(projectDir, configOutput));
        }
        project.setBuildConfOutputDirMap(buildConfOutputDirMap);
      }
      XPathExpression projectTypeExpression = xpath.compile("/vst:Project/vst:PropertyGroup/vst:OutputType");
      XPathExpression assemblyNameExpression = xpath.compile("/vst:Project/vst:PropertyGroup/vst:AssemblyName");
      XPathExpression rootNamespaceExpression = xpath.compile("/vst:Project/vst:PropertyGroup/vst:RootNamespace");
      XPathExpression debugOutputExpression = xpath.compile("/vst:Project/vst:PropertyGroup[contains(@Condition,'Debug')]/vst:OutputPath");
      XPathExpression releaseOutputExpression = xpath
          .compile("/vst:Project/vst:PropertyGroup[contains(@Condition,'Release')]/vst:OutputPath");
      XPathExpression silverlightExpression = xpath.compile("/vst:Project/vst:PropertyGroup/vst:SilverlightApplication");
      XPathExpression projectGuidExpression = xpath.compile("/vst:Project/vst:PropertyGroup/vst:ProjectGuid");
      String typeStr = extractProjectProperty(projectTypeExpression, projectFile);
      String silverlightStr = extractProjectProperty(silverlightExpression, projectFile);
      String assemblyName = extractProjectProperty(assemblyNameExpression, projectFile);
      String rootNamespace = extractProjectProperty(rootNamespaceExpression, projectFile);
      String debugOutput = extractProjectProperty(debugOutputExpression, projectFile);
      String releaseOutput = extractProjectProperty(releaseOutputExpression, projectFile);
      String projectGuid = extractProjectProperty(projectGuidExpression, projectFile);
      projectGuid = projectGuid.substring(1, projectGuid.length() - 2);
      ArtifactType type = ArtifactType.LIBRARY;
      if (StringUtils.containsIgnoreCase(typeStr, "exe")) {
        type = ArtifactType.EXECUTABLE;
      }
      project.setProjectGuid(UUID.fromString(projectGuid));
      project.setProjectFile(projectFile);
      project.setType(type);
      project.setDirectory(projectDir);
      project.setAssemblyName(assemblyName);
      project.setRootNamespace(rootNamespace);
      project.setDebugOutputDir(new File(projectDir, debugOutput));
      project.setReleaseOutputDir(new File(projectDir, releaseOutput));
      if (StringUtils.isNotEmpty(silverlightStr)) {
        project.setSilverlightProject(true);
      }
      Collection<SourceFile> sourceFiles = project.getSourceFiles();
      project.setAssemblyVersion(findAssemblyVersion(sourceFiles));
      assessTestProject(project, testProjectNamePattern, integTestProjectNamePattern);
      return project;
    } catch (XPathExpressionException xpee) {
      throw new DotNetToolsException("Error while processing the project " + projectFile, xpee);
    } finally {
    }
  }


Input:
    public void script(
            @CliOption(key = { "", "file" }, help = "The file to locate and execute", mandatory = true) final File script,
            @CliOption(key = "lineNumbers", mandatory = false, specifiedDefaultValue = "true", unspecifiedDefaultValue = "false", help = "Display line numbers when executing the script") final boolean lineNumbers) {
        Validate.notNull(script, "Script file to parse is required");
        final double startedNanoseconds = System.nanoTime();
        final InputStream inputStream = openScript(script);
        try {
            int i = 0;
            for (final String line : IOUtils.readLines(inputStream)) {
                i++;
                if (lineNumbers) {
                    logger.fine("Line " + i + ": " + line);
                }
                else {
                    logger.fine(line);
                }
                if (!"".equals(line.trim())) {
                    final boolean success = executeScriptLine(line);
                    if (success
                            && (line.trim().startsWith("q") || line.trim()
                                    .startsWith("ex"))) {
                        break;
                    }
                    else if (!success) {
                        throw new IllegalStateException(
                                "Script execution aborted");
                    }
                }
            }
        }
        catch (final IOException e) {
            throw new IllegalStateException(e);
        }
        finally {
            IOUtils.closeQuietly(inputStream);
            final double executionDurationInSeconds = (System.nanoTime() - startedNanoseconds) / 1000000000D;
            logger.fine("Script required "
                    + round(executionDurationInSeconds, 3)
                    + " seconds to execute");
        }
    }
    public void setPromptPath(final String path) {
        shellPrompt = (StringUtils.isNotBlank(path) ? path + " " : "")
                + ROO_PROMPT;
    }
    public void setPromptPath(final String path, final boolean overrideStyle) {
        setPromptPath(path);
    }
    public void setTailor(final Tailor tailor) {
        this.tailor = tailor;
    }
    @CliCommand(value = { "version" }, help = "Displays shell version")
    public String version(
            @CliOption(key = "", help = "Special version flags") final String extra) {
        final StringBuilder sb = new StringBuilder();
        if ("roorocks".equals(extra)) {
            sb.append("               /\\ /l").append(LINE_SEPARATOR);
            sb.append("               ((.Y(!").append(LINE_SEPARATOR);
            sb.append("                \\ |/").append(LINE_SEPARATOR);
            sb.append("                /  6~6,").append(LINE_SEPARATOR);
            sb.append("                \\ _    +-.").append(LINE_SEPARATOR);
            sb.append("                 \\`-=--^-' \\").append(LINE_SEPARATOR);
            sb.append(
                    "                  \\   \\     |\\--------------------------+")
                    .append(LINE_SEPARATOR);
            sb.append(
                    "                 _/    \\    |  Thanks for loading Roo!  |")
                    .append(LINE_SEPARATOR);
            sb.append(
                    "                (  .    Y   +---------------------------+")
                    .append(LINE_SEPARATOR);
            sb.append("               /\"\\ `---^--v---.").append(
                    LINE_SEPARATOR);
            sb.append("              / _ `---\"T~~\\/~\\/").append(
                    LINE_SEPARATOR);
            sb.append("             / \" ~\\.      !").append(LINE_SEPARATOR);
            sb.append("       _    Y      Y.~~~ /'").append(LINE_SEPARATOR);
            sb.append("      Y^|   |      | Roo 7").append(LINE_SEPARATOR);
            sb.append("      | l   |     / .   /'").append(LINE_SEPARATOR);
            sb.append("      | `L  | Y .^/   ~T").append(LINE_SEPARATOR);
            sb.append("      |  l  ! | |/  | |               ____  ____  ____")
                    .append(LINE_SEPARATOR);
            sb.append(
                    "      | .`\\/' | Y   | !              / __ \\/ __ \\/ __ \\")
                    .append(LINE_SEPARATOR);
            sb.append(
                    "      l  \"~   j l   j L______       / /_/ / / / / / / /")
                    .append(LINE_SEPARATOR);
            sb.append(
                    "       \\,____{ __\"\" ~ __ ,\\_,\\_    / _, _/ /_/ / /_/ /")
                    .append(LINE_SEPARATOR);
            sb.append("    ~~~~~~~~~~~~~~~~~~~~~~~~~~~   /_/ |_|\\____/\\____/")
                    .append(" ").append(versionInfo()).append(LINE_SEPARATOR);
            return sb.toString();
        }
        sb.append("    ____  ____  ____  ").append(LINE_SEPARATOR);
        sb.append("   / __ \\/ __ \\/ __ \\ ").append(LINE_SEPARATOR);
        sb.append("  / /_/ / / / / / / / ").append(LINE_SEPARATOR);
        sb.append(" / _, _/ /_/ / /_/ /  ").append("  ")
                .append("gvNIX 1.2.1-SNAPSHOT distribution").append(LINE_SEPARATOR);
        sb.append("/_/ |_|\\____/\\____/   ").append(" ").append(versionInfo())
                .append(LINE_SEPARATOR);
        sb.append(LINE_SEPARATOR);
        return sb.toString();
    }
}

Output:
    public void script(
            @CliOption(key = { "", "file" }, help = "The file to locate and execute", mandatory = true) final File script,
            @CliOption(key = "lineNumbers", mandatory = false, specifiedDefaultValue = "true", unspecifiedDefaultValue = "false", help = "Display line numbers when executing the script") final boolean lineNumbers) {
        Validate.notNull(script, "Script file to parse is required");
        final double startedNanoseconds = System.nanoTime();
        final InputStream inputStream = openScript(script);
        try {
            int i = 0;
            for (final String line : IOUtils.readLines(inputStream)) {
                i++;
                if (lineNumbers) {
                    logger.fine("Line " + i + ": " + line);
                }
                else {
                    logger.fine(line);
                }
                if (!"".equals(line.trim())) {
                    final boolean success = executeScriptLine(line);
                    if (success
                            && (line.trim().startsWith("q") || line.trim()
                                    .startsWith("ex"))) {
                        break;
                    }
                    else if (!success) {
                        throw new IllegalStateException(
                                "Script execution aborted");
                    }
                }
            }
        }
        catch (final IOException e) {
            throw new IllegalStateException(e);
        }
        finally {
            IOUtils.closeQuietly(inputStream);
            final double executionDurationInSeconds = (System.nanoTime() - startedNanoseconds) / 1000000000D;
            logger.fine("Script required "
                    + round(executionDurationInSeconds, 3)
                    + " seconds to execute");
        }
    }
    public void setPromptPath(final String path) {
        shellPrompt = (StringUtils.isNotBlank(path) ? path + " " : "")
                + ROO_PROMPT;
    }
    public void setPromptPath(final String path, final boolean overrideStyle) {
        setPromptPath(path);
    }
    public void setTailor(final Tailor tailor) {
        this.tailor = tailor;
    }
    @CliCommand(value = { "version" }, help = "Displays shell version")
    public String version(
            @CliOption(key = "", help = "Special version flags") final String extra) {
        final StringBuilder sb = new StringBuilder();
        if ("roorocks".equals(extra)) {
            sb.append("               /\\ /l").append(LINE_SEPARATOR);
            sb.append("               ((.Y(!").append(LINE_SEPARATOR);
            sb.append("                \\ |/").append(LINE_SEPARATOR);
            sb.append("                /  6~6,").append(LINE_SEPARATOR);
            sb.append("                \\ _    +-.").append(LINE_SEPARATOR);
            sb.append("                 \\`-=--^-' \\").append(LINE_SEPARATOR);
            sb.append(
                    "                  \\   \\     |\\--------------------------+")
                    .append(LINE_SEPARATOR);
            sb.append(
                    "                 _/    \\    |  Thanks for loading Roo!  |")
                    .append(LINE_SEPARATOR);
            sb.append(
                    "                (  .    Y   +---------------------------+")
                    .append(LINE_SEPARATOR);
            sb.append("               /\"\\ `---^--v---.").append(
                    LINE_SEPARATOR);
            sb.append("              / _ `---\"T~~\\/~\\/").append(
                    LINE_SEPARATOR);
            sb.append("             / \" ~\\.      !").append(LINE_SEPARATOR);
            sb.append("       _    Y      Y.~~~ /'").append(LINE_SEPARATOR);
            sb.append("      Y^|   |      | Roo 7").append(LINE_SEPARATOR);
            sb.append("      | l   |     / .   /'").append(LINE_SEPARATOR);
            sb.append("      | `L  | Y .^/   ~T").append(LINE_SEPARATOR);
            sb.append("      |  l  ! | |/  | |               ____  ____  ____")
                    .append(LINE_SEPARATOR);
            sb.append(
                    "      | .`\\/' | Y   | !              / __ \\/ __ \\/ __ \\")
                    .append(LINE_SEPARATOR);
            sb.append(
                    "      l  \"~   j l   j L______       / /_/ / / / / / / /")
                    .append(LINE_SEPARATOR);
            sb.append(
                    "       \\,____{ __\"\" ~ __ ,\\_,\\_    / _, _/ /_/ / /_/ /")
                    .append(LINE_SEPARATOR);
            sb.append("    ~~~~~~~~~~~~~~~~~~~~~~~~~~~   /_/ |_|\\____/\\____/")
                    .append(" ").append(versionInfo()).append(LINE_SEPARATOR);
            return sb.toString();
        }
        sb.append("    ____  ____  ____  ").append(LINE_SEPARATOR);
        sb.append("   / __ \\/ __ \\/ __ \\ ").append(LINE_SEPARATOR);
        sb.append("  / /_/ / / / / / / / ").append(LINE_SEPARATOR);
        sb.append(" / _, _/ /_/ / /_/ /  ").append("  ")
                .append("gvNIX 1.3.0-SNAPSHOT distribution").append(LINE_SEPARATOR);
        sb.append("/_/ |_|\\____/\\____/   ").append(" ").append(versionInfo())
                .append(LINE_SEPARATOR);
        sb.append(LINE_SEPARATOR);
        return sb.toString();
    }
}


Input:
  private CAstNode walkNodesInternal(final Node n, WalkContext context) {
    final int NT = n.getType();
    switch (NT) {
    case Token.FUNCTION: {
      int fnIndex = n.getExistingIntProp(Node.FUNCTION_PROP);
      FunctionNode fn = context.top().getFunctionNode(fnIndex);
      CAstEntity fne = walkEntity(fn, context);
      if (context.expressionContext()) {
        CAstNode fun = Ast.makeNode(CAstNode.FUNCTION_EXPR, Ast.makeConstant(fne));
        context.addScopedEntity(fun, fne);
        return fun;
      } else {
        context.addNameDecl(Ast.makeNode(CAstNode.FUNCTION_STMT, Ast.makeConstant(fne)));
        context.addScopedEntity(null, fne);
        return Ast.makeNode(CAstNode.EMPTY);
      }
    }
    case Token.CATCH_SCOPE: {
      Node catchVarNode = n.getFirstChild();
      String catchVarName = catchVarNode.getString();
      assert catchVarName != null;
      context.setCatchVar(catchVarName);
      return Ast.makeNode(CAstNode.EMPTY);
    }
    case Token.LOCAL_BLOCK: {
      return Ast.makeNode(CAstNode.BLOCK_EXPR, gatherChildren(n, context));
    }
    case Token.TRY: {
      Node catchNode = ((Node.Jump) n).target;
      Node finallyNode = ((Node.Jump) n).getFinally();
      ArrayList<Node> tryList = new ArrayList<Node>();
      ArrayList<Node> catchList = new ArrayList<Node>();
      ArrayList<Node> finallyList = new ArrayList<Node>();
      ArrayList<Node> current = tryList;
      Node c;
      for (c = n.getFirstChild(); c.getNext() != null; c = c.getNext()) {
        if (c == catchNode) {
          current = catchList;
        } else if (c == finallyNode) {
          current = finallyList;
        }
        if (c.getType() == Token.GOTO &&
            (c.getNext() == catchNode || c.getNext() == finallyNode)) {
          continue;
        }
        current.add(c);
      }
      CAstNode finallyBlock = null;
      if (finallyNode != null) {
        int i = 0;
        CAstNode[] finallyAsts = new CAstNode[finallyList.size()];
        for (Iterator<Node> fns = finallyList.iterator(); fns.hasNext();) {
          finallyAsts[i++] = walkNodes(fns.next(), context);
        }
        finallyBlock = Ast.makeNode(CAstNode.BLOCK_STMT, finallyAsts);
      }
      if (catchNode != null) {
        int i = 0;
        WalkContext catchChild = new CatchBlockContext(context);
        CAstNode[] catchAsts = new CAstNode[catchList.size()];
        for (Iterator<Node> cns = catchList.iterator(); cns.hasNext();) {
          catchAsts[i++] = walkNodes(cns.next(), catchChild);
        }
        CAstNode catchBlock = Ast.makeNode(CAstNode.CATCH, Ast.makeConstant(catchChild.getCatchVar()),
            Ast.makeNode(CAstNode.BLOCK_STMT, catchAsts));
        context.cfg().map(catchBlock, catchBlock);
        i = 0;
        WalkContext tryChild = new TryBlockContext(context, catchBlock);
        CAstNode[] tryAsts = new CAstNode[tryList.size()];
        for (Iterator<Node> tns = tryList.iterator(); tns.hasNext();) {
          tryAsts[i++] = walkNodes(tns.next(), tryChild);
        }
        CAstNode tryBlock = Ast.makeNode(CAstNode.BLOCK_STMT, tryAsts);
        if (finallyBlock != null) {
          return Ast.makeNode(CAstNode.BLOCK_STMT,
              Ast.makeNode(CAstNode.UNWIND, Ast.makeNode(CAstNode.TRY, tryBlock, catchBlock), finallyBlock), walkNodes(c, context));
        } else {
          return Ast.makeNode(CAstNode.BLOCK_STMT, Ast.makeNode(CAstNode.TRY, tryBlock, catchBlock), walkNodes(c, context));
        }
      } else {
        int i = 0;
        CAstNode[] tryAsts = new CAstNode[tryList.size()];
        for (Iterator<Node> tns = tryList.iterator(); tns.hasNext();) {
          tryAsts[i++] = walkNodes(tns.next(), context);
        }
        CAstNode tryBlock = Ast.makeNode(CAstNode.BLOCK_STMT, tryAsts);
        return Ast.makeNode(
            CAstNode.BLOCK_STMT,
            Ast.makeNode(CAstNode.UNWIND, Ast.makeNode(CAstNode.BLOCK_STMT, tryBlock),
                Ast.makeNode(CAstNode.BLOCK_STMT, finallyBlock)), walkNodes(c, context));
      }
    }
    case Token.JSR: {
      return Ast.makeNode(CAstNode.EMPTY);
    }
    case Token.COMMA: {
      int count = countSiblingsStartingFrom(n.getFirstChild());
      CAstNode[] cs = new CAstNode[count];
      int i = 0;
      for (Node c = n.getFirstChild(); c != null; i++, c = c.getNext()) {
        if (c.getNext() == null) {
          context.updateBase(n, c);
        }
        cs[i] = walkNodes(c, context);
      }
      return Ast.makeNode(CAstNode.BLOCK_EXPR, cs);
    }
    case Token.ENTERWITH:
    case Token.LEAVEWITH: {
      return Ast.makeNode(CAstNode.EMPTY);
    }
    case Token.LOOP: {
      LoopContext child = new LoopContext(context);
      CAstNode[] nodes = gatherChildren(n, child);
      if (child.forInInitExpr != null) {
        String nm = child.forInVar;
        return Ast.makeNode(CAstNode.BLOCK_STMT, Ast.makeNode(CAstNode.DECL_STMT, Ast.makeConstant(new CAstSymbolImpl(nm, true)),
            walkNodes(child.forInInitExpr, context)), nodes);
      } else {
        return Ast.makeNode(CAstNode.BLOCK_STMT, nodes);
      }
    }
    case Token.WITH:
    case Token.FINALLY:
    case Token.BLOCK:
    case Token.LABEL: {
      Node c1 = n.getFirstChild();
      if (c1 != null && c1.getType() == Token.SWITCH) {
        Node switchValue = c1.getFirstChild();
        CAstNode defaultLabel = Ast.makeNode(CAstNode.LABEL_STMT, Ast.makeNode(CAstNode.EMPTY));
        context.cfg().map(defaultLabel, defaultLabel);
        List<CAstNode> labelCasts = new ArrayList<CAstNode>();
        for (Node kase = switchValue.getNext(); kase != null; kase = kase.getNext()) {
          assert kase.getType() == Token.CASE;
          Node caseLbl = kase.getFirstChild();
          Node target = ((Node.Jump) kase).target;
          CAstNode labelCast = walkNodes(caseLbl, context);
          labelCasts.add(labelCast);
          context.cfg().add(c1, target, labelCast);
        }
        CAstNode[] children = new CAstNode[labelCasts.size() + 1];
        int i = 0;
        children[i++] = Ast.makeNode(CAstNode.BLOCK_STMT, defaultLabel, gatherChildren(n, context, 1));
        for (CAstNode labelCast : labelCasts) {
          children[i++] = labelCast;
        }
        context.cfg().add(c1, defaultLabel, CAstControlFlowMap.SWITCH_DEFAULT);
        CAstNode switchAst = Ast.makeNode(CAstNode.SWITCH, walkNodes(switchValue, context), children);
        noteSourcePosition(context, switchAst, c1);
        context.cfg().map(c1, switchAst);
        return switchAst;
      }
      else {
        return Ast.makeNode(CAstNode.BLOCK_STMT, gatherChildren(n, context));
      }
    }
    case Token.EXPR_VOID:
    case Token.EXPR_RESULT: {
      WalkContext child = new ExpressionContext(context);
      Node expr = n.getFirstChild();
      if (NT == Token.EXPR_RESULT) {
        child.updateBase(n, expr);
      }
      return walkNodes(expr, child);
    }
    case Token.POS: {
      return Ast.makeNode(CAstNode.UNARY_EXPR, translateOpcode(Token.ADD), walkNodes(n.getFirstChild(), context));
    }
    case Token.CALL: {
      if (!isPrimitiveCall(context, n)) {
        CAstNode base = makeVarRef("$$ base");
        Node callee = n.getFirstChild();
        WalkContext child = new BaseCollectingContext(context, callee, "$$ base");
        CAstNode fun = walkNodes(callee, child);
        Node firstParamInParens = callee.getNext();
        if (child.foundBase(callee))
          return Ast.makeNode(
              CAstNode.LOCAL_SCOPE,
              Ast.makeNode(CAstNode.BLOCK_EXPR,
                  Ast.makeNode(CAstNode.DECL_STMT, Ast.makeConstant(new CAstSymbolImpl("$$ base")), Ast.makeConstant(null)),
                  makeCall(fun, base, firstParamInParens, context)));
        else {
          return makeCall(fun, makeVarRef(JSSSAPropagationCallGraphBuilder.GLOBAL_OBJ_VAR_NAME), firstParamInParens, context);
        }
      } else {
        return Ast.makeNode(CAstNode.PRIMITIVE, gatherChildren(n, context, 1));
      }
    }
    case Token.BINDNAME:
    case Token.NAME: {
      return readName(context, n.getString());
    }
    case Token.THIS: {
      return makeVarRef("this");
    }
    case Token.THISFN: {
      return makeVarRef(((FunctionNode) context.top()).getFunctionName());
    }
    case Token.STRING: {
      return Ast.makeConstant(n.getString());
    }
    case Token.NUMBER: {
      return Ast.makeConstant(n.getDouble());
    }
    case Token.FALSE: {
      return Ast.makeConstant(false);
    }
    case Token.TRUE: {
      return Ast.makeConstant(true);
    }
    case Token.NULL:
    case Token.VOID: {
      return Ast.makeConstant(null);
    }
    case Token.ADD:
    case Token.DIV:
    case Token.LSH:
    case Token.MOD:
    case Token.MUL:
    case Token.RSH:
    case Token.SUB:
    case Token.URSH:
    case Token.BITAND:
    case Token.BITOR:
    case Token.BITXOR:
    case Token.EQ:
    case Token.SHEQ:
    case Token.GE:
    case Token.GT:
    case Token.LE:
    case Token.LT:
    case Token.SHNE:
    case Token.NE: {
      Node l = n.getFirstChild();
      Node r = l.getNext();
      return Ast.makeNode(CAstNode.BINARY_EXPR, translateOpcode(NT), walkNodes(l, context), walkNodes(r, context));
    }
    case Token.NEG: {
      return Ast.makeNode(CAstNode.UNARY_EXPR, translateOpcode(Token.SUB), walkNodes(n.getFirstChild(), context));
    }
    case Token.BITNOT:
    case Token.NOT: {
      return Ast.makeNode(CAstNode.UNARY_EXPR, translateOpcode(NT), walkNodes(n.getFirstChild(), context));
    }
    case Token.VAR:
    case Token.CONST: {
      List<CAstNode> result = new ArrayList<CAstNode>();
      Node nm = n.getFirstChild();
      while (nm != null) {
        context.addNameDecl(Ast.makeNode(CAstNode.DECL_STMT, Ast.makeConstant(new CAstSymbolImpl(nm.getString())),
            readName(context, "$$undefined")));
        if (nm.getFirstChild() != null) {
          WalkContext child = new ExpressionContext(context);
          result.add(Ast.makeNode(CAstNode.ASSIGN, makeVarRef(nm.getString()),
              walkNodes(nm.getFirstChild(), child)));
        }
        nm = nm.getNext();
      }
      if (result.size() > 0) {
        return Ast.makeNode(CAstNode.BLOCK_EXPR, result.toArray(new CAstNode[result.size()]));
      } else {
        return Ast.makeNode(CAstNode.EMPTY);
      }
    }
    case Token.REGEXP: {
      int regexIdx = n.getIntProp(Node.REGEXP_PROP, -1);
      assert regexIdx != -1 : "while converting: " + context.top().toStringTree(context.top()) + "\nlooking at bad regex:\n "
          + n.toStringTree(context.top());
      String flags = context.top().getRegexpFlags(regexIdx);
      Node flagsNode = Node.newString(flags);
      String str = context.top().getRegexpString(regexIdx);
      Node strNode = Node.newString(str);
      strNode.addChildToFront(flagsNode);
      return handleNew(context, "RegExp", strNode);
    }
    case Token.ENUM_INIT_KEYS: {
      context.createForInVar(n.getFirstChild());
      return Ast.makeNode(CAstNode.EMPTY);
    }
    case Token.ENUM_ID: {
      return Ast.makeNode(CAstNode.EACH_ELEMENT_GET, makeVarRef(context.getForInInitVar()));
    }
    case Token.ENUM_NEXT: {
      return Ast.makeNode(CAstNode.EACH_ELEMENT_HAS_NEXT, makeVarRef(context.getForInInitVar()));
    }
    case Token.RETURN: {
      Node val = n.getFirstChild();
      if (val != null) {
        WalkContext child = new ExpressionContext(context);
        return Ast.makeNode(CAstNode.RETURN, walkNodes(val, child));
      } else {
        return Ast.makeNode(CAstNode.RETURN);
      }
    }
    case Token.SETNAME: {
      Node nm = n.getFirstChild();
      return Ast.makeNode(CAstNode.ASSIGN, walkNodes(nm, context), walkNodes(nm.getNext(), context));
    }
    case Token.IFNE:
    case Token.IFEQ: {
      context.cfg().add(n, ((Node.Jump) n).target, Boolean.TRUE);
      WalkContext child = new ExpressionContext(context);
      CAstNode gotoAst = Ast.makeNode(CAstNode.IFGOTO, translateOpcode(NT), walkNodes(n.getFirstChild(), child),
          Ast.makeConstant(1));
      context.cfg().map(n, gotoAst);
      return gotoAst;
    }
    case Token.GOTO: {
      context.cfg().add(n, ((Node.Jump) n).target, null);
      CAstNode gotoAst = Ast.makeNode(CAstNode.GOTO, Ast.makeConstant(((Node.Jump) n).target.labelId()));
      context.cfg().map(n, gotoAst);
      return gotoAst;
    }
    case Token.BREAK: {
      context.cfg().add(n, ((Node.Jump) n).getJumpStatement().target, null);
      CAstNode gotoAst = Ast.makeNode(CAstNode.GOTO, Ast.makeConstant(((Node.Jump) n).getJumpStatement().target.labelId()));
      context.cfg().map(n, gotoAst);
      return gotoAst;
    }
    case Token.CONTINUE: {
      context.cfg().add(n, ((Node.Jump) n).getJumpStatement().getContinue(), null);
      CAstNode gotoAst = Ast.makeNode(CAstNode.GOTO, Ast.makeConstant(((Node.Jump) n).getJumpStatement().getContinue().labelId()));
      context.cfg().map(n, gotoAst);
      return gotoAst;
    }
    case Token.TARGET: {
      CAstNode result = Ast.makeNode(CAstNode.LABEL_STMT, Ast.makeConstant(n.labelId()), Ast.makeNode(CAstNode.EMPTY));
      context.cfg().map(n, result);
      return result;
    }
    case Token.OR: {
    	Node l = n.getFirstChild();
    	Node r = l.getNext();
    	CAstNode lhs = walkNodes(l, context);
    	String lhsTempName = "or___lhs";
    	return Ast.makeNode(
    			CAstNode.LOCAL_SCOPE,
    			Ast.makeNode(CAstNode.BLOCK_EXPR,
    					Ast.makeNode(CAstNode.DECL_STMT, Ast.makeConstant(new CAstSymbolImpl(lhsTempName)), lhs),
    					Ast.makeNode(CAstNode.IF_EXPR, makeVarRef(lhsTempName), makeVarRef(lhsTempName), walkNodes(r, context))));
    }
    case Token.AND: {
      Node l = n.getFirstChild();
      Node r = l.getNext();
      CAstNode lhs = walkNodes(l, context);
      String lhsTempName = "and___lhs";
      return Ast.makeNode(
    		  CAstNode.LOCAL_SCOPE,
    		  Ast.makeNode(CAstNode.BLOCK_EXPR,
    				  Ast.makeNode(CAstNode.DECL_STMT, Ast.makeConstant(new CAstSymbolImpl(lhsTempName)), lhs),
    				  Ast.makeNode(CAstNode.IF_EXPR, makeVarRef(lhsTempName), walkNodes(r, context), makeVarRef(lhsTempName))));
    }
    case Token.HOOK: {
      Node cond = n.getFirstChild();
      Node thenBranch = cond.getNext();
      Node elseBranch = thenBranch.getNext();
      return Ast.makeNode(CAstNode.IF_EXPR, walkNodes(cond, context), walkNodes(thenBranch, context),
          walkNodes(elseBranch, context));
    }
    case Token.INC:
    case Token.DEC: {
      int flags = n.getIntProp(Node.INCRDECR_PROP, -1);
      CAstNode op = ((flags & Node.DECR_FLAG) != 0) ? CAstOperator.OP_SUB : CAstOperator.OP_ADD;
      Node l = n.getFirstChild();
      CAstNode last = walkNodes(l, context);
      return Ast.makeNode((((flags & Node.POST_FLAG) != 0) ? CAstNode.ASSIGN_POST_OP : CAstNode.ASSIGN_PRE_OP), last,
          Ast.makeConstant(1), op);
    }
    case Token.NEW: {
      if (isPrimitiveCreation(context, n)) {
        return makeBuiltinNew(n.getFirstChild().getString());
      } else {
        Node receiver = n.getFirstChild();
        return handleNew(context, walkNodes(receiver, context), receiver.getNext());
      }
    }
    case Token.ARRAYLIT: {
      int count = 0;
      for (Node x = n.getFirstChild(); x != null; count++, x = x.getNext())
        ;
      int i = 0;
      CAstNode[] args = new CAstNode[2 * count + 1];
      args[i++] = (isPrologueScript(context)) ? makeBuiltinNew("Array") : handleNew(context, "Array", null);
      int[] skips = (int[]) n.getProp(Node.SKIP_INDEXES_PROP);
      int skip = 0;
      int idx = 0;
      Node elt = n.getFirstChild();
      while (elt != null) {
        if (skips != null && skip < skips.length && skips[skip] == idx) {
          skip++;
          idx++;
          continue;
        }
        args[i++] = Ast.makeConstant(idx++);
        args[i++] = walkNodes(elt, context);
        elt = elt.getNext();
      }
      return Ast.makeNode(CAstNode.OBJECT_LITERAL, args);
    }
    case Token.OBJECTLIT: {
      Object[] propertyList = (Object[]) n.getProp(Node.OBJECT_IDS_PROP);
      CAstNode[] args = new CAstNode[propertyList.length * 2 + 1];
      int i = 0;
      args[i++] = ((isPrologueScript(context)) ? makeBuiltinNew("Object") : handleNew(context, "Object", null));
      Node val = n.getFirstChild();
      int nameIdx = 0;
      for (; nameIdx < propertyList.length; nameIdx++, val = val.getNext()) {
        args[i++] = Ast.makeConstant(propertyList[nameIdx]);
        args[i++] = walkNodes(val, context);
      }
      return Ast.makeNode(CAstNode.OBJECT_LITERAL, args);
    }
    case Token.GETPROP:
    case Token.GETELEM: {
      Node receiver = n.getFirstChild();
      Node element = receiver.getNext();
      CAstNode rcvr = walkNodes(receiver, context);
      String baseVarName = context.getBaseVarNameIfRelevant(n);
      CAstNode elt = walkNodes(element, context);
      CAstNode get, result;
      if (baseVarName != null) {
        result = Ast.makeNode(CAstNode.BLOCK_EXPR, Ast.makeNode(CAstNode.ASSIGN, makeVarRef(baseVarName), rcvr),
            get = Ast.makeNode(CAstNode.OBJECT_REF, makeVarRef(baseVarName), elt));
      } else {
        result = get = Ast.makeNode(CAstNode.OBJECT_REF, rcvr, elt);
      }
      if (context.getCatchTarget() != null) {
        context.cfg().map(get, get);
        context.cfg().add(get, context.getCatchTarget(), JavaScriptTypes.TypeError);
      }
      return result;
    }
    case Token.GET_REF: {
      Node child1 = n.getFirstChild();
      assert child1.getType() == Token.REF_SPECIAL;
      assert child1.getProp(Node.NAME_PROP).equals("__proto__");
      Node receiver = child1.getFirstChild();
      assert child1.getNext() == null;
      CAstNode rcvr = walkNodes(receiver, context);
      final CAstNode result = Ast.makeNode(CAstNode.OBJECT_REF, rcvr, Ast.makeConstant("__proto__"));
      if (context.getCatchTarget() != null) {
        context.cfg().map(result, result);
        context.cfg().add(result, context.getCatchTarget(), JavaScriptTypes.TypeError);
      }
      return result;
    }
    case Token.SETPROP:
    case Token.SETELEM: {
      Node receiver = n.getFirstChild();
      Node elt = receiver.getNext();
      Node val = elt.getNext();
      CAstNode rcvr = walkNodes(receiver, context);
      return Ast.makeNode(CAstNode.ASSIGN, Ast.makeNode(CAstNode.OBJECT_REF, rcvr, walkNodes(elt, context)),
          walkNodes(val, context));
    }
    case Token.SET_REF: {
      Node child1 = n.getFirstChild();
      assert child1.getType() == Token.REF_SPECIAL;
      assert child1.getProp(Node.NAME_PROP).equals("__proto__");
      Node receiver = child1.getFirstChild();
      Node val = child1.getNext();
      CAstNode rcvr = walkNodes(receiver, context);
      return Ast.makeNode(CAstNode.ASSIGN, Ast.makeNode(CAstNode.OBJECT_REF, rcvr, Ast.makeConstant("__proto__")),
          walkNodes(val, context));
    }
    case Token.DELPROP: {
      Node receiver = n.getFirstChild();
      Node element = receiver.getNext();
      CAstNode rcvr = walkNodes(receiver, context);
      String baseVarName = context.getBaseVarNameIfRelevant(n);
      CAstNode elt = walkNodes(element, context);
      if (baseVarName != null) {
        return Ast.makeNode(CAstNode.BLOCK_EXPR, Ast.makeNode(CAstNode.ASSIGN, makeVarRef(baseVarName), rcvr),
            Ast.makeNode(CAstNode.ASSIGN, Ast.makeNode(CAstNode.OBJECT_REF, makeVarRef(baseVarName), elt), Ast.makeConstant(null)));
      } else {
        return Ast.makeNode(CAstNode.ASSIGN, Ast.makeNode(CAstNode.OBJECT_REF, rcvr, elt), Ast.makeConstant(null));
      }
    }
    case Token.TYPEOFNAME: {
      return Ast.makeNode(CAstNode.TYPE_OF, makeVarRef(n.getString()));
    }
    case Token.TYPEOF: {
      return Ast.makeNode(CAstNode.TYPE_OF, walkNodes(n.getFirstChild(), context));
    }
    case Token.SETPROP_OP:
    case Token.SETELEM_OP: {
      Node receiver = n.getFirstChild();
      Node elt = receiver.getNext();
      Node op = elt.getNext();
      CAstNode rcvr = walkNodes(receiver, context);
      return Ast.makeNode(CAstNode.ASSIGN_POST_OP, Ast.makeNode(CAstNode.OBJECT_REF, rcvr, walkNodes(elt, context)),
          walkNodes(op.getFirstChild().getNext(), context), translateOpcode(op.getType()));
    }
    case Token.THROW: {
      CAstNode catchNode = context.getCatchTarget();
      if (catchNode != null)
        context.cfg().add(n, context.getCatchTarget(), null);
      else
        context.cfg().add(n, CAstControlFlowMap.EXCEPTION_TO_EXIT, null);
      CAstNode throwAst = Ast.makeNode(CAstNode.THROW, walkNodes(n.getFirstChild(), context));
      context.cfg().map(n, throwAst);
      return throwAst;
    }
    case Token.EMPTY: {
      return Ast.makeConstant(null);
    }
    case Token.INSTANCEOF: {
      Node value = n.getFirstChild();
      Node type = value.getNext();
      return Ast.makeNode(CAstNode.INSTANCEOF, walkNodes(value, context), walkNodes(type, context));
    }
    case Token.IN: {
      Node value = n.getFirstChild();
      Node property = value.getNext();
      return Ast.makeNode(CAstNode.IS_DEFINED_EXPR, walkNodes(value, context), walkNodes(property, context));
    }
    default: {
      System.err.println("while converting: " + context.top().toStringTree(context.top()) + "\nlooking at unhandled:\n "
          + n.toStringTree(context.top()) + "\n(of type " + NT + ") (of class " + n.getClass() + ")" + " at " + n.getLineno());
      Assertions.UNREACHABLE();
      return null;
    }
    }
  }

Output:
  private CAstNode walkNodesInternal(final Node n, WalkContext context) {
    final int NT = n.getType();
    switch (NT) {
    case Token.FUNCTION: {
      int fnIndex = n.getExistingIntProp(Node.FUNCTION_PROP);
      FunctionNode fn = context.top().getFunctionNode(fnIndex);
      CAstEntity fne = walkEntity(fn, context);
      if (context.expressionContext()) {
        CAstNode fun = Ast.makeNode(CAstNode.FUNCTION_EXPR, Ast.makeConstant(fne));
        context.addScopedEntity(fun, fne);
        return fun;
      } else {
        context.addNameDecl(Ast.makeNode(CAstNode.FUNCTION_STMT, Ast.makeConstant(fne)));
        context.addScopedEntity(null, fne);
        return Ast.makeNode(CAstNode.EMPTY);
      }
    }
    case Token.CATCH_SCOPE: {
      Node catchVarNode = n.getFirstChild();
      String catchVarName = catchVarNode.getString();
      assert catchVarName != null;
      context.setCatchVar(catchVarName);
      return Ast.makeNode(CAstNode.EMPTY);
    }
    case Token.LOCAL_BLOCK: {
      return Ast.makeNode(CAstNode.BLOCK_EXPR, gatherChildren(n, context));
    }
    case Token.TRY: {
      Node catchNode = ((Node.Jump) n).target;
      Node finallyNode = ((Node.Jump) n).getFinally();
      ArrayList<Node> tryList = new ArrayList<Node>();
      ArrayList<Node> catchList = new ArrayList<Node>();
      ArrayList<Node> finallyList = new ArrayList<Node>();
      ArrayList<Node> current = tryList;
      Node c;
      for (c = n.getFirstChild(); c.getNext() != null; c = c.getNext()) {
        if (c == catchNode) {
          current = catchList;
        } else if (c == finallyNode) {
          current = finallyList;
        }
        if (c.getType() == Token.GOTO &&
            (c.getNext() == catchNode || c.getNext() == finallyNode)) {
          continue;
        }
        current.add(c);
      }
      CAstNode finallyBlock = null;
      if (finallyNode != null) {
        int i = 0;
        CAstNode[] finallyAsts = new CAstNode[finallyList.size()];
        for (Iterator<Node> fns = finallyList.iterator(); fns.hasNext();) {
          finallyAsts[i++] = walkNodes(fns.next(), context);
        }
        finallyBlock = Ast.makeNode(CAstNode.BLOCK_STMT, finallyAsts);
      }
      if (catchNode != null) {
        int i = 0;
        WalkContext catchChild = new CatchBlockContext(context);
        CAstNode[] catchAsts = new CAstNode[catchList.size()];
        for (Iterator<Node> cns = catchList.iterator(); cns.hasNext();) {
          catchAsts[i++] = walkNodes(cns.next(), catchChild);
        }
        CAstNode catchBlock = Ast.makeNode(CAstNode.CATCH, Ast.makeConstant(catchChild.getCatchVar()),
            Ast.makeNode(CAstNode.BLOCK_STMT, catchAsts));
        context.cfg().map(catchBlock, catchBlock);
        i = 0;
        WalkContext tryChild = new TryBlockContext(context, catchBlock);
        CAstNode[] tryAsts = new CAstNode[tryList.size()];
        for (Iterator<Node> tns = tryList.iterator(); tns.hasNext();) {
          tryAsts[i++] = walkNodes(tns.next(), tryChild);
        }
        CAstNode tryBlock = Ast.makeNode(CAstNode.BLOCK_STMT, tryAsts);
        if (finallyBlock != null) {
          return Ast.makeNode(CAstNode.BLOCK_STMT,
              Ast.makeNode(CAstNode.UNWIND, Ast.makeNode(CAstNode.TRY, tryBlock, catchBlock), finallyBlock), walkNodes(c, context));
        } else {
          return Ast.makeNode(CAstNode.BLOCK_STMT, Ast.makeNode(CAstNode.TRY, tryBlock, catchBlock), walkNodes(c, context));
        }
      } else {
        int i = 0;
        CAstNode[] tryAsts = new CAstNode[tryList.size()];
        for (Iterator<Node> tns = tryList.iterator(); tns.hasNext();) {
          tryAsts[i++] = walkNodes(tns.next(), context);
        }
        CAstNode tryBlock = Ast.makeNode(CAstNode.BLOCK_STMT, tryAsts);
        return Ast.makeNode(
            CAstNode.BLOCK_STMT,
            Ast.makeNode(CAstNode.UNWIND, Ast.makeNode(CAstNode.BLOCK_STMT, tryBlock),
                Ast.makeNode(CAstNode.BLOCK_STMT, finallyBlock)), walkNodes(c, context));
      }
    }
    case Token.JSR: {
      return Ast.makeNode(CAstNode.EMPTY);
    }
    case Token.COMMA: {
      int count = countSiblingsStartingFrom(n.getFirstChild());
      CAstNode[] cs = new CAstNode[count];
      int i = 0;
      for (Node c = n.getFirstChild(); c != null; i++, c = c.getNext()) {
        if (c.getNext() == null) {
          context.updateBase(n, c);
        }
        cs[i] = walkNodes(c, context);
      }
      return Ast.makeNode(CAstNode.BLOCK_EXPR, cs);
    }
    case Token.ENTERWITH:
    case Token.LEAVEWITH: {
      return Ast.makeNode(CAstNode.EMPTY);
    }
    case Token.LOOP: {
      LoopContext child = new LoopContext(context);
      CAstNode[] nodes = gatherChildren(n, child);
      if (child.forInInitExpr != null) {
        String nm = child.forInVar;
        return Ast.makeNode(CAstNode.BLOCK_STMT, Ast.makeNode(CAstNode.DECL_STMT, Ast.makeConstant(new CAstSymbolImpl(nm, true)),
            walkNodes(child.forInInitExpr, context)), nodes);
      } else {
        return Ast.makeNode(CAstNode.BLOCK_STMT, nodes);
      }
    }
    case Token.WITH:
    case Token.FINALLY:
    case Token.BLOCK:
    case Token.LABEL: {
      Node c1 = n.getFirstChild();
      if (c1 != null && c1.getType() == Token.SWITCH) {
        Node switchValue = c1.getFirstChild();
        CAstNode defaultLabel = Ast.makeNode(CAstNode.LABEL_STMT, Ast.makeNode(CAstNode.EMPTY));
        context.cfg().map(defaultLabel, defaultLabel);
        List<CAstNode> labelCasts = new ArrayList<CAstNode>();
        for (Node kase = switchValue.getNext(); kase != null; kase = kase.getNext()) {
          assert kase.getType() == Token.CASE;
          Node caseLbl = kase.getFirstChild();
          Node target = ((Node.Jump) kase).target;
          CAstNode labelCast = walkNodes(caseLbl, context);
          labelCasts.add(labelCast);
          context.cfg().add(c1, target, labelCast);
        }
        CAstNode[] children = new CAstNode[labelCasts.size() + 1];
        int i = 0;
        children[i++] = Ast.makeNode(CAstNode.BLOCK_STMT, defaultLabel, gatherChildren(n, context, 1));
        for (CAstNode labelCast : labelCasts) {
          children[i++] = labelCast;
        }
        context.cfg().add(c1, defaultLabel, CAstControlFlowMap.SWITCH_DEFAULT);
        CAstNode switchAst = Ast.makeNode(CAstNode.SWITCH, walkNodes(switchValue, context), children);
        noteSourcePosition(context, switchAst, c1);
        context.cfg().map(c1, switchAst);
        return switchAst;
      }
      else {
        return Ast.makeNode(CAstNode.BLOCK_STMT, gatherChildren(n, context));
      }
    }
    case Token.EXPR_VOID:
    case Token.EXPR_RESULT: {
      WalkContext child = new ExpressionContext(context);
      Node expr = n.getFirstChild();
      if (NT == Token.EXPR_RESULT) {
        child.updateBase(n, expr);
      }
      return walkNodes(expr, child);
    }
    case Token.POS: {
      return Ast.makeNode(CAstNode.UNARY_EXPR, translateOpcode(Token.ADD), walkNodes(n.getFirstChild(), context));
    }
    case Token.CALL: {
      if (!isPrimitiveCall(context, n)) {
        CAstNode base = makeVarRef("$$ base");
        Node callee = n.getFirstChild();
        WalkContext child = new BaseCollectingContext(context, callee, "$$ base");
        CAstNode fun = walkNodes(callee, child);
        Node firstParamInParens = callee.getNext();
        if (child.foundBase(callee))
          return Ast.makeNode(
              CAstNode.LOCAL_SCOPE,
              Ast.makeNode(CAstNode.BLOCK_EXPR,
                  Ast.makeNode(CAstNode.DECL_STMT, Ast.makeConstant(new CAstSymbolImpl("$$ base")), Ast.makeConstant(null)),
                  makeCall(fun, base, firstParamInParens, context)));
        else {
          return makeCall(fun, makeVarRef(JSSSAPropagationCallGraphBuilder.GLOBAL_OBJ_VAR_NAME), firstParamInParens, context);
        }
      } else {
        return Ast.makeNode(CAstNode.PRIMITIVE, gatherChildren(n, context, 1));
      }
    }
    case Token.BINDNAME:
    case Token.NAME: {
      return readName(context, n.getString());
    }
    case Token.THIS: {
      return makeVarRef("this");
    }
    case Token.THISFN: {
      return makeVarRef(((FunctionNode) context.top()).getFunctionName());
    }
    case Token.STRING: {
      return Ast.makeConstant(n.getString());
    }
    case Token.NUMBER: {
      return Ast.makeConstant(n.getDouble());
    }
    case Token.FALSE: {
      return Ast.makeConstant(false);
    }
    case Token.TRUE: {
      return Ast.makeConstant(true);
    }
    case Token.NULL:
    case Token.VOID: {
      return Ast.makeConstant(null);
    }
    case Token.ADD:
    case Token.DIV:
    case Token.LSH:
    case Token.MOD:
    case Token.MUL:
    case Token.RSH:
    case Token.SUB:
    case Token.URSH:
    case Token.BITAND:
    case Token.BITOR:
    case Token.BITXOR:
    case Token.EQ:
    case Token.SHEQ:
    case Token.GE:
    case Token.GT:
    case Token.LE:
    case Token.LT:
    case Token.SHNE:
    case Token.NE: {
      Node l = n.getFirstChild();
      Node r = l.getNext();
      return Ast.makeNode(CAstNode.BINARY_EXPR, translateOpcode(NT), walkNodes(l, context), walkNodes(r, context));
    }
    case Token.NEG: {
      return Ast.makeNode(CAstNode.UNARY_EXPR, translateOpcode(Token.SUB), walkNodes(n.getFirstChild(), context));
    }
    case Token.BITNOT:
    case Token.NOT: {
      return Ast.makeNode(CAstNode.UNARY_EXPR, translateOpcode(NT), walkNodes(n.getFirstChild(), context));
    }
    case Token.VAR:
    case Token.CONST: {
      List<CAstNode> result = new ArrayList<CAstNode>();
      Node nm = n.getFirstChild();
      while (nm != null) {
        context.addNameDecl(Ast.makeNode(CAstNode.DECL_STMT, Ast.makeConstant(new CAstSymbolImpl(nm.getString())),
            readName(context, "$$undefined")));
        if (nm.getFirstChild() != null) {
          WalkContext child = new ExpressionContext(context);
          result.add(Ast.makeNode(CAstNode.ASSIGN, makeVarRef(nm.getString()),
              walkNodes(nm.getFirstChild(), child)));
        }
        nm = nm.getNext();
      }
      if (result.size() > 0) {
        return Ast.makeNode(CAstNode.BLOCK_EXPR, result.toArray(new CAstNode[result.size()]));
      } else {
        return Ast.makeNode(CAstNode.EMPTY);
      }
    }
    case Token.REGEXP: {
      int regexIdx = n.getIntProp(Node.REGEXP_PROP, -1);
      assert regexIdx != -1 : "while converting: " + context.top().toStringTree(context.top()) + "\nlooking at bad regex:\n "
          + n.toStringTree(context.top());
      String flags = context.top().getRegexpFlags(regexIdx);
      Node flagsNode = Node.newString(flags);
      String str = context.top().getRegexpString(regexIdx);
      Node strNode = Node.newString(str);
      strNode.addChildToFront(flagsNode);
      return handleNew(context, "RegExp", strNode);
    }
    case Token.ENUM_INIT_KEYS: {
      context.createForInVar(n.getFirstChild());
      return Ast.makeNode(CAstNode.EMPTY);
    }
    case Token.ENUM_ID: {
      return Ast.makeNode(CAstNode.EACH_ELEMENT_GET, makeVarRef(context.getForInInitVar()));
    }
    case Token.ENUM_NEXT: {
      return Ast.makeNode(CAstNode.EACH_ELEMENT_HAS_NEXT, makeVarRef(context.getForInInitVar()));
    }
    case Token.RETURN: {
      Node val = n.getFirstChild();
      if (val != null) {
        WalkContext child = new ExpressionContext(context);
        return Ast.makeNode(CAstNode.RETURN, walkNodes(val, child));
      } else {
        return Ast.makeNode(CAstNode.RETURN);
      }
    }
    case Token.SETNAME: {
      Node nm = n.getFirstChild();
      return Ast.makeNode(CAstNode.ASSIGN, walkNodes(nm, context), walkNodes(nm.getNext(), context));
    }
    case Token.IFNE:
    case Token.IFEQ: {
      context.cfg().add(n, ((Node.Jump) n).target, Boolean.TRUE);
      WalkContext child = new ExpressionContext(context);
      CAstNode gotoAst = Ast.makeNode(CAstNode.IFGOTO, translateOpcode(NT), walkNodes(n.getFirstChild(), child),
          Ast.makeConstant(1));
      context.cfg().map(n, gotoAst);
      return gotoAst;
    }
    case Token.GOTO: {
      context.cfg().add(n, ((Node.Jump) n).target, null);
      CAstNode gotoAst = Ast.makeNode(CAstNode.GOTO, Ast.makeConstant(((Node.Jump) n).target.labelId()));
      context.cfg().map(n, gotoAst);
      return gotoAst;
    }
    case Token.BREAK: {
      context.cfg().add(n, ((Node.Jump) n).getJumpStatement().target, null);
      CAstNode gotoAst = Ast.makeNode(CAstNode.GOTO, Ast.makeConstant(((Node.Jump) n).getJumpStatement().target.labelId()));
      context.cfg().map(n, gotoAst);
      return gotoAst;
    }
    case Token.CONTINUE: {
      context.cfg().add(n, ((Node.Jump) n).getJumpStatement().getContinue(), null);
      CAstNode gotoAst = Ast.makeNode(CAstNode.GOTO, Ast.makeConstant(((Node.Jump) n).getJumpStatement().getContinue().labelId()));
      context.cfg().map(n, gotoAst);
      return gotoAst;
    }
    case Token.TARGET: {
      CAstNode result = Ast.makeNode(CAstNode.LABEL_STMT, Ast.makeConstant(n.labelId()), Ast.makeNode(CAstNode.EMPTY));
      context.cfg().map(n, result);
      return result;
    }
    case Token.OR: {
    	Node l = n.getFirstChild();
    	Node r = l.getNext();
    	CAstNode lhs = walkNodes(l, context);
    	String lhsTempName = "or___lhs";
    	return Ast.makeNode(
    			CAstNode.LOCAL_SCOPE,
    			Ast.makeNode(CAstNode.BLOCK_EXPR,
    					Ast.makeNode(CAstNode.DECL_STMT, Ast.makeConstant(new CAstSymbolImpl(lhsTempName)), lhs),
    					Ast.makeNode(CAstNode.IF_EXPR, makeVarRef(lhsTempName), makeVarRef(lhsTempName), walkNodes(r, context))));
    }
    case Token.AND: {
      Node l = n.getFirstChild();
      Node r = l.getNext();
      CAstNode lhs = walkNodes(l, context);
      String lhsTempName = "and___lhs";
      return Ast.makeNode(
    		  CAstNode.LOCAL_SCOPE,
    		  Ast.makeNode(CAstNode.BLOCK_EXPR,
    				  Ast.makeNode(CAstNode.DECL_STMT, Ast.makeConstant(new CAstSymbolImpl(lhsTempName)), lhs),
    				  Ast.makeNode(CAstNode.IF_EXPR, makeVarRef(lhsTempName), walkNodes(r, context), makeVarRef(lhsTempName))));
    }
    case Token.HOOK: {
      Node cond = n.getFirstChild();
      Node thenBranch = cond.getNext();
      Node elseBranch = thenBranch.getNext();
      return Ast.makeNode(CAstNode.IF_EXPR, walkNodes(cond, context), walkNodes(thenBranch, context),
          walkNodes(elseBranch, context));
    }
    case Token.INC:
    case Token.DEC: {
      int flags = n.getIntProp(Node.INCRDECR_PROP, -1);
      CAstNode op = ((flags & Node.DECR_FLAG) != 0) ? CAstOperator.OP_SUB : CAstOperator.OP_ADD;
      Node l = n.getFirstChild();
      CAstNode last = walkNodes(l, context);
      return Ast.makeNode((((flags & Node.POST_FLAG) != 0) ? CAstNode.ASSIGN_POST_OP : CAstNode.ASSIGN_PRE_OP), last,
          Ast.makeConstant(1), op);
    }
    case Token.NEW: {
      if (isPrimitiveCreation(context, n)) {
        return makeBuiltinNew(n.getFirstChild().getString());
      } else {
        Node receiver = n.getFirstChild();
        return handleNew(context, walkNodes(receiver, context), receiver.getNext());
      }
    }
    case Token.ARRAYLIT: {
      int count = 0;
      for (Node x = n.getFirstChild(); x != null; count++, x = x.getNext())
        ;
      int i = 0;
      CAstNode[] args = new CAstNode[2 * count + 1];
      args[i++] = (isPrologueScript(context)) ? makeBuiltinNew("Array") : handleNew(context, "Array", null);
      int[] skips = (int[]) n.getProp(Node.SKIP_INDEXES_PROP);
      int skip = 0;
      int idx = 0;
      Node elt = n.getFirstChild();
      while (elt != null) {
        if (skips != null && skip < skips.length && skips[skip] == idx) {
          skip++;
          idx++;
          continue;
        }
        args[i++] = Ast.makeConstant(idx++);
        args[i++] = walkNodes(elt, context);
        elt = elt.getNext();
      }
      return Ast.makeNode(CAstNode.OBJECT_LITERAL, args);
    }
    case Token.OBJECTLIT: {
      Object[] propertyList = (Object[]) n.getProp(Node.OBJECT_IDS_PROP);
      CAstNode[] args = new CAstNode[propertyList.length * 2 + 1];
      int i = 0;
      args[i++] = ((isPrologueScript(context)) ? makeBuiltinNew("Object") : handleNew(context, "Object", null));
      Node val = n.getFirstChild();
      int nameIdx = 0;
      for (; nameIdx < propertyList.length; nameIdx++, val = val.getNext()) {
        args[i++] = Ast.makeConstant(propertyList[nameIdx]);
        args[i++] = walkNodes(val, context);
      }
      return Ast.makeNode(CAstNode.OBJECT_LITERAL, args);
    }
    case Token.GETPROP:
    case Token.GETELEM: {
      Node receiver = n.getFirstChild();
      Node element = receiver.getNext();
      CAstNode rcvr = walkNodes(receiver, context);
      String baseVarName = context.getBaseVarNameIfRelevant(n);
      CAstNode elt = walkNodes(element, context);
      CAstNode get, result;
      if (baseVarName != null) {
        result = Ast.makeNode(CAstNode.BLOCK_EXPR, Ast.makeNode(CAstNode.ASSIGN, makeVarRef(baseVarName), rcvr),
            get = Ast.makeNode(CAstNode.OBJECT_REF, makeVarRef(baseVarName), elt));
      } else {
        result = get = Ast.makeNode(CAstNode.OBJECT_REF, rcvr, elt);
      }
      if (context.getCatchTarget() != null) {
        context.cfg().map(get, get);
        context.cfg().add(get, context.getCatchTarget(), JavaScriptTypes.TypeError);
      }
      return result;
    }
    case Token.GET_REF: {
      Node child1 = n.getFirstChild();
      assert child1.getType() == Token.REF_SPECIAL;
      assert child1.getProp(Node.NAME_PROP).equals("__proto__");
      Node receiver = child1.getFirstChild();
      assert child1.getNext() == null;
      CAstNode rcvr = walkNodes(receiver, context);
      final CAstNode result = Ast.makeNode(CAstNode.OBJECT_REF, rcvr, Ast.makeConstant("__proto__"));
      if (context.getCatchTarget() != null) {
        context.cfg().map(result, result);
        context.cfg().add(result, context.getCatchTarget(), JavaScriptTypes.TypeError);
      }
      return result;
    }
    case Token.SETPROP:
    case Token.SETELEM: {
      Node receiver = n.getFirstChild();
      Node elt = receiver.getNext();
      Node val = elt.getNext();
      CAstNode rcvr = walkNodes(receiver, context);
      return Ast.makeNode(CAstNode.ASSIGN, Ast.makeNode(CAstNode.OBJECT_REF, rcvr, walkNodes(elt, context)),
          walkNodes(val, context));
    }
    case Token.SET_REF: {
      Node child1 = n.getFirstChild();
      assert child1.getType() == Token.REF_SPECIAL;
      assert child1.getProp(Node.NAME_PROP).equals("__proto__");
      Node receiver = child1.getFirstChild();
      Node val = child1.getNext();
      CAstNode rcvr = walkNodes(receiver, context);
      return Ast.makeNode(CAstNode.ASSIGN, Ast.makeNode(CAstNode.OBJECT_REF, rcvr, Ast.makeConstant("__proto__")),
          walkNodes(val, context));
    }
    case Token.DELPROP: {
      Node receiver = n.getFirstChild();
      Node element = receiver.getNext();
      CAstNode rcvr = walkNodes(receiver, context);
      String baseVarName = context.getBaseVarNameIfRelevant(n);
      CAstNode elt = walkNodes(element, context);
      if (baseVarName != null) {
        return Ast.makeNode(CAstNode.BLOCK_EXPR, Ast.makeNode(CAstNode.ASSIGN, makeVarRef(baseVarName), rcvr),
            Ast.makeNode(CAstNode.ASSIGN, Ast.makeNode(CAstNode.OBJECT_REF, makeVarRef(baseVarName), elt), Ast.makeConstant(null)));
      } else {
        return Ast.makeNode(CAstNode.ASSIGN, Ast.makeNode(CAstNode.OBJECT_REF, rcvr, elt), Ast.makeConstant(null));
      }
    }
    case Token.TYPEOFNAME: {
      return Ast.makeNode(CAstNode.TYPE_OF, makeVarRef(n.getString()));
    }
    case Token.TYPEOF: {
      return Ast.makeNode(CAstNode.TYPE_OF, walkNodes(n.getFirstChild(), context));
    }
    case Token.SETPROP_OP:
    case Token.SETELEM_OP: {
      Node receiver = n.getFirstChild();
      Node elt = receiver.getNext();
      Node op = elt.getNext();
      CAstNode rcvr = walkNodes(receiver, context);
      return Ast.makeNode(CAstNode.ASSIGN_POST_OP, Ast.makeNode(CAstNode.OBJECT_REF, rcvr, walkNodes(elt, context)),
          walkNodes(op.getFirstChild().getNext(), context), translateOpcode(op.getType()));
    }
    case Token.THROW: {
      CAstNode catchNode = context.getCatchTarget();
      if (catchNode != null)
        context.cfg().add(n, context.getCatchTarget(), null);
      else
        context.cfg().add(n, CAstControlFlowMap.EXCEPTION_TO_EXIT, null);
      CAstNode throwAst = Ast.makeNode(CAstNode.THROW, walkNodes(n.getFirstChild(), context));
      context.cfg().map(n, throwAst);
      return throwAst;
    }
    case Token.EMPTY: {
      return Ast.makeConstant(null);
    }
    case Token.INSTANCEOF: {
      Node value = n.getFirstChild();
      Node type = value.getNext();
      return Ast.makeNode(CAstNode.INSTANCEOF, walkNodes(value, context), walkNodes(type, context));
    }
    case Token.IN: {
      Node value = n.getFirstChild();
      Node property = value.getNext();
      return Ast.makeNode(CAstNode.IS_DEFINED_EXPR, walkNodes(property, context), walkNodes(value, context));
    }
    default: {
      System.err.println("while converting: " + context.top().toStringTree(context.top()) + "\nlooking at unhandled:\n "
          + n.toStringTree(context.top()) + "\n(of type " + NT + ") (of class " + n.getClass() + ")" + " at " + n.getLineno());
      Assertions.UNREACHABLE();
      return null;
    }
    }
  }


Input:
	public boolean writeMoP(){
		BitPack bitPack = new BitPack(this);
		bitPack.write(0);
		bitPack.writeGuidMask(new byte[] {1, 3, 2});
		bitPack.write(character.getName().length(), 6);
		bitPack.writeGuidMask(new byte[] {6, 4, 0});
		bitPack.write(0);
		bitPack.writeGuidMask(new byte[] {5, 7});
		bitPack.flush();
		bitPack.writeGuidBytes(new byte[] {1});
		this.putString(character.getName());
		bitPack.writeGuidBytes(new byte[] {0, 7});
		this.putInt(character.getCharRace());
		this.putInt(0);
		this.putInt(1);
		this.putInt(character.getCharClass());
		bitPack.writeGuidBytes(new byte[] {4, 6, 5});
		this.putInt(1);
		bitPack.writeGuidBytes(new byte[] {3, 2});
		Log.log("realm id: " + realm.id);
		this.wrap();
		return true;
	}

Output:
	public boolean writeMoP(){
		BitPack bitPack = new BitPack(this);
		bitPack.write(0);
		bitPack.writeGuidMask(new byte[] {1, 3, 2});
		bitPack.write(character.getName().length(), 6);
		bitPack.writeGuidMask(new byte[] {6, 4, 0});
		bitPack.write(0);
		bitPack.writeGuidMask(new byte[] {5, 7});
		bitPack.flush();
		bitPack.writeGuidBytes(new byte[] {1});
		this.putString(character.getName());
		bitPack.writeGuidBytes(new byte[] {0, 7});
		this.put((byte) character.getCharRace());
		this.put((byte) 0);
		this.put((byte) 1);
		this.put((byte) character.getCharClass());
		bitPack.writeGuidBytes(new byte[] {4, 6, 5});
		this.putInt(1);
		bitPack.writeGuidBytes(new byte[] {3, 2});
		Log.log("realm id: " + realm.id);
		this.wrap();
		return true;
	}


Input:
	protected Collection<URL> getAllPluginResourceURLs() {
		Set<URL> result = Sets.newLinkedHashSet();
		ClassLoader classLoader = ClassLoader.getSystemClassLoader();
		try {
			Enumeration<URL> resources = classLoader.getResources("plugin.xml");
			while (resources.hasMoreElements())
				result.add(resources.nextElement());
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		if (classLoader instanceof URLClassLoader) {
			URLClassLoader ucl = (URLClassLoader) classLoader;
			for (URL u : ucl.getURLs())
				if (!u.getFile().endsWith(".jar")) {
					try {
						java.io.File f = new java.io.File(u.toURI());
						if (f.isDirectory()) {
							int levels = 5;
							while (levels >= 0) {
								java.io.File pl = new java.io.File(f + "/" + "plugin.xml");
								if (pl.isFile()) {
									result.add(pl.toURI().toURL());
									break;
								}
								levels--;
								f = f.getParentFile();
							}
						}
					} catch (URISyntaxException e) {
						throw new RuntimeException(e);
					} catch (MalformedURLException e) {
						throw new RuntimeException(e);
					}
				}
		}
		return result;
	}

Output:
	protected Collection<URL> getAllPluginResourceURLs() {
		Set<URL> result = Sets.newLinkedHashSet();
		ClassLoader classLoader = ClassLoader.getSystemClassLoader();
		try {
			Enumeration<URL> resources = classLoader.getResources("plugin.xml");
			while (resources.hasMoreElements())
				result.add(resources.nextElement());
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		if (classLoader instanceof URLClassLoader) {
			URLClassLoader ucl = (URLClassLoader) classLoader;
			for (URL u : ucl.getURLs())
				if (!u.getFile().endsWith(".jar")) {
					try {
						java.io.File f = new java.io.File(u.toURI());
						if (f.isDirectory()) {
							int levels = 5;
							while (levels >= 0 && f != null) {
								java.io.File pl = new java.io.File(f + "/" + "plugin.xml");
								if (pl.isFile()) {
									result.add(pl.toURI().toURL());
									break;
								}
								levels--;
								f = f.getParentFile();
							}
						}
					} catch (URISyntaxException e) {
						throw new RuntimeException(e);
					} catch (MalformedURLException e) {
						throw new RuntimeException(e);
					}
				}
		}
		return result;
	}


Input:
    protected static List<List<Integer>> loadData(String filename) {
        ResourceDataReader resourceReader = new ResourceDataReader(
                String.format("/graphs/kosarajus_two_pass/%s", filename));
        List<List<Integer>> verticesToConnections = new ArrayList<List<Integer>>();
        String line;
        while ((line = resourceReader.readLine()) != null) {
            List<Integer> connections = new ArrayList<Integer>(2);
            verticesToConnections.add(connections);
            String[] words = line.split("\\s+");
            for (String word : words) {
                connections.add(Integer.parseInt(word.trim()));
            }
        }
        return verticesToConnections;
    }

Output:
    protected static List<List<Integer>> loadData(String filename) {
        try (ResourceDataReader resourceReader = new ResourceDataReader(
                String.format("/graphs/kosarajus_two_pass/%s", filename))) {
            List<List<Integer>> verticesToConnections = new ArrayList<List<Integer>>();
            String line;
            while ((line = resourceReader.readLine()) != null) {
                List<Integer> connections = new ArrayList<Integer>(2);
                verticesToConnections.add(connections);
                String[] words = line.split("\\s+");
                for (String word : words) {
                    connections.add(Integer.parseInt(word.trim()));
                }
            }
            return verticesToConnections;
        }
    }


Input:
	public InputStream getInputStream(URI uri) throws IOException {
		if(weakmap.containsKey(uri.toString())){
			return new ByteArrayInputStream(weakmap.get(uri));
		}
		try{
			BasicDBObject obj = new BasicDBObject();
			obj.put(ID, uri.toString());
			DBCursor c = col.find(obj);
			DBObject o = c.next();
			byte[] v = (byte[])o.get(DATA);
			weakmap.put(uri.toString(), v);
			return new ByteArrayInputStream(v);
		}catch(NoSuchElementException e){
			return null;
		}
	}

Output:
	public InputStream getInputStream(URI uri) throws IOException {
		byte[] cache = weakmap.get(uri.toString());
		if(cache != null){
			return new ByteArrayInputStream(cache);
		}
		try{
			BasicDBObject obj = new BasicDBObject();
			obj.put(ID, uri.toString());
			DBCursor c = col.find(obj);
			DBObject o = c.next();
			byte[] v = (byte[])o.get(DATA);
			weakmap.put(uri.toString(), v);
			return new ByteArrayInputStream(v);
		}catch(NoSuchElementException e){
			return null;
		}
	}


Input:
	public void onExecutionFinish(TestModel aModel, SuiteSummaryResult aResult) {
		if (captureConsoleOutput) {
			consoleInterceptor.stopIntercept();
		}
		stackPop().setAttribute(TEST_RUN_DURATION, nanoTimeToString(System.nanoTime() - executionStartTime));
		if (!isFork()) {
			long tempStart = System.nanoTime();
			stripTemporaryAttributes(document.getRootElement());
			FileOutputStream tempOutputStream;
			try {
				tempOutputStream = new FileOutputStream(outputFile);
			} catch (FileNotFoundException exc) {
				exc.printStackTrace();
				return;
			}
			try {
				if (transformHandling == TransformHandling.EXECUTE_TRANSFORM) {
					System.out.print("Transforming Integrity Result XML to HTML...");
					try {
						if (System.getProperty("javax.xml.transform.TransformerFactory") == null) {
							System.setProperty("javax.xml.transform.TransformerFactory",
									"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");
						}
						TransformerFactory tempTransformerFactory = TransformerFactory.newInstance();
						Transformer tempTransformer = tempTransformerFactory.newTransformer(new StreamSource(
								getXsltStream()));
						tempTransformer.setOutputProperty(OutputKeys.METHOD, "html");
						tempTransformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
						Source tempSource = new JDOMSource(document);
						StreamResult tempResult = new StreamResult(new FilterOutputStream(tempOutputStream) {
							private final char[] triggerOpenTagName = new char[] { 'x', 'm', 'l', 'd', 'a', 't', 'a' };
							private final char[] triggerCloseTagName = new char[] { '/', 'x', 'm', 'l', 'd', 'a', 't',
									'a' };
							private static final char TRIGGER_TAG_START = '<';
							private static final char TRIGGER_TAG_END = '<';
							private static final char TRIGGER_ATTRIBUTE = '"';
							private boolean insideXmlPart;
							private boolean insideAttribute;
							private boolean pastXmlPart;
							private int tagPosition;
							@Override
							public void write(int aByte) throws IOException {
								char tempChar = (char) aByte;
								if (!pastXmlPart) {
									if (!insideAttribute) {
										if (tempChar == TRIGGER_TAG_START) {
											tagPosition = 0;
										} else if (tempChar == TRIGGER_TAG_END) {
											tagPosition = -1;
										} else if (tagPosition >= 0) {
											if (insideXmlPart && tempChar == TRIGGER_ATTRIBUTE) {
												insideAttribute = true;
											} else {
												tagPosition++;
												if (insideXmlPart) {
													if (tagPosition < triggerCloseTagName.length - 1) {
														if (tempChar != triggerCloseTagName[tagPosition]) {
															tagPosition = 0;
														}
													} else if (tagPosition == triggerCloseTagName.length - 1) {
														insideXmlPart = false;
														pastXmlPart = true;
													}
												} else {
													if (tagPosition < triggerOpenTagName.length - 1) {
														if (tempChar != triggerOpenTagName[tagPosition]) {
															tagPosition = 0;
														}
													} else if (tagPosition == triggerOpenTagName.length - 1) {
														insideXmlPart = true;
														pastXmlPart = false;
													}
												}
											}
										}
									} else {
										if (insideXmlPart) {
											if (tempChar == TRIGGER_ATTRIBUTE) {
												insideAttribute = false;
											} else {
												if (tempChar == '<') {
													super.write("<".getBytes("UTF-8"));
													return;
												} else if (tempChar == '>') {
													super.write(">".getBytes("UTF-8"));
													return;
												}
											}
										}
									}
								}
								super.write(aByte);
							}
							@Override
							public void write(byte[] someBytes, int anOffset, int aLength) throws IOException {
								if (!pastXmlPart) {
									super.write(someBytes, anOffset, aLength);
								} else {
									out.write(someBytes, anOffset, aLength);
								}
							}
						});
						tempTransformer.transform(tempSource, tempResult);
					} catch (TransformerConfigurationException exc) {
						exc.printStackTrace();
					} catch (TransformerException exc) {
						exc.printStackTrace();
					}
				} else {
					System.out.print("Writing Result XML...");
					XMLOutputter tempSerializer = new XMLOutputter(Format.getPrettyFormat());
					tempSerializer.output(document, tempOutputStream);
				}
				long tempTime = System.nanoTime() - tempStart;
				System.out.println("done in " + ((double) (tempTime / 1000000) / 1000.0) + " seconds!");
			} catch (IOException exc) {
				exc.printStackTrace();
			} finally {
				try {
					tempOutputStream.close();
				} catch (IOException exc) {
				}
			}
		}
	}

Output:
	public void onExecutionFinish(TestModel aModel, SuiteSummaryResult aResult) {
		if (captureConsoleOutput) {
			consoleInterceptor.stopIntercept();
		}
		stackPop().setAttribute(TEST_RUN_DURATION, nanoTimeToString(System.nanoTime() - executionStartTime));
		if (!isFork()) {
			long tempStart = System.nanoTime();
			stripTemporaryAttributes(document.getRootElement());
			FileOutputStream tempOutputStream;
			try {
				tempOutputStream = new FileOutputStream(outputFile);
			} catch (FileNotFoundException exc) {
				exc.printStackTrace();
				return;
			}
			try {
				if (transformHandling == TransformHandling.EXECUTE_TRANSFORM) {
					System.out.print("Transforming Integrity Result XML to HTML...");
					try {
						if (System.getProperty("javax.xml.transform.TransformerFactory") == null) {
							System.setProperty("javax.xml.transform.TransformerFactory",
									"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");
						}
						TransformerFactory tempTransformerFactory = TransformerFactory.newInstance();
						Transformer tempTransformer = tempTransformerFactory.newTransformer(new StreamSource(
								getXsltStream()));
						tempTransformer.setOutputProperty(OutputKeys.METHOD, "html");
						tempTransformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
						Source tempSource = new JDOMSource(document);
						StreamResult tempResult = new StreamResult(new FilterOutputStream(tempOutputStream) {
							private final char[] triggerOpenTagName = new char[] { 'x', 'm', 'l', 'd', 'a', 't', 'a' };
							private final char[] triggerCloseTagName = new char[] { '/', 'x', 'm', 'l', 'd', 'a', 't',
									'a' };
							private static final char TRIGGER_TAG_START = '<';
							private static final char TRIGGER_TAG_END = '<';
							private static final char TRIGGER_ATTRIBUTE = '"';
							private boolean insideXmlPart;
							private boolean insideAttribute;
							private boolean pastXmlPart;
							private int tagPosition;
							@Override
							public void write(int aByte) throws IOException {
								char tempChar = (char) aByte;
								if (!pastXmlPart) {
									if (!insideAttribute) {
										if (tempChar == TRIGGER_TAG_START) {
											tagPosition = 0;
										} else if (tempChar == TRIGGER_TAG_END) {
											tagPosition = -1;
										} else if (tagPosition >= 0) {
											if (insideXmlPart && tempChar == TRIGGER_ATTRIBUTE) {
												insideAttribute = true;
											} else {
												tagPosition++;
												if (insideXmlPart) {
													if (tagPosition < triggerCloseTagName.length - 1) {
														if (tempChar != triggerCloseTagName[tagPosition]) {
															tagPosition = 0;
														}
													} else if (tagPosition == triggerCloseTagName.length - 1) {
														insideXmlPart = false;
														pastXmlPart = true;
														tagPosition = 0;
													}
												} else {
													if (tagPosition < triggerOpenTagName.length - 1) {
														if (tempChar != triggerOpenTagName[tagPosition]) {
															tagPosition = 0;
														}
													} else if (tagPosition == triggerOpenTagName.length - 1) {
														insideXmlPart = true;
														pastXmlPart = false;
														tagPosition = 0;
													}
												}
											}
										}
									} else {
										if (insideXmlPart) {
											if (tempChar == TRIGGER_ATTRIBUTE) {
												insideAttribute = false;
											} else {
												if (tempChar == '<') {
													super.write("<".getBytes("UTF-8"));
													return;
												} else if (tempChar == '>') {
													super.write(">".getBytes("UTF-8"));
													return;
												}
											}
										}
									}
								}
								super.write(aByte);
							}
							@Override
							public void write(byte[] someBytes, int anOffset, int aLength) throws IOException {
								if (!pastXmlPart) {
									super.write(someBytes, anOffset, aLength);
								} else {
									out.write(someBytes, anOffset, aLength);
								}
							}
						});
						tempTransformer.transform(tempSource, tempResult);
					} catch (TransformerConfigurationException exc) {
						exc.printStackTrace();
					} catch (TransformerException exc) {
						exc.printStackTrace();
					}
				} else {
					System.out.print("Writing Result XML...");
					XMLOutputter tempSerializer = new XMLOutputter(Format.getPrettyFormat());
					tempSerializer.output(document, tempOutputStream);
				}
				long tempTime = System.nanoTime() - tempStart;
				System.out.println("done in " + ((double) (tempTime / 1000000) / 1000.0) + " seconds!");
			} catch (IOException exc) {
				exc.printStackTrace();
			} finally {
				try {
					tempOutputStream.close();
				} catch (IOException exc) {
				}
			}
		}
	}


Input:
    public static Set<URL> findUrls(final ClassLoader classLoader) throws IOException {
        if (classLoader == null || classLoader.getClass().getName().equals("sun.misc.Launcher$ExtClassLoader")) {
            return Collections.emptySet();
        }
        final Set<URL> urls;
        if (URLClassLoader.class.isInstance(classLoader) && !DONT_USE_GET_URLS) {
            urls =  new HashSet<URL>();
            if (!isSurefire(classLoader)) {
                urls.addAll(Arrays.asList(URLClassLoader.class.cast(classLoader).getURLs()));
                urls.addAll(findUrls(classLoader.getParent()));
            } else {
                urls.addAll(fromClassPath());
            }
        } else {
            urls = findUrlFromResources(classLoader);
        }
        return urls;
    }

Output:
    public static Set<URL> findUrls(final ClassLoader classLoader) throws IOException {
        if (classLoader == null || (SYSTEM.getParent() != null && classLoader == SYSTEM.getParent())) {
            return Collections.emptySet();
        }
        final Set<URL> urls;
        if (URLClassLoader.class.isInstance(classLoader) && !DONT_USE_GET_URLS) {
            urls =  new HashSet<URL>();
            if (!isSurefire(classLoader)) {
                urls.addAll(Arrays.asList(URLClassLoader.class.cast(classLoader).getURLs()));
                urls.addAll(findUrls(classLoader.getParent()));
            } else {
                urls.addAll(fromClassPath());
            }
        } else {
            urls = findUrlFromResources(classLoader);
        }
        return urls;
    }


Input:
        protected WhatToDo handleRead( ByteBuffer buf , Connection conn ){
            if ( _state == State.WAITING || _state == State.IN_HEADER ){
                if ( _line == null )
                    _line = new StringBuilder();
                while ( buf.hasRemaining() ){
                    char c = (char)buf.get();
                    if ( c == '\r' )
                        continue;
                    if ( c == '\n' ){
                        if ( _line.length() == 0 ){
                            _logger.debug( 3 , "end of header" );
                            _state = State.READY_TO_STREAM;
                            break;
                        }
                        String line = _line.toString();
                        if ( _state == State.WAITING ){
                            int idx = line.indexOf( " " );
                            if ( idx < 0 ){
                                backendError( ServerErrorType.INVALID , "invalid first line [" + line + "]" );
                                return WhatToDo.ERROR;
                            }
                            line = line.substring( idx + 1 ).trim();
                            idx = line.indexOf( " " );
                            if ( idx < 0 )
                                _response.setResponseCode( Integer.parseInt( line ) );
                            else
                                _response.setStatus( Integer.parseInt( line.substring( 0 , idx ) ) , line.substring( idx + 1 ).trim() );
                            _logger.debug( 3 , "got first line " , line );
                            _state = State.IN_HEADER;
                        }
                        else {
                            int idx = line.indexOf( ":" );
                            if ( idx < 0 ){
                                backendError( ServerErrorType.INVALID , "invalid line [ " + line + "]" );
                                return WhatToDo.ERROR;
                            }
                            String name = line.substring( 0 , idx );
                            String value = line.substring( idx + 1 ).trim();
                            _logger.debug( 3 , "got header line " , line );
                            if ( name.equalsIgnoreCase( "Connection" ) ){
                                _keepalive = ! value.toLowerCase().contains( "close" );
                            }
                            else {
                                _response.setHeader( name , value );
                            }
                        }
                        _line.setLength( 0 );
                        continue;
                    }
                    _line.append( c );
                }
                if ( _state != State.READY_TO_STREAM )
                    return WhatToDo.CONTINUE;
                _logger.debug( 3 , "starting to stream data" );
            }
            if ( _state == State.READY_TO_STREAM ){
                MyChunk chunk = new MyChunk( this , conn , _response.getContentLength() , buf );
                _response.sendFile( new MySender( chunk ) );
                _state = State.STREAMING;
            }
            try {
                _response.done();
            }
            catch ( IOException ioe ){
                _logger.debug( 2 , "client error" , ioe );
                return WhatToDo.ERROR;
            }
            return WhatToDo.PAUSE;
        }

Output:
        protected WhatToDo handleRead( ByteBuffer buf , Connection conn ){
            if ( _state == State.WAITING || _state == State.IN_HEADER ){
                if ( _line == null )
                    _line = new StringBuilder();
                while ( buf.hasRemaining() ){
                    char c = (char)buf.get();
                    if ( c == '\r' )
                        continue;
                    if ( c == '\n' ){
                        if ( _line.length() == 0 ){
                            _logger.debug( 3 , "end of header" );
                            _state = State.READY_TO_STREAM;
                            break;
                        }
                        String line = _line.toString();
                        if ( _state == State.WAITING ){
                            int idx = line.indexOf( " " );
                            if ( idx < 0 ){
                                backendError( ServerErrorType.INVALID , "invalid first line [" + line + "]" );
                                return WhatToDo.ERROR;
                            }
                            line = line.substring( idx + 1 ).trim();
                            idx = line.indexOf( " " );
                            if ( idx < 0 )
                                _response.setResponseCode( Integer.parseInt( line ) );
                            else
                                _response.setStatus( Integer.parseInt( line.substring( 0 , idx ) ) , line.substring( idx + 1 ).trim() );
                            _logger.debug( 3 , "got first line " , line );
                            _state = State.IN_HEADER;
                        }
                        else {
                            int idx = line.indexOf( ":" );
                            if ( idx < 0 ){
                                backendError( ServerErrorType.INVALID , "invalid line [ " + line + "]" );
                                return WhatToDo.ERROR;
                            }
                            String name = line.substring( 0 , idx );
                            String value = line.substring( idx + 1 ).trim();
                            _logger.debug( 3 , "got header line " , line );
                            if ( name.equalsIgnoreCase( "Connection" ) ){
                                _keepalive = ! value.toLowerCase().contains( "close" );
                            }
                            else {
                                _response.addHeader( name , value );
                            }
                        }
                        _line.setLength( 0 );
                        continue;
                    }
                    _line.append( c );
                }
                if ( _state != State.READY_TO_STREAM )
                    return WhatToDo.CONTINUE;
                _logger.debug( 3 , "starting to stream data" );
            }
            if ( _state == State.READY_TO_STREAM ){
                MyChunk chunk = new MyChunk( this , conn , _response.getContentLength() , buf );
                _response.sendFile( new MySender( chunk ) );
                _state = State.STREAMING;
            }
            try {
                _response.done();
            }
            catch ( IOException ioe ){
                _logger.debug( 2 , "client error" , ioe );
                return WhatToDo.ERROR;
            }
            return WhatToDo.PAUSE;
        }


Input:
	public void run() {
		Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
		try {
			if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().saveAllEditors(true)) {
				Constructor<RubyRefactoring> constructor = refactoringClass.getConstructors()[0];
				Object[] args;
				if(constructor.getParameterTypes().length == 1) {
					args = new Object[] {selectionProvider};
				} else {
					args = new Object[0];
				}
				RubyRefactoring refactoring = constructor.newInstance(args);
				RubyRefactoringWizard wizard = new RubyRefactoringWizard(refactoring);
				wizard.setWindowTitle(refactoring.getName());
				RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
				op.run(shell, refactoring.getName());
			}
		} catch (Exception e) {
			RubyPlugin.log(e);
		}
	}

Output:
	public void run() {
		Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
		try {
			if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().saveAllEditors(true)) {
				Constructor<? extends RubyRefactoring> constructor = (Constructor<? extends RubyRefactoring>) refactoringClass.getConstructors()[0];
				Object[] args;
				if(constructor.getParameterTypes().length == 1) {
					args = new Object[] {selectionProvider};
				} else {
					args = new Object[0];
				}
				RubyRefactoring refactoring = constructor.newInstance(args);
				RubyRefactoringWizard wizard = new RubyRefactoringWizard(refactoring);
				wizard.setWindowTitle(refactoring.getName());
				RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
				op.run(shell, refactoring.getName());
			}
		} catch (Exception e) {
			RubyPlugin.log(e);
		}
	}