Program: 185352
Project: 185352
Buggy source:
public ModuleNode buildAST(SourceUnit sourceUnit,ClassLoader classLoader,Reduction cst) throws ParserException {
  setClassLoader(classLoader);
  makeModule();
  try {
    innerClassCounter=1;
    convertGroovy(ast);
    if (looksBroken(output) && output.getMethods().isEmpty() && sourceUnit.getErrorCollector().hasErrors()) {
      output.setEncounteredUnrecoverableError(true);
    }
    if (output.getStatementBlock().isEmpty() && output.getMethods().isEmpty() && output.getClasses().isEmpty()) {
      if (ast == null && sourceUnit.getErrorCollector().hasErrors()) {
        output.setEncounteredUnrecoverableError(true);
      }
      output.addStatement(ReturnStatement.RETURN_NULL_OR_VOID);
    }
    ClassNode scriptClassNode=output.getScriptClassDummy();
    if (scriptClassNode != null) {
      List<Statement> statements=output.getStatementBlock().getStatements();
      if (!statements.isEmpty()) {
        Statement firstStatement=statements.get(0);
        Statement lastStatement=statements.get(statements.size() - 1);
        scriptClassNode.setSourcePosition(firstStatement);
        scriptClassNode.setLastColumnNumber(lastStatement.getLastColumnNumber());
        scriptClassNode.setLastLineNumber(lastStatement.getLastLineNumber());
      }
    }
    output.setStart(0);
    output.setLineNumber(1);
    output.setColumnNumber(1);
    output.setEnd(locations.getEnd());
    output.setLastLineNumber(locations.getEndLine());
    output.setLastColumnNumber(locations.getEndColumn());
    BlockStatement blockStatement=output.getStatementBlock();
    if (!blockStatement.isEmpty() || !output.getMethods().isEmpty()) {
      ASTNode first=getFirst(blockStatement,output.getMethods());
      ASTNode last=getLast(blockStatement,output.getMethods());
      if (!blockStatement.isEmpty()) {
        blockStatement.setStart(first.getStart());
        blockStatement.setLineNumber(first.getLineNumber());
        blockStatement.setColumnNumber(first.getColumnNumber());
        blockStatement.setEnd(last.getEnd());
        blockStatement.setLastLineNumber(last.getLastLineNumber());
        blockStatement.setLastColumnNumber(last.getLastColumnNumber());
      }
      if (!output.getClasses().isEmpty()) {
        ClassNode scriptClass=output.getClasses().get(0);
        scriptClass.setStart(first.getStart());
        scriptClass.setLineNumber(first.getLineNumber());
        scriptClass.setColumnNumber(first.getColumnNumber());
        scriptClass.setEnd(last.getEnd());
        scriptClass.setLastLineNumber(last.getLastLineNumber());
        scriptClass.setLastColumnNumber(last.getLastColumnNumber());
        MethodNode runMethod=scriptClass.getDeclaredMethod("String_Node_Str",Parameter.EMPTY_ARRAY);
        runMethod.setStart(first.getStart());
        runMethod.setLineNumber(first.getLineNumber());
        runMethod.setColumnNumber(first.getColumnNumber());
        runMethod.setEnd(last.getEnd());
        runMethod.setLastLineNumber(last.getLastLineNumber());
        runMethod.setLastColumnNumber(last.getLastColumnNumber());
      }
    }
  }
 catch (  ASTRuntimeException e) {
    throw new ASTParserException(e.getMessage() + "String_Node_Str" + sourceUnit.getName(),e);
  }
  ast=null;
  return output;
}

Fixed version (ground truth):
public ModuleNode buildAST(SourceUnit sourceUnit,ClassLoader classLoader,Reduction cst) throws ParserException {
  setClassLoader(classLoader);
  makeModule();
  try {
    innerClassCounter=1;
    convertGroovy(ast);
    if (looksBroken(output) && output.getMethods().isEmpty() && sourceUnit.getErrorCollector().hasErrors()) {
      output.setEncounteredUnrecoverableError(true);
    }
    if (output.getStatementBlock().isEmpty() && output.getMethods().isEmpty() && output.getClasses().isEmpty()) {
      if (ast == null && sourceUnit.getErrorCollector().hasErrors()) {
        output.setEncounteredUnrecoverableError(true);
      }
      output.addStatement(ReturnStatement.RETURN_NULL_OR_VOID);
    }
    ClassNode scriptClassNode=output.getScriptClassDummy();
    if (scriptClassNode != null) {
      List<Statement> statements=output.getStatementBlock().getStatements();
      if (!statements.isEmpty()) {
        Statement firstStatement=statements.get(0);
        Statement lastStatement=statements.get(statements.size() - 1);
        scriptClassNode.setSourcePosition(firstStatement);
        scriptClassNode.setLastColumnNumber(lastStatement.getLastColumnNumber());
        scriptClassNode.setLastLineNumber(lastStatement.getLastLineNumber());
      }
    }
    output.setStart(0);
    output.setLineNumber(1);
    output.setColumnNumber(1);
    output.setEnd(locations.getEnd());
    output.setLastLineNumber(locations.getEndLine());
    output.setLastColumnNumber(locations.getEndColumn());
    BlockStatement blockStatement=output.getStatementBlock();
    if (!blockStatement.isEmpty() || !output.getMethods().isEmpty()) {
      ASTNode first=getFirst(blockStatement,output.getMethods());
      ASTNode last=getLast(blockStatement,output.getMethods());
      if (!blockStatement.isEmpty()) {
        blockStatement.setStart(first.getStart());
        blockStatement.setLineNumber(first.getLineNumber());
        blockStatement.setColumnNumber(first.getColumnNumber());
        blockStatement.setEnd(last.getEnd());
        blockStatement.setLastLineNumber(last.getLastLineNumber());
        blockStatement.setLastColumnNumber(last.getLastColumnNumber());
      }
      if (!output.getClasses().isEmpty()) {
        ClassNode scriptClass=output.getClasses().get(0);
        scriptClass.setStart(first.getStart());
        scriptClass.setLineNumber(first.getLineNumber());
        scriptClass.setColumnNumber(first.getColumnNumber());
        scriptClass.setEnd(last.getEnd());
        scriptClass.setLastLineNumber(last.getLastLineNumber());
        scriptClass.setLastColumnNumber(last.getLastColumnNumber());
        MethodNode runMethod=scriptClass.getDeclaredMethod("String_Node_Str",Parameter.EMPTY_ARRAY);
        runMethod.setStart(first.getStart());
        runMethod.setLineNumber(first.getLineNumber());
        runMethod.setColumnNumber(first.getColumnNumber());
        runMethod.setEnd(last.getEnd());
        runMethod.setLastLineNumber(last.getLastLineNumber());
        runMethod.setLastColumnNumber(last.getLastColumnNumber());
      }
    }
    output.putNodeMetaData(LocationSupport.class,locations);
  }
 catch (  ASTRuntimeException e) {
    throw new ASTParserException(e.getMessage() + "String_Node_Str" + sourceUnit.getName(),e);
  }
  ast=null;
  return output;
}