Program: 166840
Project: 166840
Buggy source:
/** 
 * Add visitors for the different kinds of statements.
 */
private void addStatementWriters(){
  addWriter(Block.class,new CSharpASTNodeWriter<Block>(this){
    @Override public void write(    Block block){
      matchAndWrite("String_Node_Str");
      writeNodes(block.statements());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(EmptyStatement.class,new CSharpASTNodeWriter<EmptyStatement>(this){
    @Override public void write(    EmptyStatement emptyStatement){
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(ExpressionStatement.class,new CSharpASTNodeWriter<ExpressionStatement>(this){
    @Override public void write(    ExpressionStatement expressionStatement){
      writeNode(expressionStatement.getExpression());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(IfStatement.class,new CSharpASTNodeWriter<IfStatement>(this){
    @Override public void write(    IfStatement ifStatement){
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(ifStatement.getExpression());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(ifStatement.getThenStatement());
      Statement elseStatement=ifStatement.getElseStatement();
      if (elseStatement != null) {
        copySpaceAndComments();
        matchAndWrite("String_Node_Str");
        copySpaceAndComments();
        writeNode(elseStatement);
      }
    }
  }
);
  addWriter(WhileStatement.class,new CSharpASTNodeWriter<WhileStatement>(this){
    @Override public void write(    WhileStatement whileStatement){
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(whileStatement.getExpression());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(whileStatement.getBody());
    }
  }
);
  addWriter(DoStatement.class,new CSharpASTNodeWriter<DoStatement>(this){
    @Override public void write(    DoStatement doStatement){
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(doStatement.getBody());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(doStatement.getExpression());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(ContinueStatement.class,new CSharpASTNodeWriter<ContinueStatement>(this){
    @Override public void write(    ContinueStatement continueStatement){
      if (continueStatement.getLabel() != null)       throw sourceNotSupported("String_Node_Str");
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(BreakStatement.class,new CSharpASTNodeWriter<BreakStatement>(this){
    @Override public void write(    BreakStatement breakStatement){
      if (breakStatement.getLabel() != null)       throw sourceNotSupported("String_Node_Str");
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(ForStatement.class,new ForStatementWriter(this));
  addWriter(EnhancedForStatement.class,new CSharpASTNodeWriter<EnhancedForStatement>(this){
    @Override public void write(    EnhancedForStatement enhancedForStatement){
      matchAndWrite("String_Node_Str","String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(enhancedForStatement.getParameter());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str","String_Node_Str");
      copySpaceAndComments();
      writeNode(enhancedForStatement.getExpression());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(enhancedForStatement.getBody());
    }
  }
);
  addWriter(SwitchStatement.class,new SwitchStatementWriter(this));
  addWriter(ReturnStatement.class,new CSharpASTNodeWriter<ReturnStatement>(this){
    @Override public void write(    ReturnStatement returnStatement){
      matchAndWrite("String_Node_Str");
      Expression expression=returnStatement.getExpression();
      if (expression != null) {
        copySpaceAndComments();
        writeNode(returnStatement.getExpression());
      }
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(VariableDeclarationStatement.class,new CSharpASTNodeWriter<VariableDeclarationStatement>(this){
    @Override public void write(    VariableDeclarationStatement variableDeclarationStatement){
      writeVariableDeclaration(variableDeclarationStatement.modifiers(),variableDeclarationStatement.getType(),variableDeclarationStatement.fragments());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(TryStatement.class,new TryStatementWriter(this));
  addWriter(ThrowStatement.class,new CSharpASTNodeWriter<ThrowStatement>(this){
    @Override public void write(    ThrowStatement throwStatement){
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(throwStatement.getExpression());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(ConstructorInvocation.class,new CSharpASTNodeWriter(this){
    @Override public void write(    ASTNode node){
      throw sourceNotSupported("String_Node_Str");
    }
  }
);
  addWriter(AssertStatement.class,new CSharpASTNodeWriter<AssertStatement>(this){
    @Override public void write(    AssertStatement assertStatement){
      getContext().addExtraUsing("String_Node_Str");
      matchAndWrite("String_Node_Str","String_Node_Str");
      skipSpaceAndComments();
      writeNode(assertStatement.getExpression());
      @Nullable Expression message=assertStatement.getMessage();
      if (message != null) {
        skipSpaceAndComments();
        matchAndWrite("String_Node_Str","String_Node_Str");
        copySpaceAndComments();
        writeNode(message);
        copySpaceAndComments();
        matchAndWrite("String_Node_Str","String_Node_Str");
      }
    }
  }
);
  addWriter(SynchronizedStatement.class,new CSharpASTNodeWriter<SynchronizedStatement>(this){
    @Override public void write(    SynchronizedStatement synchronizedStatement){
      matchAndWrite("String_Node_Str","String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      writeNode(synchronizedStatement.getExpression());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(synchronizedStatement.getBody());
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Add visitors for the different kinds of statements.
 */
private void addStatementWriters(){
  addWriter(Block.class,new CSharpASTNodeWriter<Block>(this){
    @Override public void write(    Block block){
      matchAndWrite("String_Node_Str");
      writeNodes(block.statements());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(EmptyStatement.class,new CSharpASTNodeWriter<EmptyStatement>(this){
    @Override public void write(    EmptyStatement emptyStatement){
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(ExpressionStatement.class,new CSharpASTNodeWriter<ExpressionStatement>(this){
    @Override public void write(    ExpressionStatement expressionStatement){
      writeNode(expressionStatement.getExpression());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(IfStatement.class,new CSharpASTNodeWriter<IfStatement>(this){
    @Override public void write(    IfStatement ifStatement){
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(ifStatement.getExpression());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(ifStatement.getThenStatement());
      Statement elseStatement=ifStatement.getElseStatement();
      if (elseStatement != null) {
        copySpaceAndComments();
        matchAndWrite("String_Node_Str");
        copySpaceAndComments();
        writeNode(elseStatement);
      }
    }
  }
);
  addWriter(WhileStatement.class,new CSharpASTNodeWriter<WhileStatement>(this){
    @Override public void write(    WhileStatement whileStatement){
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(whileStatement.getExpression());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(whileStatement.getBody());
    }
  }
);
  addWriter(DoStatement.class,new CSharpASTNodeWriter<DoStatement>(this){
    @Override public void write(    DoStatement doStatement){
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(doStatement.getBody());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(doStatement.getExpression());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(ContinueStatement.class,new CSharpASTNodeWriter<ContinueStatement>(this){
    @Override public void write(    ContinueStatement continueStatement){
      if (continueStatement.getLabel() != null)       throw sourceNotSupported("String_Node_Str");
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(BreakStatement.class,new CSharpASTNodeWriter<BreakStatement>(this){
    @Override public void write(    BreakStatement breakStatement){
      if (breakStatement.getLabel() != null)       throw sourceNotSupported("String_Node_Str");
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(ForStatement.class,new ForStatementWriter(this));
  addWriter(EnhancedForStatement.class,new CSharpASTNodeWriter<EnhancedForStatement>(this){
    @Override public void write(    EnhancedForStatement enhancedForStatement){
      matchAndWrite("String_Node_Str","String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(enhancedForStatement.getParameter());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str","String_Node_Str");
      copySpaceAndComments();
      writeNode(enhancedForStatement.getExpression());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(enhancedForStatement.getBody());
    }
  }
);
  addWriter(SwitchStatement.class,new SwitchStatementWriter(this));
  addWriter(ReturnStatement.class,new CSharpASTNodeWriter<ReturnStatement>(this){
    @Override public void write(    ReturnStatement returnStatement){
      matchAndWrite("String_Node_Str");
      Expression expression=returnStatement.getExpression();
      if (expression != null) {
        copySpaceAndComments();
        writeNode(returnStatement.getExpression());
      }
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(VariableDeclarationStatement.class,new CSharpASTNodeWriter<VariableDeclarationStatement>(this){
    @Override public void write(    VariableDeclarationStatement variableDeclarationStatement){
      writeVariableDeclaration(variableDeclarationStatement.modifiers(),variableDeclarationStatement.getType(),variableDeclarationStatement.fragments());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(TryStatement.class,new TryStatementWriter(this));
  addWriter(ThrowStatement.class,new CSharpASTNodeWriter<ThrowStatement>(this){
    @Override public void write(    ThrowStatement throwStatement){
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(throwStatement.getExpression());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(ConstructorInvocation.class,new CSharpASTNodeWriter(this){
    @Override public void write(    ASTNode node){
      throw sourceNotSupported("String_Node_Str");
    }
  }
);
  addWriter(AssertStatement.class,new CSharpASTNodeWriter<AssertStatement>(this){
    @Override public void write(    AssertStatement assertStatement){
      matchAndWrite("String_Node_Str",nativeReference("String_Node_Str","String_Node_Str"));
      write("String_Node_Str");
      skipSpaceAndComments();
      writeNode(assertStatement.getExpression());
      @Nullable Expression message=assertStatement.getMessage();
      if (message != null) {
        skipSpaceAndComments();
        matchAndWrite("String_Node_Str","String_Node_Str");
        copySpaceAndComments();
        writeNode(message);
        copySpaceAndComments();
        matchAndWrite("String_Node_Str","String_Node_Str");
      }
    }
  }
);
  addWriter(SynchronizedStatement.class,new CSharpASTNodeWriter<SynchronizedStatement>(this){
    @Override public void write(    SynchronizedStatement synchronizedStatement){
      matchAndWrite("String_Node_Str","String_Node_Str");
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      writeNode(synchronizedStatement.getExpression());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      copySpaceAndComments();
      writeNode(synchronizedStatement.getBody());
    }
  }
);
}