nus-yam/ex-repair huggingface dataset:
Program: 135897
Project: 135897
Buggy source:
public static Vector ExpandMacroCall(AST.MacroCall call,Vector macros) throws ParseAlgorithmException {
  AST.Macro macroDef=null;
  int i=0;
  while (i < macros.size()) {
    AST.Macro md=(AST.Macro)macros.elementAt(i);
    if (md.name.equals(call.name)) {
      macroDef=md;
    }
    ;
    i=i + 1;
  }
  ;
  if (macroDef == null) {
    throw new ParseAlgorithmException("String_Node_Str" + call.name + "String_Node_Str"+ call.location());
  }
  ;
  int numOfArgs=call.args.size();
  if (macroDef.params.size() != numOfArgs) {
    throw new ParseAlgorithmException("String_Node_Str" + call.name + "String_Node_Str"+ "String_Node_Str"+ call.location());
  }
  ;
  Vector result=SubstituteInStmtSeq(macroDef.body,call.args,macroDef.params,call.line,call.col);
  if (result.size() > 0) {
    AST first=(AST)result.elementAt(0);
    first.lbl=call.lbl;
    first.lblLocation=call.lblLocation;
  }
  ;
  return result;
}

Fixed version (ground truth):
public static Vector ExpandMacroCall(AST.MacroCall call,Vector macros) throws ParseAlgorithmException {
  AST.Macro macroDef=null;
  int i=0;
  while (i < macros.size()) {
    AST.Macro md=(AST.Macro)macros.elementAt(i);
    if (md.name.equals(call.name)) {
      macroDef=md;
    }
    ;
    i=i + 1;
  }
  ;
  if (macroDef == null) {
    throw new ParseAlgorithmException("String_Node_Str" + call.name + "String_Node_Str"+ call.location());
  }
  ;
  int numOfArgs=call.args.size();
  if (macroDef.params.size() != numOfArgs) {
    throw new ParseAlgorithmException("String_Node_Str" + call.name + "String_Node_Str"+ "String_Node_Str"+ call.location());
  }
  ;
  Vector result=SubstituteInStmtSeq(macroDef.body,call.args,macroDef.params,call.line,call.col);
  if (result.size() > 0) {
    AST first=(AST)result.elementAt(0);
    first.lbl=call.lbl;
    first.lblLocation=call.lblLocation;
    Region callOrigin=call.getOrigin();
    if (callOrigin != null) {
      first.macroOriginBegin=callOrigin.getBegin();
      AST last=(AST)result.elementAt(result.size() - 1);
      last.macroOriginEnd=callOrigin.getEnd();
    }
  }
  ;
  return result;
}
Program: 135900
Project: 135900
Buggy source:
private void ExtractProcedure(AST.Procedure ast,String context){
  if (!InsertProc(ast))   errorReport=errorReport + "String_Node_Str" + ast.name+ "String_Node_Str"+ ast.col+ "String_Node_Str"+ ast.line;
  boolean b=InsertSym(PROCEDURE,ast.name,context,"String_Node_Str",ast.line,ast.col);
  for (int i=0; i < ast.decls.size(); i++)   ExtractPVarDecl((AST.PVarDecl)ast.decls.elementAt(i),ast.name);
  for (int i=0; i < ast.params.size(); i++)   ExtractParamDecl((AST.PVarDecl)ast.params.elementAt(i),ast.name);
  for (int i=0; i < ast.body.size(); i++)   ExtractLabeledStmt((AST.LabeledStmt)ast.body.elementAt(i),ast.name,"String_Node_Str");
}

Fixed version (ground truth):
private void ExtractProcedure(AST.Procedure ast,String context){
  if (!InsertProc(ast))   errorReport=errorReport + "String_Node_Str" + ast.name+ "String_Node_Str"+ ast.line+ "String_Node_Str"+ ast.col;
  boolean b=InsertSym(PROCEDURE,ast.name,context,"String_Node_Str",ast.line,ast.col);
  for (int i=0; i < ast.decls.size(); i++)   ExtractPVarDecl((AST.PVarDecl)ast.decls.elementAt(i),ast.name);
  for (int i=0; i < ast.params.size(); i++)   ExtractParamDecl((AST.PVarDecl)ast.params.elementAt(i),ast.name);
  for (int i=0; i < ast.body.size(); i++)   ExtractLabeledStmt((AST.LabeledStmt)ast.body.elementAt(i),ast.name,"String_Node_Str");
}
Program: 135901
Project: 135901
Buggy source:
private void ExtractProcess(AST.Process ast,String context){
  boolean b;
  if (!InsertProcess(ast))   errorReport=errorReport + "String_Node_Str" + ast.name+ "String_Node_Str"+ ast.col+ "String_Node_Str"+ ast.line;
  b=InsertSym(PROCESS,ast.name,context,"String_Node_Str",ast.line,ast.col);
  for (int i=0; i < ast.decls.size(); i++)   ExtractVarDecl((AST.VarDecl)ast.decls.elementAt(i),ast.name);
  for (int i=0; i < ast.body.size(); i++)   ExtractLabeledStmt((AST.LabeledStmt)ast.body.elementAt(i),ast.name,"String_Node_Str");
}

Fixed version (ground truth):
private void ExtractProcess(AST.Process ast,String context){
  boolean b;
  if (!InsertProcess(ast))   errorReport=errorReport + "String_Node_Str" + ast.name+ "String_Node_Str"+ ast.line+ "String_Node_Str"+ ast.col;
  b=InsertSym(PROCESS,ast.name,context,"String_Node_Str",ast.line,ast.col);
  for (int i=0; i < ast.decls.size(); i++)   ExtractVarDecl((AST.VarDecl)ast.decls.elementAt(i),ast.name);
  for (int i=0; i < ast.body.size(); i++)   ExtractLabeledStmt((AST.LabeledStmt)ast.body.elementAt(i),ast.name,"String_Node_Str");
}
Program: 135902
Project: 135902
Buggy source:
protected Assignment doEditFormula(Assignment formula){
  Assert.isNotNull(formula);
  AssignmentWizard wizard=new AssignmentWizard(getSection().getText(),getSection().getDescription(),(Assignment)formula,AssignmentWizard.SHOW_OPTION,AssignmentWizardPage.CONSTANT_WIZARD_ID,AssignmentWizardPage.CONSTANT_TYPING_WIZARD_ID);
  WizardDialog dialog=new WizardDialog(getTableViewer().getTable().getShell(),wizard);
  dialog.setHelpAvailable(true);
  if (Window.OK == dialog.open()) {
    return wizard.getFormula();
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
protected Assignment doEditFormula(Assignment formula){
  Assert.isNotNull(formula);
  AssignmentWizard wizard=new AssignmentWizard(getSection().getText(),getSection().getDescription(),(Assignment)formula,AssignmentWizard.SHOW_OPTION,AssignmentWizardPage.CONSTANT_WIZARD_ID,AssignmentWizardPage.CONSTANT_TYPING_WIZARD_ID);
  WizardDialog dialog=new WizardDialog(getTableViewer().getTable().getShell(),wizard);
  wizard.setWizardDialog(dialog);
  dialog.setHelpAvailable(true);
  if (Window.OK == dialog.open()) {
    return wizard.getFormula();
  }
 else {
    return null;
  }
}
Program: 135904
Project: 135904
Buggy source:
public void dispose(){
  String rightSide=FormHelper.trimTrailingSpaces(source.getDocument().get());
  if (optionModelValue != null && optionSetModelValues != null) {
    this.getAssignment().setModelValue(optionModelValue.getSelection() || optionSetModelValues.getSelection());
    if (optionModelValue.getSelection()) {
      this.getAssignment().setRight(this.getAssignment().getLabel());
    }
 else     if (optionSetModelValues.getSelection()) {
      TypedSet set=TypedSet.parseSet(rightSide);
      this.getAssignment().setSymmetric(flagSymmetricalSet.getSelection());
      this.getAssignment().setRight(set.toString());
    }
 else {
      this.getAssignment().setRight(rightSide);
    }
  }
 else   if (optionModelValue != null) {
    this.getAssignment().setModelValue(optionModelValue.getSelection());
    if (optionModelValue.getSelection()) {
      this.getAssignment().setRight(this.getAssignment().getLabel());
    }
 else {
      this.getAssignment().setRight(rightSide);
    }
  }
 else {
    this.getAssignment().setRight(rightSide);
  }
  if (paramComposite.hasParameters()) {
    this.getAssignment().setParams(paramComposite.getValues());
  }
  super.dispose();
}

Fixed version (ground truth):
public void dispose(){
  final AssignmentWizard wizard=(AssignmentWizard)getWizard();
  if (wizard.getWizardDialogReturnCode() == org.eclipse.jface.window.Window.CANCEL) {
    super.dispose();
    return;
  }
  String rightSide=FormHelper.trimTrailingSpaces(source.getDocument().get());
  if (optionModelValue != null && optionSetModelValues != null) {
    this.getAssignment().setModelValue(optionModelValue.getSelection() || optionSetModelValues.getSelection());
    if (optionModelValue.getSelection()) {
      this.getAssignment().setRight(this.getAssignment().getLabel());
    }
 else     if (optionSetModelValues.getSelection()) {
      TypedSet set=TypedSet.parseSet(rightSide);
      this.getAssignment().setSymmetric(flagSymmetricalSet.getSelection());
      this.getAssignment().setRight(set.toString());
    }
 else {
      this.getAssignment().setRight(rightSide);
    }
  }
 else   if (optionModelValue != null) {
    this.getAssignment().setModelValue(optionModelValue.getSelection());
    if (optionModelValue.getSelection()) {
      this.getAssignment().setRight(this.getAssignment().getLabel());
    }
 else {
      this.getAssignment().setRight(rightSide);
    }
  }
 else {
    this.getAssignment().setRight(rightSide);
  }
  if (paramComposite.hasParameters()) {
    this.getAssignment().setParams(paramComposite.getValues());
  }
  super.dispose();
}
Program: 135907
Project: 135907
Buggy source:
private static String getInstallationBasePath(){
  ClassLoader cl=ClassLoader.getSystemClassLoader();
  final URL url=cl.getResource("String_Node_Str");
  final String path=url.toString();
  try {
    if (!path.startsWith("String_Node_Str")) {
      final URI uri=new URI(path);
      return new File(uri).getAbsolutePath();
    }
  }
 catch (  URISyntaxException e) {
    System.err.println(path);
    e.printStackTrace();
  }
catch (  IllegalArgumentException e) {
    System.err.println(path);
    e.printStackTrace();
  }
  return path;
}

Fixed version (ground truth):
private static String getInstallationBasePath(){
  final URL url=cl.getResource("String_Node_Str");
  final String path=url.toString();
  try {
    if (!isInJar(path)) {
      final URI uri=new URI(path);
      return new File(uri).getAbsolutePath();
    }
  }
 catch (  URISyntaxException e) {
    System.err.println(path);
    e.printStackTrace();
  }
catch (  IllegalArgumentException e) {
    System.err.println(path);
    e.printStackTrace();
  }
  return path;
}
Program: 135910
Project: 135910
Buggy source:
/** 
 * Prints to standard error the string (v1 + "  " + v2), and returns the value v2.
 */
public static Value Print(Value v1,Value v2){
  ToolIO.out.println(Value.ppr(v1.toString()) + "String_Node_Str" + Value.ppr(v2.toString()));
  return v2;
}

Fixed version (ground truth):
/** 
 * Prints to standard error the string (v1 + "  " + v2), and returns the value v2.   Modified on 22 June 2011 by LL to call deepNormalize() on the values before printing.  This fixes the same bug that caused PrintT({"a", "a"}) to print {"a", "a"} instead of {"a"}.  For safety, the values are copied before normalizing, thought that's probably not necessary.
 */
public static Value Print(Value v1,Value v2){
  Value v1c=v1.deepCopy();
  Value v2c=v2.deepCopy();
  v1c.deepNormalize();
  v2c.deepNormalize();
  ToolIO.out.println(Value.ppr(v1c.toString()) + "String_Node_Str" + Value.ppr(v2c.toString()));
  return v2;
}
Program: 135911
Project: 135911
Buggy source:
/** 
 * Prints to standard error the string v1. Always returns TRUE.
 */
public static Value PrintT(Value v1){
  ToolIO.out.println(Value.ppr(v1.toString()));
  return ValTrue;
}

Fixed version (ground truth):
/** 
 * Prints to standard error the string v1. Always returns TRUE. Modified on 22 June 2011 by LL.  See comment on the Print method
 */
public static Value PrintT(Value v1){
  Value v1c=v1.deepCopy();
  v1c.deepNormalize();
  ToolIO.out.println(Value.ppr(v1c.toString()));
  return ValTrue;
}
Program: 135912
Project: 135912
Buggy source:
/** 
 * Factory method Creates a new specification, the underlying IProject link the root file
 * @param name the name of the specification
 * @param rootFilename the path to the root file name
 * @param importExisting
 */
public static Spec createNewSpec(String name,String rootFilename,boolean importExisting){
  IProject project=ResourceHelper.getProject(name,rootFilename,true,importExisting);
  PreferenceStoreHelper.storeRootFilename(project,rootFilename);
  Spec spec=new Spec(project);
  spec.setLastModified();
  return spec;
}

Fixed version (ground truth):
/** 
 * Factory method Creates a new specification, the underlying IProject link the root file
 * @param name the name of the specification
 * @param rootFilename the path to the root file name 
 * @param importExisting Note: when importing an existing spec, the contents of the .toolbox directory needs to be fixed because it contains absolute path names, which may be incorrect if the spec was moved from someplace else.  Here are the files that seem to need changing: .toolbox/.project : <location> entries .toolbox/.setting/... .prefs  : ProjectRootFile entry. Experiment shows that the rootFilename argument contains the complete path name, from which one could extract the path names of those files and then rewrite them as needed.
 */
public static Spec createNewSpec(String name,String rootFilename,boolean importExisting){
  IProject project=ResourceHelper.getProject(name,rootFilename,true,importExisting);
  PreferenceStoreHelper.storeRootFilename(project,rootFilename);
  Spec spec=new Spec(project);
  spec.setLastModified();
  return spec;
}
Program: 135913
Project: 135913
Buggy source:
/** 
 * This boolean equals while inside a call to GetMacro.  It is used to   flag an error if a label appears within a macro.                     
 * @throws ParseAlgorithmException 
 */
public static String GetLabel() throws ParseAlgorithmException {
  String nextLabel="String_Node_Str";
  if (IsLabelNext()) {
    nextLabel=GetAlgToken();
    if (inGetMacro) {
      ParsingError("String_Node_Str");
    }
    ;
    if (nextLabel.equals("String_Node_Str")) {
      ParsingError("String_Node_Str");
    }
    ;
    if (nextLabel.equals("String_Node_Str")) {
      ParsingError("String_Node_Str");
    }
    ;
    GobbleThis("String_Node_Str");
    hasLabel=true;
    allLabels.put(nextLabel,"String_Node_Str");
    if (PeekAtAlgToken(1).equals("String_Node_Str")) {
      GobbleThis("String_Node_Str");
      plusLabels.addElement(nextLabel);
    }
 else {
      if (PeekAtAlgToken(1).equals("String_Node_Str")) {
        GobbleThis("String_Node_Str");
        minusLabels.addElement(nextLabel);
      }
    }
  }
  ;
  return nextLabel;
}

Fixed version (ground truth):
/** 
 * This boolean equals while inside a call to GetMacro.  It is used to   flag an error if a label appears within a macro.                     
 * @throws ParseAlgorithmException 
 */
public static String GetLabel() throws ParseAlgorithmException {
  String nextLabel="String_Node_Str";
  if (IsLabelNext()) {
    nextLabel=GetAlgToken();
    if (inGetMacro) {
      ParsingError("String_Node_Str");
    }
    ;
    if (nextLabel.equals("String_Node_Str")) {
      ParsingError("String_Node_Str");
    }
    ;
    if (nextLabel.equals("String_Node_Str")) {
      ParsingError("String_Node_Str");
    }
    ;
    GobbleThis("String_Node_Str");
    hasLabel=true;
    allLabels.put(nextLabel,"String_Node_Str");
    if (PeekAtAlgToken(1).equals("String_Node_Str")) {
      GobbleThis("String_Node_Str");
      plusLabels.addElement(nextLabel);
      omitPC=false;
    }
 else {
      if (PeekAtAlgToken(1).equals("String_Node_Str")) {
        GobbleThis("String_Node_Str");
        minusLabels.addElement(nextLabel);
        omitPC=false;
      }
    }
  }
  ;
  return nextLabel;
}
Program: 135915
Project: 135915
Buggy source:
private static int CommandLineError(String msg){
  ToolIO.out.println("String_Node_Str" + msg + "String_Node_Str");
  ToolIO.out.println("String_Node_Str");
  return STATUS_EXIT_WITH_ERRORS;
}

Fixed version (ground truth):
private static int CommandLineError(String msg){
  PcalDebug.reportError("String_Node_Str" + msg + "String_Node_Str");
  return STATUS_EXIT_WITH_ERRORS;
}
Program: 135916
Project: 135916
Buggy source:
/** 
 */
private void GenLabeledStmt(AST.LabeledStmt ast,String context) throws PcalTLAGenException {
  StringBuffer sb=new StringBuffer(ast.label);
  Changed c=new Changed(vars);
  if (mp && (context.equals("String_Node_Str") || self.equals("String_Node_Str")))   sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  int col=sb.length();
  if (ast.stmts.size() > 1)   sb.append("String_Node_Str");
  for (int i=0; i < ast.stmts.size(); i++) {
    GenStmt((AST)ast.stmts.elementAt(i),c,context,sb.toString(),sb.length());
    sb=new StringBuffer(NSpaces(col));
    sb.append("String_Node_Str");
  }
  Vector unc=c.Unchanged(wrapColumn - col - "String_Node_Str".length());
  if (c.NumUnchanged() > 1) {
    sb=new StringBuffer(NSpaces(col));
    sb.append("String_Node_Str");
    int here=sb.length();
    sb.append((String)unc.elementAt(0));
    for (int i=1; i < unc.size(); i++) {
      tlacode.addElement(sb.toString());
      sb=new StringBuffer(NSpaces(here));
      sb.append((String)unc.elementAt(i));
    }
    sb.append("String_Node_Str");
    tlacode.addElement(sb.toString());
  }
 else   if (c.NumUnchanged() == 1)   tlacode.addElement(NSpaces(col) + "String_Node_Str" + c.Unchanged());
  tlacode.addElement("String_Node_Str");
}

Fixed version (ground truth):
/** 
 */
private void GenLabeledStmt(AST.LabeledStmt ast,String context) throws PcalTLAGenException {
  StringBuffer sb=new StringBuffer(ast.label);
  Changed c=new Changed(vars);
  if (mp && (context.equals("String_Node_Str") || selfIsSelf)) {
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  int col=sb.length();
  kludgeToFixPCHandlingBug=col;
  if (ast.stmts.size() > 1) {
    sb.append("String_Node_Str");
    kludgeToFixPCHandlingBug=kludgeToFixPCHandlingBug + 3;
  }
  for (int i=0; i < ast.stmts.size(); i++) {
    GenStmt((AST)ast.stmts.elementAt(i),c,context,sb.toString(),sb.length());
    sb=new StringBuffer(NSpaces(col));
    sb.append("String_Node_Str");
  }
  Vector unc=c.Unchanged(wrapColumn - col - "String_Node_Str".length());
  if (c.NumUnchanged() > 1) {
    sb=new StringBuffer(NSpaces(col));
    sb.append("String_Node_Str");
    int here=sb.length();
    sb.append((String)unc.elementAt(0));
    for (int i=1; i < unc.size(); i++) {
      tlacode.addElement(sb.toString());
      sb=new StringBuffer(NSpaces(here));
      sb.append((String)unc.elementAt(i));
    }
    sb.append("String_Node_Str");
    tlacode.addElement(sb.toString());
  }
 else   if (c.NumUnchanged() == 1)   tlacode.addElement(NSpaces(col) + "String_Node_Str" + c.Unchanged());
  tlacode.addElement("String_Node_Str");
}
Program: 135918
Project: 135918
Buggy source:
/** 
 */
private String Self(String context){
  String s=null;
  if (mp) {
    if (context.equals("String_Node_Str"))     s="String_Node_Str";
 else     s=self;
  }
  return s;
}

Fixed version (ground truth):
/** 
 */
private TLAExpr Self(String context){
  TLAExpr s=null;
  if (mp) {
    if (context.equals("String_Node_Str"))     s=selfAsExpr();
 else     s=self;
  }
  return s;
}
Program: 135920
Project: 135920
Buggy source:
/** 
 */
private static TLAExpr SubExpr(String sub){
  TLAExpr expr=new TLAExpr();
  if (sub != null) {
    expr.addLine();
    expr.addToken(new TLAToken("String_Node_Str",0,TLAToken.BUILTIN));
    expr.addTokenOffset(new TLAToken(sub,0,TLAToken.IDENT),0);
    expr.addTokenOffset(new TLAToken("String_Node_Str",0,TLAToken.BUILTIN),0);
    MakeExprPretty(expr);
    expr.normalize();
    return expr;
  }
 else   return null;
}

Fixed version (ground truth):
/** 
 * Given an expression, makes it into a subscript expr.  It is called    only with argument Self(context), which means that it is called       only for a single subscript.                                          * If string is null, then returns null.                                
 */
private static TLAExpr SubExpr(TLAExpr sub){
  if (sub != null) {
    TLAExpr expr=sub.cloneAndNormalize();
    for (int i=0; i < expr.tokens.size(); i++) {
      Vector tokenVec=(Vector)expr.tokens.elementAt(i);
      for (int j=0; j < tokenVec.size(); j++) {
        TLAToken tok=(TLAToken)tokenVec.elementAt(j);
        tok.column=tok.column + 1;
      }
      if (i == 0) {
        tokenVec.insertElementAt(new TLAToken("String_Node_Str",0,TLAToken.BUILTIN),0);
      }
    }
    expr.addTokenOffset(new TLAToken("String_Node_Str",0,TLAToken.BUILTIN),0);
    return expr;
  }
 else {
    return null;
  }
}
Program: 135922
Project: 135922
Buggy source:
private void GenProcedure(AST.Procedure ast,String context) throws PcalTLAGenException {
  StringBuffer ns=new StringBuffer();
  Vector nsV=new Vector();
  int nsC=ast.name.length() + ((mp) ? "String_Node_Str".length() : 0) + "String_Node_Str".length();
  if (mp) {
    self="String_Node_Str";
    nextStepSelf.addElement(ast.name + "String_Node_Str");
  }
 else {
    nextStep.addElement(ast.name);
  }
  for (int i=0; i < ast.body.size(); i++) {
    AST.LabeledStmt stmt=(AST.LabeledStmt)ast.body.elementAt(i);
    if ((ns.length() + stmt.label.length() + "String_Node_Str".length()+ ((mp) ? "String_Node_Str".length() : 0)) > wrapColumn - nsC - "String_Node_Str".length()) {
      nsV.addElement(ns.toString());
      ns=new StringBuffer();
    }
    if (ns.length() > 0)     ns.append("String_Node_Str");
    ns.append(stmt.label);
    if (mp)     ns.append("String_Node_Str");
    GenLabeledStmt(stmt,"String_Node_Str");
  }
  nsV.addElement(ns.toString());
  ns=new StringBuffer();
  ns.append(ast.name);
  if (mp)   ns.append("String_Node_Str");
  ns.append("String_Node_Str");
  ns.append((String)nsV.elementAt(0));
  tlacode.addElement(ns.toString());
  for (int i=1; i < nsV.size(); i++) {
    ns=new StringBuffer(NSpaces(nsC + 2));
    ns.append("String_Node_Str");
    ns.append((String)nsV.elementAt(i));
    tlacode.addElement(ns.toString());
  }
  tlacode.addElement("String_Node_Str");
}

Fixed version (ground truth):
private void GenProcedure(AST.Procedure ast,String context) throws PcalTLAGenException {
  StringBuffer ns=new StringBuffer();
  Vector nsV=new Vector();
  int nsC=ast.name.length() + ((mp) ? "String_Node_Str".length() : 0) + "String_Node_Str".length();
  if (mp) {
    self=selfAsExpr();
    selfIsSelf=true;
    nextStepSelf.addElement(ast.name + "String_Node_Str");
  }
 else {
    nextStep.addElement(ast.name);
  }
  for (int i=0; i < ast.body.size(); i++) {
    AST.LabeledStmt stmt=(AST.LabeledStmt)ast.body.elementAt(i);
    if ((ns.length() + stmt.label.length() + "String_Node_Str".length()+ ((mp) ? "String_Node_Str".length() : 0)) > wrapColumn - nsC - "String_Node_Str".length()) {
      nsV.addElement(ns.toString());
      ns=new StringBuffer();
    }
    if (ns.length() > 0)     ns.append("String_Node_Str");
    ns.append(stmt.label);
    if (mp)     ns.append("String_Node_Str");
    GenLabeledStmt(stmt,"String_Node_Str");
  }
  nsV.addElement(ns.toString());
  ns=new StringBuffer();
  ns.append(ast.name);
  if (mp)   ns.append("String_Node_Str");
  ns.append("String_Node_Str");
  ns.append((String)nsV.elementAt(0));
  tlacode.addElement(ns.toString());
  for (int i=1; i < nsV.size(); i++) {
    ns=new StringBuffer(NSpaces(nsC + 2));
    ns.append("String_Node_Str");
    ns.append((String)nsV.elementAt(i));
    tlacode.addElement(ns.toString());
  }
  tlacode.addElement("String_Node_Str");
}
Program: 135930
Project: 135930
Buggy source:
/** 
 * Returns the token containing the current selection, or null if there is none.  A token here means a TLA+ token except that a name like Foo!bar!x is considered to be a single token.  It returns null if the file is not parsed or the editor is dirty (so there is no useful information in the parse tree) or if there is no token contained within the indicated region.
 * @return
 */
public static StringAndLocation getCurrentToken(){
  Location location=getCurrentLocation();
  if (location == null) {
    return null;
  }
  return getTokenAtLocation(location);
}

Fixed version (ground truth):
/** 
 * Returns the token containing the current selection, or null if there is none.  A token here means a TLA+ token except that a name like Foo!bar!x is considered to be a single token.  It returns null if the file is not parsed or the editor is dirty (so there is no useful information in the parse tree) or if there is no token contained within the indicated region. THIS METHOD DOES NOT SEEM TO BE USED.
 * @return
 */
public static StringAndLocation getCurrentToken(){
  Location location=getCurrentLocation();
  if (location == null) {
    return null;
  }
  return getTokenAtLocation(location);
}
Program: 135931
Project: 135931
Buggy source:
/** 
 * The inner recursive method used by get UsesOfSymbol.  It appends all the appropriate OpApplNodes  to <code>found</code>.
 * @param symbol
 * @param node
 * @param found
 * @return
 */
private static void innerGetUsesOfSymbol(SymbolNode symbol,SemanticNode node,Vector found){
  if ((node instanceof OpApplNode) && (((OpApplNode)node).getOperator() == symbol)) {
    found.add(node);
  }
  SemanticNode[] children=node.getChildren();
  if (children == null) {
    return;
  }
  for (int i=0; i < children.length; i++) {
    if (node.getLocation().source().equals(children[i].getLocation().source())) {
      innerGetUsesOfSymbol(symbol,children[i],found);
    }
  }
  return;
}

Fixed version (ground truth):
/** 
 * The inner recursive method used by get UsesOfSymbol.  It appends all the appropriate OpApplNodes  to <code>found</code>. Note: modified by LL on 14 Sep 2010 so a subexpression name like  Foo!1!(a) will be returned as a use of Foo.  This is introduces another case to be handled when trying to extract the symbol's occurrence from the  OpApplNode containing the symbol.  This is the one case in which the symbol is not really the operator of the OpApplNode.
 * @param symbol
 * @param node
 * @param found
 * @return
 */
private static void innerGetUsesOfSymbol(SymbolNode symbol,SemanticNode node,Vector found){
  if ((node instanceof OpApplNode) && ((((OpApplNode)node).getOperator() == symbol) || ((OpApplNode)node).subExpressionOf == symbol)) {
    found.add(node);
  }
  SemanticNode[] children=node.getChildren();
  if (children == null) {
    return;
  }
  for (int i=0; i < children.length; i++) {
    if (node.getLocation().source().equals(children[i].getLocation().source())) {
      innerGetUsesOfSymbol(symbol,children[i],found);
    }
  }
  return;
}
Program: 135934
Project: 135934
Buggy source:
/** 
 * Returns the content for the end of the module
 * @return
 */
public static StringBuffer getModuleClosingTag(){
  StringBuffer buffer=new StringBuffer();
  buffer.append(StringHelper.copyString("String_Node_Str",Activator.getDefault().getPreferenceStore().getInt(EditorPreferencePage.EDITOR_RIGHT_MARGIN))).append(modificationHistory).append(StringHelper.newline).append("String_Node_Str").append(new Date()).append("String_Node_Str").append(System.getProperty("String_Node_Str")).append(StringHelper.newline);
  return buffer;
}

Fixed version (ground truth):
/** 
 * Returns the content for the end of the module
 * @return
 */
public static StringBuffer getModuleClosingTag(){
  StringBuffer buffer=new StringBuffer();
  buffer.append(StringHelper.copyString("String_Node_Str",Activator.getDefault().getPreferenceStore().getInt(EditorPreferencePage.EDITOR_RIGHT_MARGIN))).append("String_Node_Str" + modificationHistory).append(StringHelper.newline).append("String_Node_Str").append(new Date()).append("String_Node_Str").append(System.getProperty("String_Node_Str")).append(StringHelper.newline);
  return buffer;
}
Program: 135938
Project: 135938
Buggy source:
/** 
 * Creates a new   {@link WarningMessage} from the {@link Set}of   {@link Entry} where the key of each {@link Entry} is the fieldname and the value is the field value string as output by the TLAPM. This method expects the only field to have the name "msg".
 * @param fieldPairs
 * @param moduleName
 * @return
 */
public static WarningMessage getWarningMessage(Set fieldPairs,String moduleName){
  WarningMessage message=new WarningMessage();
  for (Iterator it=fieldPairs.iterator(); it.hasNext(); ) {
    Map.Entry nextEntry=(Map.Entry)it.next();
    String fieldName=(String)nextEntry.getKey();
    String fieldValue=(String)nextEntry.getValue();
    if (fieldName != null && fieldValue != null) {
      if (fieldName.equals(LOC_FIELD)) {
        message.message=fieldValue;
      }
 else {
        ProverUIActivator.logDebug("String_Node_Str" + fieldName + "String_Node_Str");
      }
    }
  }
  return message;
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link WarningMessage} from the {@link Set}of   {@link Entry} where the key of each {@link Entry} is the fieldname and the value is the field value string as output by the TLAPM. This method expects the only field to have the name "msg".
 * @param fieldPairs
 * @param moduleName
 * @return
 */
public static WarningMessage getWarningMessage(Set fieldPairs,String moduleName){
  WarningMessage message=new WarningMessage();
  for (Iterator it=fieldPairs.iterator(); it.hasNext(); ) {
    Map.Entry nextEntry=(Map.Entry)it.next();
    String fieldName=(String)nextEntry.getKey();
    String fieldValue=(String)nextEntry.getValue();
    if (fieldName != null && fieldValue != null) {
      if (fieldName.equals(MSG_FIELD)) {
        message.message=fieldValue;
      }
 else {
        ProverUIActivator.logDebug("String_Node_Str" + fieldName + "String_Node_Str");
      }
    }
  }
  return message;
}
Program: 135939
Project: 135939
Buggy source:
public void run(IProgressMonitor monitor) throws CoreException {
  Position curPosition=EditorUtil.getMarkerPosition(sanyMarker);
  int newCharStart;
  int newCharEnd;
  if (curPosition != null) {
    newCharStart=curPosition.getOffset();
    newCharEnd=curPosition.getOffset() + curPosition.getLength();
  }
 else {
    newCharStart=sanyMarker.getAttribute(IMarker.CHAR_START,0);
    newCharEnd=sanyMarker.getAttribute(IMarker.CHAR_END,0);
  }
  IMarker[] existingMarkers=module.findMarkers(ProverHelper.STEP_STATUS_MARKER,true,IResource.DEPTH_ZERO);
  for (int i=0; i < existingMarkers.length; i++) {
    IMarker existingMarker=existingMarkers[i];
    int existingCharStart=existingMarker.getAttribute(IMarker.CHAR_START,-1);
    int existingCharEnd=existingMarker.getAttribute(IMarker.CHAR_END,-1);
    if (existingCharStart < newCharEnd && existingCharEnd > newCharStart) {
      existingMarker.delete();
    }
  }
  if (markerType != null) {
    Map markerAttributes=new HashMap(2);
    markerAttributes.put(IMarker.CHAR_START,new Integer(newCharStart));
    markerAttributes.put(IMarker.CHAR_END,new Integer(newCharEnd));
    markerAttributes.put(IMarker.LINE_NUMBER,new Integer(stringToLoc(sanyMarker.getAttribute(SANY_LOC_ATR,"String_Node_Str")).beginLine()));
    IMarker newMarker=module.createMarker(markerType);
    newMarker.setAttributes(markerAttributes);
  }
}

Fixed version (ground truth):
public void run(){
  MessageDialog.openWarning(UIHelper.getShellProvider().getShell(),"String_Node_Str",message.getMessage());
}
Program: 135940
Project: 135940
Buggy source:
/** 
 * Processes a warning message from the tlapm. This simply displays a warning to the user.
 * @param message
 */
public static void processWarningMessage(WarningMessage message){
  MessageDialog.openWarning(UIHelper.getShellProvider().getShell(),"String_Node_Str",message.getMessage());
}

Fixed version (ground truth):
/** 
 * Processes a warning message from the tlapm. This simply displays a warning to the user.
 * @param message
 */
public static void processWarningMessage(final WarningMessage message){
  UIHelper.runUIAsync(new Runnable(){
    public void run(){
      MessageDialog.openWarning(UIHelper.getShellProvider().getShell(),"String_Node_Str",message.getMessage());
    }
  }
);
}
Program: 135941
Project: 135941
Buggy source:
/** 
 * Updates the obligation with information from the message. In particular, this updates the state of the obligation and set the pretty printed form of the obligation if that information is in the message. If the state of this obligation changes because of the message, this method updates the status of the parent.
 * @param message
 */
public void updateObligation(ObligationStatusMessage message){
  this.obligationString=message.getObString();
  if (message.getBackend() != null && message.getStatus() != null) {
    proverStatuses.put(message.getBackend(),message.getStatus());
  }
  int oldState=getObligationState();
  int newState=ProverHelper.getIntFromStringStatus(message.getStatus(),oldState,message.getBackend());
  if (oldState != newState) {
    obState=newState;
    parent.updateStatus();
  }
}

Fixed version (ground truth):
/** 
 * Updates the obligation with information from the message. In particular, this updates the state of the obligation and set the pretty printed form of the obligation if that information is in the message. If the state of this obligation changes because of the message, this method updates the status of the parent.
 * @param message
 */
public void updateObligation(ObligationStatusMessage message){
  if (this.obligationString == null || this.obligationString.isEmpty()) {
    this.obligationString=message.getObString();
  }
  if (message.getBackend() != null && message.getStatus() != null) {
    proverStatuses.put(message.getBackend(),message.getStatus());
  }
  int oldState=getObligationState();
  int newState=ProverHelper.getIntFromStringStatus(message.getStatus(),oldState,message.getBackend());
  if (oldState != newState) {
    obState=newState;
    parent.updateStatus();
  }
}
Program: 135943
Project: 135943
Buggy source:
public void setEnabled(Object context){
  setBaseEnabled(setFields());
  resetFields();
}

Fixed version (ground truth):
public void setEnabled(Object context){
  setBaseEnabled(setFields(false));
}
Program: 135944
Project: 135944
Buggy source:
private boolean setFields(){
  TLAEditor editor;
  editor=EditorUtil.getTLAEditorWithFocus();
  if (editor == null) {
    return false;
  }
  doc=editor.getDocumentProvider().getDocument(editor.getEditorInput());
  text=doc.get();
  selectionProvider=editor.getSelectionProvider();
  selection=(TextSelection)selectionProvider.getSelection();
  node=EditorUtil.getCurrentTheoremNode();
  if (node == null) {
    return false;
  }
  ProofNode pf=node.getProof();
  if (pf instanceof NonLeafProofNode) {
    pfNode=(NonLeafProofNode)pf;
  }
 else {
    pfNode=null;
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean setFields(boolean reallySet){
  TLAEditor editor;
  editor=EditorUtil.getTLAEditorWithFocus();
  if (editor == null) {
    return false;
  }
  IDocument doc=editor.getDocumentProvider().getDocument(editor.getEditorInput());
  String text=doc.get();
  ISelectionProvider selectionProvider=editor.getSelectionProvider();
  TextSelection selection=(TextSelection)selectionProvider.getSelection();
  TheoremNode node=EditorUtil.getCurrentTheoremNode();
  if (node == null) {
    return false;
  }
  ProofNode pf=node.getProof();
  if (pf instanceof NonLeafProofNode) {
    pfNode=(NonLeafProofNode)pf;
  }
 else {
    return false;
  }
  if (reallySet) {
    this.doc=doc;
    this.text=text;
    this.selectionProvider=selectionProvider;
    this.selection=selection;
    this.node=node;
  }
  return true;
}
Program: 135946
Project: 135946
Buggy source:
/** 
 * Returns the   {@link IMarker} containing attributes about theobligation. The attributes {@link ProverHelper#OBLIGATION_ID}should always be present. However, for dummy missing and omitted obligations, the id is meaningless.
 * @return
 */
public IMarker getObMarker(){
  return obMarker;
}

Fixed version (ground truth):
/** 
 * Returns the   {@link IMarker} containing attributes about theobligation. The attributes {@link ProverHelper#OBLIGATION_ID}should always be present. This marker will be null for dummy obligations.
 * @return
 */
public IMarker getObMarker(){
  return obMarker;
}
Program: 135947
Project: 135947
Buggy source:
/** 
 * Create an obligation with the parent step, the marker for the obligation, and initial state. The parent step can be null if the parent is to be set later using  {@link #setParent(StepTuple)}. Calls   {@link #setState(long)} on the initialState
 * @param parent the parent step of the obligation. Can be nullif the parent is to be set later using  {@link #setParent(StepTuple)}.
 * @param obMarker the marker for this obligationwhich should already have the attributes {@link ProverHelper#OBLIGATION_ID} set.
 * @param initialState the initial state of the obligation. See{@link ColorPredicate} for an explanation of obligation states.
 * @param location the location of the obligation as reported by tlapm
 * @param id the id of the obligation as given by tlapm
 */
public ObligationStatus(StepTuple parent,IMarker obMarker,int initialState,Location location,int id){
  this.parent=parent;
  this.proverStatuses=new HashMap();
  this.obState=initialState;
  this.id=id;
  this.location=location;
}

Fixed version (ground truth):
/** 
 * Create an obligation with the parent step, the marker for the obligation, and initial state. The parent step can be null if the parent is to be set later using  {@link #setParent(StepTuple)}. Calls   {@link #setState(long)} on the initialState
 * @param parent the parent step of the obligation. Can be nullif the parent is to be set later using  {@link #setParent(StepTuple)}.
 * @param obMarker the marker for this obligationwhich should already have the attributes {@link ProverHelper#OBLIGATION_ID} set. Can be null if thisis a dummy obligation because the marker is never used.
 * @param initialState the initial state of the obligation. See{@link ColorPredicate} for an explanation of obligation states.
 * @param location the location of the obligation as reported by tlapm
 * @param id the id of the obligation as given by tlapm
 */
public ObligationStatus(StepTuple parent,IMarker obMarker,int initialState,Location location,int id){
  this.parent=parent;
  this.proverStatuses=new HashMap();
  this.obState=initialState;
  this.id=id;
  this.location=location;
  this.obMarker=obMarker;
}
Program: 135951
Project: 135951
Buggy source:
/** 
 * Returns the   {@link Collection} of {@link ObligationStatus}s from the most recent run of the prover. Returns null if the prover has not yet been launched during this instance of the toolbox.
 * @return
 */
public static ObligationStatus[] getObligationStatuses(){
  if (ProverJob.getLastJob() == null) {
    return null;
  }
  Collection statuses=ProverJob.getLastJob().getObsMap().values();
  return (ObligationStatus[])statuses.toArray(new ObligationStatus[statuses.size()]);
}

Fixed version (ground truth):
/** 
 * Returns the   {@link Collection} of {@link ObligationStatus}s from the most recent run of the prover if the most recent run of the prover is on the current spec. Returns null if the prover has not yet been launched during this instance of the toolbox or if the most recent run of the prover is not on the current spec.
 * @return
 */
public static ObligationStatus[] getObligationStatuses(){
  if (ProverJob.getLastJob() == null) {
    return null;
  }
  ProverJob lastJob=ProverJob.getLastJob();
  if (ToolboxHandle.getCurrentSpec() == null || !lastJob.getModule().getProject().equals(ToolboxHandle.getCurrentSpec().getProject())) {
    return null;
  }
  Collection statuses=lastJob.getObsMap().values();
  return (ObligationStatus[])statuses.toArray(new ObligationStatus[statuses.size()]);
}
Program: 135952
Project: 135952
Buggy source:
/** 
 * Fills the obligation view with information from the most recent launch of the prover.
 */
private void fillFromCurrentSpec(){
  ObligationStatus[] statuses=ProverHelper.getObligationStatuses();
  if (statuses != null) {
    for (int i=0; i < statuses.length; i++) {
      updateItem(statuses[i]);
    }
  }
}

Fixed version (ground truth):
/** 
 * Fills the obligation view with information from the most recent launch of the prover on the current spec if the most recent launch of the prover was on the current spec. Otherwise, does nothing.
 */
private void fillFromCurrentSpec(){
  ObligationStatus[] statuses=ProverHelper.getObligationStatuses();
  if (statuses != null) {
    for (int i=0; i < statuses.length; i++) {
      updateItem(statuses[i]);
    }
  }
}
Program: 135953
Project: 135953
Buggy source:
/** 
 * Returns the most prover job that led to the most recent successful launch of the prover.
 */
public static ProverJob getLastJob(){
  return lastJob;
}

Fixed version (ground truth):
/** 
 * Returns the most prover job that led to the most recent launch of the prover.
 */
public static ProverJob getLastJob(){
  return lastJob;
}
Program: 135954
Project: 135954
Buggy source:
/** 
 * Removes the item from the view, performing necessary cleanup.
 * @param item
 */
private void removeItem(ExpandItem item){
  fontListener.removeControl(((SourceViewer)viewers.get(item)).getControl());
  Integer id=new Integer(((IMarker)item.getData()).getAttribute(ProverHelper.OBLIGATION_ID,-1));
  items.remove(id);
  item.getControl().dispose();
  item.dispose();
}

Fixed version (ground truth):
/** 
 * Removes the item from the view, performing necessary cleanup.
 * @param item
 */
private void removeItem(InterestingObligationExpandItem item){
  fontListener.removeControl(((SourceViewer)viewers.get(item)).getControl());
  items.remove(new Integer(item.getId()));
  item.getControl().dispose();
  item.dispose();
}
Program: 135956
Project: 135956
Buggy source:
public InterestingObligationExpandItem(ExpandBar parent,int style,int index){
  super(parent,style,index);
}

Fixed version (ground truth):
/** 
 * Creates an expand bar item for the obligation with the given id. The parent style and index are the arguments used for the constructor   {@link ExpandItem#ExpandItem(ExpandBar,int,int)}.
 */
public InterestingObligationExpandItem(ExpandBar parent,int style,int index,int id){
  super(parent,style,index);
  this.id=id;
}
Program: 135957
Project: 135957
Buggy source:
/** 
 * This method must be run from a UI thread. Used to refresh the obligation view if it is currently open. If the view is not currently open, this method does nothing. If the view is currently open, this takes the following two steps: 1.) Removes all items from the expand bar for this view. 2.) Retrieve all obligation statuses by calling   {@link ProverHelper#getObligationStatuses()}. Fills the view with information from these statuses. 3.) If there are no interesting obligations in the view after steps 1 and 2, then the view is hidden.
 */
public static void refreshObligationView(){
  ObligationsView oblView=(ObligationsView)UIHelper.findView(VIEW_ID);
  if (oblView != null) {
    ExpandItem[] expandItems=oblView.bar.getItems();
    for (int i=0; i < expandItems.length; i++) {
      oblView.removeItem(expandItems[i]);
    }
    oblView.fillFromCurrentSpec();
    if (oblView.isEmpty()) {
      UIHelper.getActivePage().hideView(oblView);
    }
  }
}

Fixed version (ground truth):
/** 
 * This method must be run from a UI thread. Used to refresh the obligation view if it is currently open. If the view is not currently open, this method does nothing. If the view is currently open, this takes the following two steps: 1.) Removes all items from the expand bar for this view. 2.) Retrieve all obligation statuses by calling   {@link ProverHelper#getObligationStatuses()}. Fills the view with information from these statuses. 3.) If there are no interesting obligations in the view after steps 1 and 2, then the view is hidden.
 */
public static void refreshObligationView(){
  ObligationsView oblView=(ObligationsView)UIHelper.findView(VIEW_ID);
  if (oblView != null) {
    ExpandItem[] expandItems=oblView.bar.getItems();
    for (int i=0; i < expandItems.length; i++) {
      oblView.removeItem((InterestingObligationExpandItem)expandItems[i]);
    }
    oblView.fillFromCurrentSpec();
    if (oblView.isEmpty()) {
      UIHelper.getActivePage().hideView(oblView);
    }
  }
}
Program: 135958
Project: 135958
Buggy source:
/** 
 * This method makes sure pairs of annotation types corresponding to a given logical color are always bound to the same physical color. See the documentation for this class to read more about this.
 */
public void propertyChange(PropertyChangeEvent event){
  if (event.getProperty().contains(COLOR_PREF_KEY_PREFIX) && event.getProperty().endsWith("String_Node_Str")) {
    int colorNum=getNumFromMainColorPref(event.getProperty());
    PreferenceConverter.setValue(getPreferenceStore(),getPartnerColorPrefName(colorNum),(RGB)event.getNewValue());
  }
  super.propertyChange(event);
}

Fixed version (ground truth):
/** 
 * This method makes sure pairs of annotation types corresponding to a given logical color are always bound to the same physical color. When the color preference is changed for the key which is bound to the color field editors for this page, this method sets the value for the partner key to be the same. See the documentation for this class to read more about this.
 */
public void propertyChange(PropertyChangeEvent event){
  if (event.getProperty().contains(COLOR_PREF_KEY_PREFIX) && event.getProperty().endsWith("String_Node_Str")) {
    int colorNum=getNumFromMainColorPref(event.getProperty());
    IPreferenceStore store=getPreferenceStore();
    String partnerPrefName=getPartnerColorPrefName(colorNum);
    String newValue=getPreferenceStore().getString(event.getProperty());
    if (store.getDefaultString(partnerPrefName).equals(newValue)) {
      store.setToDefault(partnerPrefName);
    }
 else {
      getPreferenceStore().setValue(partnerPrefName,newValue);
    }
  }
  super.propertyChange(event);
}
Program: 135960
Project: 135960
Buggy source:
public void run(IProgressMonitor monitor) throws CoreException {
  IMarker newMarker=module.createMarker(markerType);
  Map markerAttributes=new HashMap(2);
  Position curPosition=EditorUtil.getMarkerPosition(sanyMarker);
  int newCharStart;
  int newCharEnd;
  if (curPosition != null) {
    newCharStart=curPosition.getOffset();
    newCharEnd=curPosition.getOffset() + curPosition.getLength();
  }
 else {
    newCharStart=sanyMarker.getAttribute(IMarker.CHAR_START,0);
    newCharEnd=sanyMarker.getAttribute(IMarker.CHAR_END,0);
  }
  IMarker[] existingMarkers=module.findMarkers(ProverHelper.STEP_STATUS_MARKER,true,IResource.DEPTH_ZERO);
  for (int i=0; i < existingMarkers.length; i++) {
    IMarker existingMarker=existingMarkers[i];
    int existingCharStart=existingMarker.getAttribute(IMarker.CHAR_START,-1);
    int existingCharEnd=existingMarker.getAttribute(IMarker.CHAR_END,-1);
    if (existingCharStart < newCharEnd && existingCharEnd > newCharStart) {
      existingMarker.delete();
    }
  }
  markerAttributes.put(IMarker.CHAR_START,new Integer(newCharStart));
  markerAttributes.put(IMarker.CHAR_END,new Integer(newCharEnd));
  markerAttributes.put(IMarker.LINE_NUMBER,new Integer(stringToLoc(sanyMarker.getAttribute(SANY_LOC_ATR,"String_Node_Str")).beginLine()));
  newMarker.setAttributes(markerAttributes);
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws CoreException {
  Position curPosition=EditorUtil.getMarkerPosition(sanyMarker);
  int newCharStart;
  int newCharEnd;
  if (curPosition != null) {
    newCharStart=curPosition.getOffset();
    newCharEnd=curPosition.getOffset() + curPosition.getLength();
  }
 else {
    newCharStart=sanyMarker.getAttribute(IMarker.CHAR_START,0);
    newCharEnd=sanyMarker.getAttribute(IMarker.CHAR_END,0);
  }
  IMarker[] existingMarkers=module.findMarkers(ProverHelper.STEP_STATUS_MARKER,true,IResource.DEPTH_ZERO);
  for (int i=0; i < existingMarkers.length; i++) {
    IMarker existingMarker=existingMarkers[i];
    int existingCharStart=existingMarker.getAttribute(IMarker.CHAR_START,-1);
    int existingCharEnd=existingMarker.getAttribute(IMarker.CHAR_END,-1);
    if (existingCharStart < newCharEnd && existingCharEnd > newCharStart) {
      existingMarker.delete();
    }
  }
  if (markerType != null) {
    Map markerAttributes=new HashMap(2);
    markerAttributes.put(IMarker.CHAR_START,new Integer(newCharStart));
    markerAttributes.put(IMarker.CHAR_END,new Integer(newCharEnd));
    markerAttributes.put(IMarker.LINE_NUMBER,new Integer(stringToLoc(sanyMarker.getAttribute(SANY_LOC_ATR,"String_Node_Str")).beginLine()));
    IMarker newMarker=module.createMarker(markerType);
    newMarker.setAttributes(markerAttributes);
  }
}