Program: 185351
Project: 185351
Buggy source:
@Override public ModuleNode visitCompilationUnit(CompilationUnitContext ctx){
  this.visit(ctx.packageDeclaration());
  for (  ASTNode e : this.visitStatements(ctx.statements())) {
    if (e instanceof DeclarationListStatement) {
      for (      Statement ds : ((DeclarationListStatement)e).getDeclarationStatements()) {
        moduleNode.addStatement(ds);
      }
    }
 else     if (e instanceof Statement) {
      moduleNode.addStatement((Statement)e);
    }
 else     if (e instanceof MethodNode) {
      moduleNode.addMethod((MethodNode)e);
    }
  }
  for (  ClassNode cl : this.classNodeList) {
    moduleNode.addClass(cl);
  }
  if (this.isPackageInfoDeclaration()) {
    this.addPackageInfoClassNode();
  }
 else {
    if (this.isBlankScript()) {
      this.addEmptyReturnStatement();
    }
  }
  this.configureScriptClassNode();
  if (null != this.numberFormatError) {
    throw createParsingFailedException(this.numberFormatError.getSecond().getMessage(),this.numberFormatError.getFirst());
  }
  moduleNode.setLineNumber(1);
  moduleNode.setColumnNumber(1);
  moduleNode.setEnd(locationSupport.getEnd());
  moduleNode.setLastLineNumber(locationSupport.getEndLine());
  moduleNode.setLastColumnNumber(locationSupport.getEndColumn());
  BlockStatement blockStatement=moduleNode.getStatementBlock();
  if (!blockStatement.isEmpty() || !moduleNode.getMethods().isEmpty()) {
    ASTNode alpha=findAlpha(blockStatement,moduleNode.getMethods());
    ASTNode omega=findOmega(blockStatement,moduleNode.getMethods());
    if (!blockStatement.isEmpty()) {
      blockStatement.setStart(alpha.getStart());
      blockStatement.setLineNumber(alpha.getLineNumber());
      blockStatement.setColumnNumber(alpha.getColumnNumber());
      blockStatement.setEnd(omega.getEnd());
      blockStatement.setLastLineNumber(omega.getLastLineNumber());
      blockStatement.setLastColumnNumber(omega.getLastColumnNumber());
    }
    if (!moduleNode.getClasses().isEmpty()) {
      ClassNode scriptClass=moduleNode.getClasses().get(0);
      scriptClass.setStart(alpha.getStart());
      scriptClass.setLineNumber(alpha.getLineNumber());
      scriptClass.setColumnNumber(alpha.getColumnNumber());
      scriptClass.setEnd(omega.getEnd());
      scriptClass.setLastLineNumber(omega.getLastLineNumber());
      scriptClass.setLastColumnNumber(omega.getLastColumnNumber());
      MethodNode runMethod=scriptClass.getDeclaredMethod("String_Node_Str",Parameter.EMPTY_ARRAY);
      runMethod.setStart(alpha.getStart());
      runMethod.setLineNumber(alpha.getLineNumber());
      runMethod.setColumnNumber(alpha.getColumnNumber());
      runMethod.setEnd(omega.getEnd());
      runMethod.setLastLineNumber(omega.getLastLineNumber());
      runMethod.setLastColumnNumber(omega.getLastColumnNumber());
    }
  }
  sourceUnit.setComments(lexer.getComments());
  return moduleNode;
}

Fixed version (ground truth):
@Override public ModuleNode visitCompilationUnit(CompilationUnitContext ctx){
  this.visit(ctx.packageDeclaration());
  for (  ASTNode e : this.visitStatements(ctx.statements())) {
    if (e instanceof DeclarationListStatement) {
      for (      Statement ds : ((DeclarationListStatement)e).getDeclarationStatements()) {
        moduleNode.addStatement(ds);
      }
    }
 else     if (e instanceof Statement) {
      moduleNode.addStatement((Statement)e);
    }
 else     if (e instanceof MethodNode) {
      moduleNode.addMethod((MethodNode)e);
    }
  }
  for (  ClassNode cl : this.classNodeList) {
    moduleNode.addClass(cl);
  }
  if (this.isPackageInfoDeclaration()) {
    this.addPackageInfoClassNode();
  }
 else {
    if (this.isBlankScript()) {
      this.addEmptyReturnStatement();
    }
  }
  this.configureScriptClassNode();
  if (null != this.numberFormatError) {
    throw createParsingFailedException(this.numberFormatError.getSecond().getMessage(),this.numberFormatError.getFirst());
  }
  moduleNode.setLineNumber(1);
  moduleNode.setColumnNumber(1);
  moduleNode.setEnd(locationSupport.getEnd());
  moduleNode.setLastLineNumber(locationSupport.getEndLine());
  moduleNode.setLastColumnNumber(locationSupport.getEndColumn());
  BlockStatement blockStatement=moduleNode.getStatementBlock();
  if (!blockStatement.isEmpty() || !moduleNode.getMethods().isEmpty()) {
    ASTNode alpha=findAlpha(blockStatement,moduleNode.getMethods());
    ASTNode omega=findOmega(blockStatement,moduleNode.getMethods());
    if (!blockStatement.isEmpty()) {
      blockStatement.setStart(alpha.getStart());
      blockStatement.setLineNumber(alpha.getLineNumber());
      blockStatement.setColumnNumber(alpha.getColumnNumber());
      blockStatement.setEnd(omega.getEnd());
      blockStatement.setLastLineNumber(omega.getLastLineNumber());
      blockStatement.setLastColumnNumber(omega.getLastColumnNumber());
    }
    if (!moduleNode.getClasses().isEmpty()) {
      ClassNode scriptClass=moduleNode.getClasses().get(0);
      scriptClass.setStart(alpha.getStart());
      scriptClass.setLineNumber(alpha.getLineNumber());
      scriptClass.setColumnNumber(alpha.getColumnNumber());
      scriptClass.setEnd(omega.getEnd());
      scriptClass.setLastLineNumber(omega.getLastLineNumber());
      scriptClass.setLastColumnNumber(omega.getLastColumnNumber());
      MethodNode runMethod=scriptClass.getDeclaredMethod("String_Node_Str",Parameter.EMPTY_ARRAY);
      runMethod.setStart(alpha.getStart());
      runMethod.setLineNumber(alpha.getLineNumber());
      runMethod.setColumnNumber(alpha.getColumnNumber());
      runMethod.setEnd(omega.getEnd());
      runMethod.setLastLineNumber(omega.getLastLineNumber());
      runMethod.setLastColumnNumber(omega.getLastColumnNumber());
    }
  }
  moduleNode.putNodeMetaData(LocationSupport.class,locationSupport);
  sourceUnit.setComments(lexer.getComments());
  return moduleNode;
}