nus-yam/ex-repair huggingface dataset:
Program: 136105
Project: 136105
Buggy source:
protected void reportCoverage(IWorker[] workers){
  if (TLCGlobals.coverageInterval >= 0) {
    ToolIO.out.println("String_Node_Str");
    ObjLongTable counts=this.tool.getPrimedLocs();
    for (int i=0; i < workers.length; i++) {
      ObjLongTable counts1=workers[i].getCounts();
      ObjLongTable.Enumerator keys=counts1.keys();
      Object key;
      while ((key=keys.nextElement()) != null) {
        String loc=((SemanticNode)key).getLocation().toString();
        counts.add(loc,counts1.get(key));
      }
    }
    Object[] skeys=counts.sortStringKeys();
    for (int i=0; i < skeys.length; i++) {
      long val=counts.get(skeys[i]);
      ToolIO.out.println("String_Node_Str" + skeys[i] + "String_Node_Str"+ val);
    }
  }
}

Fixed version (ground truth):
/** 
 * Responsible for printing the coverage information
 * @param workers
 */
protected void reportCoverage(IWorker[] workers){
  if (TLCGlobals.coverageInterval >= 0) {
    ToolIO.out.println("String_Node_Str");
    ObjLongTable counts=this.tool.getPrimedLocs();
    for (int i=0; i < workers.length; i++) {
      ObjLongTable counts1=workers[i].getCounts();
      ObjLongTable.Enumerator keys=counts1.keys();
      Object key;
      while ((key=keys.nextElement()) != null) {
        String loc=((SemanticNode)key).getLocation().toString();
        counts.add(loc,counts1.get(key));
      }
    }
    Object[] skeys=counts.sortStringKeys();
    for (int i=0; i < skeys.length; i++) {
      long val=counts.get(skeys[i]);
      ToolIO.out.println("String_Node_Str" + skeys[i] + "String_Node_Str"+ val);
    }
  }
}
Program: 136106
Project: 136106
Buggy source:
public void printST(int indentLevel){
  String operator="String_Node_Str";
  TreeNode[] heirs=this.heirs();
  if (image != null && image.toString().equals("String_Node_Str")) {
    if (((SyntaxTreeNode)(heirs()[0])).image.toString().equals("String_Node_Str")) {
      operator="String_Node_Str" + ((SyntaxTreeNode)(((SyntaxTreeNode)(heirs()[0])).heirs()[0])).image.toString();
    }
    if (((SyntaxTreeNode)(heirs()[1])).image.toString().equals("String_Node_Str")) {
      operator=((SyntaxTreeNode)(((SyntaxTreeNode)(heirs()[1])).heirs()[0])).image.toString();
    }
    if (((SyntaxTreeNode)(heirs()[0])).image.toString().equals("String_Node_Str")) {
      operator=((SyntaxTreeNode)(((SyntaxTreeNode)(heirs()[0])).heirs()[1])).image.toString();
    }
  }
  for (int i=0; i < indentLevel; i++)   System.out.print(Strings.blanks[2]);
  System.out.print((image == null ? "String_Node_Str" + SyntaxNodeImage[kind].toString() + "String_Node_Str" : image.toString()) + "String_Node_Str" + (operator != "String_Node_Str" ? operator + "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ heirs.length+ "String_Node_Str"+ "String_Node_Str"+ kind+ ((preComment.length != 0) ? ("String_Node_Str" + preComment[0]) : ("String_Node_Str"))+ "String_Node_Str");
  for (int i=0; i < heirs.length; i++) {
    if (heirs[i] != null)     ((SyntaxTreeNode)heirs[i]).printST(indentLevel + 1);
 else {
      for (int j=0; j <= indentLevel; j++) {
        System.out.print(Strings.blanks[2]);
      }
      ;
      System.out.println("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void printST(int indentLevel){
  String operator="String_Node_Str";
  TreeNode[] heirs=this.heirs();
  if (image != null && image.toString().equals("String_Node_Str")) {
    if (((SyntaxTreeNode)(heirs()[0])).image.toString().equals("String_Node_Str")) {
      operator="String_Node_Str" + ((SyntaxTreeNode)(((SyntaxTreeNode)(heirs()[0])).heirs()[0])).image.toString();
    }
    if (((SyntaxTreeNode)(heirs()[1])).image.toString().equals("String_Node_Str")) {
      operator=((SyntaxTreeNode)(((SyntaxTreeNode)(heirs()[1])).heirs()[0])).image.toString();
    }
    if (((SyntaxTreeNode)(heirs()[0])).image.toString().equals("String_Node_Str")) {
      operator=((SyntaxTreeNode)(((SyntaxTreeNode)(heirs()[0])).heirs()[1])).image.toString();
    }
  }
  for (int i=0; i < indentLevel; i++)   System.out.print(Strings.blanks[2]);
  System.out.print((image == null ? "String_Node_Str" + SyntaxNodeImage[kind].toString() + "String_Node_Str" : image.toString()) + "String_Node_Str" + (operator != "String_Node_Str" ? operator + "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ heirs.length+ "String_Node_Str"+ "String_Node_Str"+ kind+ PreCommentToString(preComment)+ "String_Node_Str");
  for (int i=0; i < heirs.length; i++) {
    if (heirs[i] != null)     ((SyntaxTreeNode)heirs[i]).printST(indentLevel + 1);
 else {
      for (int j=0; j <= indentLevel; j++) {
        System.out.print(Strings.blanks[2]);
      }
      ;
      System.out.println("String_Node_Str");
    }
  }
}
Program: 136107
Project: 136107
Buggy source:
public final String[] getAttachedComments(){
  if (this.kind < SyntaxTreeConstants.NULL_ID) {
    return preComment;
  }
  ;
  if (this.heirs().length == 0) {
    String[] res=new String[1];
    res[0]="String_Node_Str";
    return res;
  }
  ;
  return ((SyntaxTreeNode)this.heirs()[0]).getAttachedComments();
}

Fixed version (ground truth):
/** 
 * For a token node, returns its pre-comments.  Otherwise, it returns    the pre-comments attached to the first token-node descendant of       this node.                                                           
 */
public final String[] getAttachedComments(){
  if (this.kind < SyntaxTreeConstants.NULL_ID) {
    return preComment;
  }
  ;
  if (this.heirs().length == 0) {
    String[] res=new String[1];
    res[0]="String_Node_Str";
    return res;
  }
  ;
  return ((SyntaxTreeNode)this.heirs()[0]).getAttachedComments();
}
Program: 136108
Project: 136108
Buggy source:
/** 
 * For a named assumption, that is one of the form                       "ASSUME foo == ...", this is the ThmOrAssumpDefNode for the           definition.                                                          
 */
public AssumeNode(TreeNode stn,ExprNode expr,ModuleNode mn,ThmOrAssumpDefNode opd){
  super(AssumeKind,stn);
  this.assumeExpr=expr;
  this.module=mn;
  this.def=opd;
}

Fixed version (ground truth):
/** 
 * The array of comments that precede the ASSUME token for an            outer-level theorem.                                                 
 */
public AssumeNode(TreeNode stn,ExprNode expr,ModuleNode mn,ThmOrAssumpDefNode opd){
  super(AssumeKind,stn);
  this.assumeExpr=expr;
  this.module=mn;
  this.def=opd;
}
Program: 136109
Project: 136109
Buggy source:
/** 
 * Displays this node as a String, implementing ExploreNode interface; depth parameter is a bound on the depth of the portion of the tree that is displayed.
 */
public final String toString(int depth){
  if (depth <= 0)   return "String_Node_Str";
  String res=Strings.indent(2,"String_Node_Str" + super.toString(depth) + ((assumeExpr != null) ? Strings.indent(2,assumeExpr.toString(depth - 1)) : "String_Node_Str"));
  if (def != null) {
    res=res + Strings.indent(4,"String_Node_Str" + Strings.indent(2,this.def.toString(depth - 1)));
  }
  ;
  return res;
}

Fixed version (ground truth):
/** 
 * Displays this node as a String, implementing ExploreNode interface; depth parameter is a bound on the depth of the portion of the tree that is displayed.
 */
public final String toString(int depth){
  if (depth <= 0)   return "String_Node_Str";
  String res=Strings.indent(2,"String_Node_Str" + super.toString(depth) + ((assumeExpr != null) ? Strings.indent(2,assumeExpr.toString(depth - 1)) : "String_Node_Str"));
  res=res + SyntaxTreeNode.PreCommentToString(preComments);
  if (def != null) {
    res=res + Strings.indent(4,"String_Node_Str" + Strings.indent(2,this.def.toString(depth - 1)));
  }
  ;
  return res;
}
Program: 136111
Project: 136111
Buggy source:
private final OpDeclNode buildParameter(TreeNode treeNode,int declKind,int declLevel,ModuleNode cm,boolean declare){
  UniqueString us=null;
  int arity=0;
  TreeNode[] ss=treeNode.heirs();
  if (treeNode.isKind(N_IdentDecl)) {
    us=ss[0].getUS();
    arity=(ss.length - 1) / 2;
  }
 else   if (treeNode.isKind(N_PrefixDecl)) {
    us=ss[0].getUS();
    arity=1;
  }
 else   if (treeNode.isKind(N_InfixDecl)) {
    us=ss[1].getUS();
    arity=2;
  }
 else   if (treeNode.isKind(N_PostfixDecl)) {
    us=ss[1].getUS();
    arity=1;
  }
 else {
    errors.addError(treeNode.getLocation(),"String_Node_Str" + treeNode.getUS() + "String_Node_Str");
  }
  SymbolTable st=null;
  if (declare) {
    st=symbolTable;
  }
  ;
  return new OpDeclNode(us,declKind,declLevel,arity,cm,st,treeNode);
}

Fixed version (ground truth):
private final OpDeclNode buildParameter(TreeNode treeNode,int declKind,int declLevel,ModuleNode cm,boolean declare){
  UniqueString us=null;
  int arity=0;
  TreeNode[] ss=treeNode.heirs();
  if (treeNode.isKind(N_IdentDecl)) {
    us=ss[0].getUS();
    arity=(ss.length - 1) / 2;
  }
 else   if (treeNode.isKind(N_PrefixDecl)) {
    us=ss[0].getUS();
    arity=1;
  }
 else   if (treeNode.isKind(N_InfixDecl)) {
    us=ss[1].getUS();
    arity=2;
  }
 else   if (treeNode.isKind(N_PostfixDecl)) {
    us=ss[1].getUS();
    arity=1;
  }
 else {
    errors.addError(treeNode.getLocation(),"String_Node_Str" + treeNode.getUS() + "String_Node_Str");
  }
  SymbolTable st=null;
  if (declare) {
    st=symbolTable;
  }
  ;
  return new OpDeclNode(Operators.resolveSynonym(us),declKind,declLevel,arity,cm,st,treeNode);
}
Program: 136112
Project: 136112
Buggy source:
void finish() throws AbortException {
  int arrayLen=opVec.size();
  ops=new int[arrayLen];
  opNames=new UniqueString[arrayLen];
  opsSTN=new SyntaxTreeNode[arrayLen];
  args=new SyntaxTreeNode[arrayLen];
  for (int i=0; i < arrayLen; i++) {
    args[i]=(SyntaxTreeNode)argVec.elementAt(i);
    SyntaxTreeNode stn=(SyntaxTreeNode)opVec.elementAt(i);
    opsSTN[i]=stn;
    opNames[i]=stn.getUS();
switch (stn.getKind()) {
case IDENTIFIER:
case N_InfixOp:
case N_NonExpPrefixOp:
case N_PostfixOp:
case N_PrefixOp:
case ProofStepLexeme:
case ProofImplicitStepLexeme:
      ops[i]=NameSel;
    break;
case N_StructOp:
  if (stn.heirs().length > 0) {
    TreeNode numNode=stn.heirs()[0].heirs()[0];
    ops[i]=Integer.parseInt(numNode.getImage());
  }
 else {
    UniqueString us=stn.getUS();
    if (us == GGUS) {
      ops[i]=GGSel;
    }
 else     if (us == LLUS) {
      ops[i]=LLSel;
    }
 else     if (us == ColonUS) {
      ops[i]=ColonSel;
    }
 else     if (us == AtUS) {
      ops[i]=AtSel;
    }
 else {
      errors.addAbort(stn.getLocation(),"String_Node_Str" + stn.getImage() + "String_Node_Str");
    }
  }
break;
case N_OpArgs:
ops[i]=NullSel;
break;
default :
errors.addAbort(stn.getLocation(),"String_Node_Str" + stn.getKind());
break;
}
;
}
}

Fixed version (ground truth):
void finish() throws AbortException {
  int arrayLen=opVec.size();
  ops=new int[arrayLen];
  opNames=new UniqueString[arrayLen];
  opsSTN=new SyntaxTreeNode[arrayLen];
  args=new SyntaxTreeNode[arrayLen];
  for (int i=0; i < arrayLen; i++) {
    args[i]=(SyntaxTreeNode)argVec.elementAt(i);
    SyntaxTreeNode stn=(SyntaxTreeNode)opVec.elementAt(i);
    opsSTN[i]=stn;
    opNames[i]=stn.getUS();
switch (stn.getKind()) {
case IDENTIFIER:
case N_InfixOp:
case N_NonExpPrefixOp:
case N_PostfixOp:
case N_PrefixOp:
case ProofStepLexeme:
case ProofImplicitStepLexeme:
      ops[i]=NameSel;
    break;
case N_StructOp:
  if (stn.heirs().length > 0) {
    TreeNode numNode=stn.heirs()[0].heirs()[0];
    ops[i]=Integer.parseInt(numNode.getImage());
  }
 else {
    UniqueString us=stn.getUS();
    if (us == GGUS) {
      ops[i]=GGSel;
    }
 else     if (us == LLUS) {
      ops[i]=LLSel;
    }
 else     if (us == ColonUS) {
      ops[i]=ColonSel;
    }
 else     if (us == AtUS) {
      ops[i]=AtSel;
    }
 else {
      errors.addAbort(stn.getLocation(),"String_Node_Str" + stn.getImage() + "String_Node_Str");
    }
  }
break;
case N_OpArgs:
ops[i]=NullSel;
break;
default :
errors.addError(stn.getLocation(),"String_Node_Str");
break;
}
;
}
}
Program: 136113
Project: 136113
Buggy source:
private Selector genIdToSelector(SyntaxTreeNode genId) throws AbortException {
  Selector retval=new Selector(genId);
  TreeNode prefix=genId.heirs()[0];
  TreeNode[] prefixElts=prefix.heirs();
  SyntaxTreeNode lastOp=(SyntaxTreeNode)genId.heirs()[1];
  for (int i=0; i < prefixElts.length; i++) {
    SyntaxTreeNode thisPrefix=(SyntaxTreeNode)prefixElts[i].heirs()[0];
switch (thisPrefix.getKind()) {
case N_OpArgs:
      retval.addSelector(thisPrefix,thisPrefix);
    break;
case N_StructOp:
  retval.addSelector(thisPrefix,null);
break;
default :
if (prefixElts[i].heirs().length == 2) {
retval.addSelector(thisPrefix,null);
}
 else {
if (prefixElts[i].heirs().length != 3) {
  errors.addAbort(prefixElts[i].getLocation(),"String_Node_Str" + "String_Node_Str");
}
;
retval.addSelector(thisPrefix,(SyntaxTreeNode)prefixElts[i].heirs()[1]);
}
break;
}
}
;
if (lastOp.getKind() == N_OpArgs) {
retval.addSelector(lastOp,lastOp);
}
 else {
retval.addSelector(lastOp,null);
}
;
retval.finish();
return retval;
}

Fixed version (ground truth):
private Selector genIdToSelector(SyntaxTreeNode genId) throws AbortException {
  Selector retval=new Selector(genId);
  TreeNode prefix=genId.heirs()[0];
  TreeNode[] prefixElts=prefix.heirs();
  SyntaxTreeNode lastOp=(SyntaxTreeNode)genId.heirs()[1];
  for (int i=0; i < prefixElts.length; i++) {
    TreeNode[] pe=prefixElts[i].heirs();
    if (pe.length == 0) {
      errors.addError(genId.getLocation(),"String_Node_Str");
      break;
    }
    ;
    SyntaxTreeNode thisPrefix=(SyntaxTreeNode)pe[0];
switch (thisPrefix.getKind()) {
case N_OpArgs:
      retval.addSelector(thisPrefix,thisPrefix);
    break;
case N_StructOp:
  retval.addSelector(thisPrefix,null);
break;
default :
if (prefixElts[i].heirs().length == 2) {
retval.addSelector(thisPrefix,null);
}
 else {
if (prefixElts[i].heirs().length != 3) {
  errors.addAbort(prefixElts[i].getLocation(),"String_Node_Str" + "String_Node_Str");
}
;
retval.addSelector(thisPrefix,(SyntaxTreeNode)prefixElts[i].heirs()[1]);
}
break;
}
}
;
if (lastOp.getKind() == N_OpArgs) {
retval.addSelector(lastOp,lastOp);
}
 else {
retval.addSelector(lastOp,null);
}
;
retval.finish();
return retval;
}
Program: 136115
Project: 136115
Buggy source:
private final LeafProofNode generateLeafProof(TreeNode stn,ModuleNode cm) throws AbortException {
  TreeNode heirs[]=stn.heirs();
  LevelNode[] facts;
  SymbolNode[] defs;
  int nextTok=0;
  boolean omitted=false;
  if (heirs[0].getKind() == TLAplusParserConstants.PROOF) {
    nextTok++;
  }
  ;
  if (heirs[nextTok].getKind() == TLAplusParserConstants.BY) {
    UseOrHideNode uh=generateUseOrHide(stn,cm);
    facts=uh.facts;
    defs=uh.defs;
    if (facts.length + defs.length == 0) {
      errors.addError(stn.getLocation(),"String_Node_Str");
    }
    ;
  }
 else {
    facts=new LevelNode[0];
    defs=new SymbolNode[0];
    if (heirs[nextTok].getKind() == TLAplusParserConstants.OMITTED) {
      omitted=true;
    }
    ;
  }
  ;
  return new LeafProofNode(stn,facts,defs,omitted);
}

Fixed version (ground truth):
private final LeafProofNode generateLeafProof(TreeNode stn,ModuleNode cm) throws AbortException {
  TreeNode heirs[]=stn.heirs();
  LevelNode[] facts;
  SymbolNode[] defs;
  int nextTok=0;
  boolean omitted=false;
  if (heirs[0].getKind() == TLAplusParserConstants.PROOF) {
    nextTok++;
  }
  ;
  boolean isOnly=false;
  if (heirs[nextTok].getKind() == TLAplusParserConstants.BY) {
    UseOrHideNode uh=generateUseOrHide(stn,cm);
    isOnly=uh.isOnly;
    facts=uh.facts;
    defs=uh.defs;
    if (facts.length + defs.length == 0) {
      errors.addError(stn.getLocation(),"String_Node_Str");
    }
    ;
  }
 else {
    facts=new LevelNode[0];
    defs=new SymbolNode[0];
    if (heirs[nextTok].getKind() == TLAplusParserConstants.OMITTED) {
      omitted=true;
    }
    ;
  }
  ;
  return new LeafProofNode(stn,facts,defs,omitted,isOnly);
}
Program: 136116
Project: 136116
Buggy source:
/** 
 * The constructor.                                                       
 */
public LeafProofNode(TreeNode stn,LevelNode[] theFacts,SymbolNode[] theDefs,boolean omit){
  super(LeafProofKind,stn);
  this.facts=theFacts;
  this.defs=theDefs;
  this.omitted=omit;
}

Fixed version (ground truth):
/** 
 * The constructor.                                                       
 */
public LeafProofNode(TreeNode stn,LevelNode[] theFacts,SymbolNode[] theDefs,boolean omit,boolean only){
  super(LeafProofKind,stn);
  this.facts=theFacts;
  this.defs=theDefs;
  this.omitted=omit;
  this.onlyFlag=only;
}
Program: 136117
Project: 136117
Buggy source:
public String toString(int depth){
  if (depth <= 0)   return "String_Node_Str";
  String ret="String_Node_Str" + super.toString(depth) + Strings.indent(2,"String_Node_Str");
  for (int i=0; i < this.facts.length; i++) {
    ret+=Strings.indent(4,this.facts[i].toString(depth - 1));
  }
  ;
  ret+=Strings.indent(2,"String_Node_Str");
  for (int i=0; i < this.defs.length; i++) {
    ret+=Strings.indent(4,this.defs[i].toString(depth - 1));
  }
  ;
  ret+=Strings.indent(2,"String_Node_Str" + this.omitted);
  return ret;
}

Fixed version (ground truth):
public String toString(int depth){
  if (depth <= 0)   return "String_Node_Str";
  String ret="String_Node_Str" + super.toString(depth) + Strings.indent(2,"String_Node_Str");
  for (int i=0; i < this.facts.length; i++) {
    ret+=Strings.indent(4,this.facts[i].toString(depth - 1));
  }
  ;
  ret+=Strings.indent(2,"String_Node_Str");
  for (int i=0; i < this.defs.length; i++) {
    ret+=Strings.indent(4,this.defs[i].toString(depth - 1));
  }
  ;
  ret+=Strings.indent(2,"String_Node_Str" + this.omitted) + Strings.indent(2,"String_Node_Str" + this.onlyFlag);
  return ret;
}
Program: 136118
Project: 136118
Buggy source:
final void addAssumption(TreeNode stn,ExprNode ass,SymbolTable st,ThmOrAssumpDefNode tadn){
  AssumeNode an=new AssumeNode(stn,ass,this,tadn);
  assumptionVec.addElement(an);
  topLevelVec.addElement(an);
}

Fixed version (ground truth):
final void addAssumption(TreeNode stn,ExprNode ass,SymbolTable st,ThmOrAssumpDefNode tadn){
  AssumeNode an=new AssumeNode(stn,ass,this,tadn);
  an.setPreComments(((SyntaxTreeNode)stn).getAttachedComments());
  assumptionVec.addElement(an);
  topLevelVec.addElement(an);
}
Program: 136119
Project: 136119
Buggy source:
final void addTheorem(TreeNode stn,LevelNode thm,ProofNode pf,ThmOrAssumpDefNode tadn){
  TheoremNode tn=new TheoremNode(stn,thm,this,pf,tadn);
  theoremVec.addElement(tn);
  topLevelVec.addElement(tn);
}

Fixed version (ground truth):
final void addTheorem(TreeNode stn,LevelNode thm,ProofNode pf,ThmOrAssumpDefNode tadn){
  TheoremNode tn=new TheoremNode(stn,thm,this,pf,tadn);
  tn.setPreComments(((SyntaxTreeNode)stn).getAttachedComments());
  theoremVec.addElement(tn);
  topLevelVec.addElement(tn);
}
Program: 136120
Project: 136120
Buggy source:
/** 
 * toString() method; part of implementation of ExploreNode interface
 */
public String toString(int depth){
  if (depth <= 0)   return "String_Node_Str";
  return super.toString(depth) + "String_Node_Str" + arity+ "String_Node_Str"+ (originallyDefinedInModule != null ? originallyDefinedInModule.getName().toString() : "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * toString() method; part of implementation of ExploreNode interface
 */
public String toString(int depth){
  if (depth <= 0)   return "String_Node_Str";
  return super.toString(depth) + "String_Node_Str" + arity+ "String_Node_Str"+ (originallyDefinedInModule != null ? originallyDefinedInModule.getName().toString() : "String_Node_Str")+ this.PreCommentsAsString();
}
Program: 136121
Project: 136121
Buggy source:
public boolean containsValue(Object value){
  return forwardStore.containsValue(value);
}

Fixed version (ground truth):
public boolean containsValue(Object value){
  return backwardStore.containsKey(value);
}
Program: 136122
Project: 136122
Buggy source:
public Object execute(ExecutionEvent event) throws ExecutionException {
  UIHelper.getActivePage().closeAllEditors(true);
  UIHelper.switchPerspective(InitialPerspective.ID);
  Activator.getSpecManager().setSpecLoaded(null);
  return null;
}

Fixed version (ground truth):
public Object execute(ExecutionEvent event) throws ExecutionException {
  UIHelper.getActivePage().closeAllEditors(true);
  UIHelper.hideView(ProblemView.ID);
  UIHelper.switchPerspective(InitialPerspective.ID);
  Activator.getSpecManager().setSpecLoaded(null);
  return null;
}
Program: 136123
Project: 136123
Buggy source:
/** 
 * Writes contents stored in the string buffer to the file, replacing the content 
 * @param file
 * @param buffer
 * @param monitor
 * @throws CoreException
 */
public static void replaceContent(IFile file,StringBuffer buffer,IProgressMonitor monitor) throws CoreException {
  boolean force=true;
  ByteArrayInputStream stream=new ByteArrayInputStream(buffer.toString().getBytes());
  if (file.exists()) {
    file.setContents(stream,force ? IResource.FORCE | IResource.KEEP_HISTORY : IResource.KEEP_HISTORY,monitor);
  }
 else {
    file.create(stream,force,monitor);
  }
}

Fixed version (ground truth):
/** 
 * Writes contents stored in the string buffer to the file, replacing the content 
 * @param file
 * @param buffer
 * @param monitor
 * @throws CoreException
 */
public static void replaceContent(IFile file,StringBuffer buffer,IProgressMonitor monitor) throws CoreException {
  boolean force=true;
  ByteArrayInputStream stream=new ByteArrayInputStream(buffer.toString().getBytes());
  if (file.exists()) {
    file.setContents(stream,force ? IResource.FORCE | IResource.KEEP_HISTORY : IResource.KEEP_HISTORY,monitor);
  }
 else {
    throw new CoreException(new Status(IStatus.ERROR,Activator.PLUGIN_ID,"String_Node_Str" + file.getName() + "String_Node_Str"));
  }
}
Program: 136125
Project: 136125
Buggy source:
public void createFieldEditors(Composite composite){
  algorithmFoundEditor=new BooleanFieldEditor(IPreferenceConstants.CONTAINS_PCAL_ALGORITHM,"String_Node_Str",composite);
  addEditor(algorithmFoundEditor);
}

Fixed version (ground truth):
public void createFieldEditors(Composite composite){
  pcalParamEditor=new StringFieldEditor(IPreferenceConstants.PCAL_CAL_PARAMS,"String_Node_Str",composite);
  addEditor(pcalParamEditor);
}
Program: 136126
Project: 136126
Buggy source:
/** 
 * (non-Javadoc) Method declared on PreferencePage
 */
public Control createContents(Composite parent){
  Control contents=super.createContents(parent);
  noDefaultAndApplyButton();
  return contents;
}

Fixed version (ground truth):
/** 
 * (non-Javadoc) Method declared on PreferencePage
 */
public Control createContents(Composite parent){
  Control contents=super.createContents(parent);
  noDefaultAndApplyButton();
  UIHelper.setHelp(contents,IHelpConstants.MODULE_PROPERTY_PAGE);
  return contents;
}
Program: 136127
Project: 136127
Buggy source:
/** 
 */
public void createFieldEditors(Composite composite){
  StringFieldEditor rootFileEditor=new StringFieldEditor(IPreferenceConstants.P_PROJECT_ROOT_FILE,"String_Node_Str",composite);
  addEditor(rootFileEditor);
}

Fixed version (ground truth):
public void createFieldEditors(Composite composite){
  StringFieldEditor rootFileEditor=new StringFieldEditor(IPreferenceConstants.P_PROJECT_ROOT_FILE,"String_Node_Str",composite);
  addEditor(rootFileEditor);
}
Program: 136128
Project: 136128
Buggy source:
/** 
 * Retrieves the default resolver
 * @return
 */
public static FilenameToStream getDefaultResolver(){
  return defaultResolver;
}

Fixed version (ground truth):
/** 
 * Retrieves the default resolver
 * @return always not null
 */
public static FilenameToStream getDefaultResolver(){
  if (defaultResolver == null) {
    setDefaultResolver(null);
  }
  return defaultResolver;
}
Program: 136132
Project: 136132
Buggy source:
/** 
 * The portion of the next message written by invocations of print()     not followed by an invocation of println().                          
 */
public static synchronized String[] getAllMessages(){
  int retLen=length;
  if (!nextMessage.equals("String_Node_Str")) {
    retLen++;
  }
  ;
  String[] ret=new String[retLen];
  System.arraycopy(messages,0,ret,0,retLen);
  if (!nextMessage.equals("String_Node_Str")) {
    ret[length]=nextMessage;
  }
  ;
  return ret;
}

Fixed version (ground truth):
/** 
 * Retrieves the messages send to the err and out streams
 */
public static synchronized String[] getAllMessages(){
  int retLen=length;
  if (!nextMessage.equals("String_Node_Str")) {
    retLen++;
  }
  String[] ret=new String[retLen];
  System.arraycopy(messages,0,ret,0,retLen);
  if (!nextMessage.equals("String_Node_Str")) {
    ret[length]=nextMessage;
  }
  return ret;
}
Program: 136133
Project: 136133
Buggy source:
public void println(String str){
synchronized (this.getClass()) {
    String thisMessage=ToolIO.nextMessage + str;
    ToolIO.nextMessage="String_Node_Str";
    if (ToolIO.messages.length == ToolIO.length) {
      String[] newMessages=new String[2 * ToolIO.messages.length];
      System.arraycopy(ToolIO.messages,0,newMessages,0,ToolIO.messages.length);
      ToolIO.messages=newMessages;
    }
    ;
    ToolIO.messages[ToolIO.length]=thisMessage;
    ToolIO.length++;
    try {
      Class.forName("String_Node_Str").notifyAll();
    }
 catch (    Exception e) {
    }
    ;
  }
  ;
}

Fixed version (ground truth):
/** 
 * Prints a string in to the ToolIO buffer in a separate line
 * @param str String to be printed
 */
public void println(String str){
synchronized (ToolPrintStream.class) {
    String thisMessage=ToolIO.nextMessage + str;
    ToolIO.nextMessage="String_Node_Str";
    if (ToolIO.messages.length == ToolIO.length) {
      String[] newMessages=new String[2 * ToolIO.messages.length];
      System.arraycopy(ToolIO.messages,0,newMessages,0,ToolIO.messages.length);
      ToolIO.messages=newMessages;
    }
    ToolIO.messages[ToolIO.length]=thisMessage;
    ToolIO.length++;
    ToolPrintStream.class.notifyAll();
  }
}
Program: 136134
Project: 136134
Buggy source:
public synchronized void print(String str){
synchronized (this.getClass()) {
    ToolIO.nextMessage=ToolIO.nextMessage + "String_Node_Str";
    try {
      Class.forName("String_Node_Str").notifyAll();
    }
 catch (    Exception e) {
    }
    ;
  }
}

Fixed version (ground truth):
/** 
 * Prints a string to the ToolIO message buffer.
 * @param str The <code>String</code> to be printed
 */
public synchronized void print(String str){
synchronized (ToolPrintStream.class) {
    ToolIO.nextMessage+=str;
    ToolPrintStream.class.notifyAll();
  }
}
Program: 136135
Project: 136135
Buggy source:
public ToolPrintStream(){
  super(new PipedOutputStream());
  ToolIO.out=this;
  ToolIO.err=this;
}

Fixed version (ground truth):
/** 
 * Constructor
 */
public ToolPrintStream(){
  super(new PipedOutputStream());
  ToolIO.out=this;
  ToolIO.err=this;
}
Program: 136136
Project: 136136
Buggy source:
public static synchronized void printAllMessages(){
  System.out.println("String_Node_Str");
  String[] msgs=getAllMessages();
  for (int i=0; i < msgs.length; i++) {
    System.out.println("String_Node_Str" + i + "String_Node_Str");
    System.out.println(msgs[i]);
  }
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Prints all messages to system out
 */
public static synchronized void printAllMessages(){
  System.out.println("String_Node_Str");
  String[] msgs=getAllMessages();
  for (int i=0; i < msgs.length; i++) {
    System.out.println("String_Node_Str" + i + "String_Node_Str");
    System.out.println(msgs[i]);
  }
  System.out.println("String_Node_Str");
}
Program: 136137
Project: 136137
Buggy source:
public static boolean setMode(int m){
  if (m == SYSTEM) {
    mode=m;
    out=System.out;
    err=System.err;
    return true;
  }
 else   if (m == TOOL) {
    mode=m;
    out=new ToolPrintStream();
    err=new ToolPrintStream();
    return true;
  }
  ;
  return false;
}

Fixed version (ground truth):
/** 
 * Set the mode and returns true if the mode argument is legal,          otherwise does nothing and returns false.
 * @param m - the mode, use {@link ToolIO#SYSTEM},  {@link ToolIO#TOOL}
 */
public static boolean setMode(int m){
  if (m == SYSTEM) {
    mode=m;
    out=System.out;
    err=System.err;
    return true;
  }
 else   if (m == TOOL) {
    mode=m;
    out=new ToolPrintStream();
    err=new ToolPrintStream();
    return true;
  }
  return false;
}
Program: 136138
Project: 136138
Buggy source:
public static synchronized void reset(){
  messages=new String[InitialMaxLength];
  length=0;
  nextMessage="String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Resets the ToolIO and deletes the messages  the mode and user directory are not changed 
 */
public static synchronized void reset(){
  messages=new String[InitialMaxLength];
  length=0;
  nextMessage="String_Node_Str";
}
Program: 136139
Project: 136139
Buggy source:
public static int getMode(){
  return mode;
}

Fixed version (ground truth):
/** 
 * Returns the mode of the ToolIO
 * @return one of {@link ToolIO#SYSTEM},  {@link ToolIO#TOOL} 
 */
public static int getMode(){
  return mode;
}
Program: 136140
Project: 136140
Buggy source:
/** 
 * The level number of a proof with steps numbered <n>x is n.  The value   of proofLevelStack[proofDepth] is the level number of the current       proof.  If we have started processing a proof haven't yet determined    its level, then proofLevelStack[proofDepth] equals -1.                 
 */
private int levelOfProofStepLexeme(Token tok){
  String im=tok.image;
  if (im.substring(1,2).equals("String_Node_Str")) {
    return -1;
  }
  ;
  if (im.substring(1,2).equals("String_Node_Str")) {
    return -2;
  }
  ;
  return new Integer(im.substring(1,im.indexOf('>')));
}

Fixed version (ground truth):
/** 
 * The level number of a proof with steps numbered <n>x is n.  The value   of proofLevelStack[proofDepth] is the level number of the current       proof.  If we have started processing a proof haven't yet determined    its level, then proofLevelStack[proofDepth] equals -1.                 
 */
private int levelOfProofStepLexeme(Token tok){
  String im=tok.image;
  if (im.substring(1,2).equals("String_Node_Str")) {
    return -1;
  }
  ;
  if (im.substring(1,2).equals("String_Node_Str")) {
    return -2;
  }
  ;
  return new Integer(im.substring(1,im.indexOf('>'))).intValue();
}
Program: 136142
Project: 136142
Buggy source:
/** 
 * Reports a warning to the user
 * @param message
 */
private void reportWarning(String message){
  this.setPageComplete(false);
  this.setMessage(message,DialogPage.WARNING);
}

Fixed version (ground truth):
/** 
 * Reports a warning to the user
 * @param message
 */
private void reportWarning(String message){
  this.setPageComplete(true);
  this.setMessage(message,DialogPage.WARNING);
}
Program: 136145
Project: 136145
Buggy source:
/** 
 * Adapts a list of modules including all dependent modules and the resource itself to the form, accepted by the dependency storage
 * @param name
 * @param userModules
 * @return TODO improve the storage
 */
public static List adaptModules(String name,Vector userModules){
  Vector dependents=new Vector(userModules.size() - 1);
  for (int i=0; i < userModules.size(); i++) {
    Module module=(Module)userModules.get(i);
    if (!module.getFile().getName().equals(name)) {
      dependents.add(module.getFile().getName());
    }
  }
  return dependents;
}

Fixed version (ground truth):
/** 
 * Adapts a list of modules including all dependent modules and the resource itself to the form, accepted by the dependency storage
 * @param name
 * @param userModules
 * @return TODO improve the storage
 */
public static List adaptModules(String name,Vector userModules){
  Vector dependents=new Vector(userModules.size());
  for (int i=0; i < userModules.size(); i++) {
    Module module=(Module)userModules.get(i);
    if (!module.getFile().getName().equals(name)) {
      dependents.add(module.getFile().getName());
    }
  }
  return dependents;
}
Program: 136146
Project: 136146
Buggy source:
public void run(){
  if (UIHelper.isPerspectiveShown(ProblemsPerspective.ID)) {
    UIHelper.closeWindow(ProblemsPerspective.ID);
  }
 else {
    Spec spec=Activator.getSpecManager().getSpecLoaded();
    if (AdapterFactory.isProblemStatus(spec.getStatus())) {
      UIHelper.openPerspectiveInWindowRight(ProblemsPerspective.ID,null,ProblemsPerspective.WIDTH);
    }
  }
}

Fixed version (ground truth):
public void run(){
  if (UIHelper.isPerspectiveShown(ProblemsPerspective.ID)) {
    UIHelper.closeWindow(ProblemsPerspective.ID);
  }
 else {
    if (TLAMarkerHelper.currentSpecHasProblems()) {
      UIHelper.openPerspectiveInWindowRight(ProblemsPerspective.ID,null,ProblemsPerspective.WIDTH);
    }
  }
}
Program: 136147
Project: 136147
Buggy source:
public Object execute(ExecutionEvent event) throws ExecutionException {
  UIHelper.runUIAsync(new Runnable(){
    public void run(){
      if (UIHelper.isPerspectiveShown(ProblemsPerspective.ID)) {
        UIHelper.closeWindow(ProblemsPerspective.ID);
      }
 else {
        Spec spec=Activator.getSpecManager().getSpecLoaded();
        if (AdapterFactory.isProblemStatus(spec.getStatus())) {
          UIHelper.openPerspectiveInWindowRight(ProblemsPerspective.ID,null,ProblemsPerspective.WIDTH);
        }
      }
    }
  }
);
  return null;
}

Fixed version (ground truth):
public Object execute(ExecutionEvent event) throws ExecutionException {
  UIHelper.runUIAsync(new Runnable(){
    public void run(){
      if (UIHelper.isPerspectiveShown(ProblemsPerspective.ID)) {
        UIHelper.closeWindow(ProblemsPerspective.ID);
      }
 else {
        if (TLAMarkerHelper.currentSpecHasProblems()) {
          UIHelper.openPerspectiveInWindowRight(ProblemsPerspective.ID,null,ProblemsPerspective.WIDTH);
        }
      }
    }
  }
);
  return null;
}
Program: 136148
Project: 136148
Buggy source:
/** 
 * Encode semantic error and create the marker on the corresponding resource 
 * @param spec
 * @param errorText
 * @param severityError
 * @param monitor
 */
private void encodeSematicErrorFromString(Spec spec,String errorText,int severityError,IProgressMonitor monitor){
  IFile module=null;
  int[] val=findLineAndColumn(0,errorText);
  int beginLine=val[0];
  int beginColumn=val[1];
  int endLine=0;
  int endColumn=0;
  val=findLineAndColumn(val[2],errorText);
  if ((val[0] > beginLine) || ((val[0] == beginLine) && (val[1] >= beginColumn))) {
    endLine=val[0];
    endColumn=val[1];
  }
  int beginModuleIdx=errorText.indexOf("String_Node_Str");
  if (beginModuleIdx != -1) {
    beginModuleIdx=beginModuleIdx + "String_Node_Str".length();
    int endModuleIdx=errorText.indexOf("String_Node_Str",beginModuleIdx);
    if (endModuleIdx != -1) {
      module=spec.findModule(errorText.substring(beginModuleIdx,endModuleIdx));
    }
  }
  int[] coordinates=new int[]{beginLine,beginColumn,endLine,endColumn};
  if (module == null) {
    TLAMarkerHelper.installProblemMarkerOnSpec(spec,severityError,coordinates,errorText,monitor);
  }
 else {
    TLAMarkerHelper.installProblemMarkerOnModule(module,severityError,coordinates,errorText,monitor);
  }
}

Fixed version (ground truth):
/** 
 * Encode semantic error and create the marker on the corresponding resource 
 * @param spec
 * @param errorText
 * @param severityError
 * @param monitor
 */
private void encodeSematicErrorFromString(Spec spec,String errorText,int severityError,IProgressMonitor monitor){
  IFile module=null;
  int[] val=findLineAndColumn(0,errorText);
  int beginLine=val[0];
  int beginColumn=val[1];
  int endLine=0;
  int endColumn=0;
  val=findLineAndColumn(val[2],errorText);
  if ((val[0] > beginLine) || ((val[0] == beginLine) && (val[1] >= beginColumn))) {
    endLine=val[0];
    endColumn=val[1];
  }
  int beginModuleIdx=errorText.indexOf("String_Node_Str");
  if (beginModuleIdx != -1) {
    beginModuleIdx=beginModuleIdx + "String_Node_Str".length();
    int endModuleIdx=errorText.indexOf("String_Node_Str",beginModuleIdx);
    if (endModuleIdx != -1) {
      module=spec.findModuleFile(errorText.substring(beginModuleIdx,endModuleIdx));
    }
  }
  int[] coordinates=new int[]{beginLine,beginColumn,endLine,endColumn};
  if (module == null) {
    TLAMarkerHelper.installProblemMarkerOnSpec(spec,severityError,coordinates,errorText,monitor);
  }
 else {
    TLAMarkerHelper.installProblemMarkerOnModule(module,severityError,coordinates,errorText,monitor);
  }
}
Program: 136151
Project: 136151
Buggy source:
/** 
 * Constructor
 */
public WorkspaceSpecManager(){
  IWorkspace ws=ResourcesPlugin.getWorkspace();
  IProject[] projects=ws.getRoot().getProjects();
  try {
    Spec spec=null;
    for (int i=0; i < projects.length; i++) {
      if (projects[i].isOpen() && projects[i].hasNature(TLANature.ID)) {
        spec=new Spec(projects[i]);
        addSpec(spec);
      }
    }
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
  ws.addResourceChangeListener(this);
}

Fixed version (ground truth):
/** 
 * Constructor
 */
public WorkspaceSpecManager(){
  IWorkspace ws=ResourcesPlugin.getWorkspace();
  IProject[] projects=ws.getRoot().getProjects();
  try {
    Spec spec=null;
    for (int i=0; i < projects.length; i++) {
      if (projects[i].isOpen()) {
        if (projects[i].hasNature(TLANature.ID)) {
          spec=new Spec(projects[i]);
          addSpec(spec);
        }
      }
 else {
        projects[i].delete(true,null);
      }
    }
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
  ws.addResourceChangeListener(this);
}
Program: 136152
Project: 136152
Buggy source:
public void setSpecLoaded(Spec loadedSpec){
  this.loadedSpec=loadedSpec;
  if (this.loadedSpec != null) {
    this.loadedSpec.setLastModified();
    Activator.getParserRegistry().parseResultChanged(this.loadedSpec.getStatus());
  }
 else {
    Activator.getParserRegistry().parseResultChanged(IParseConstants.UNKNOWN);
  }
}

Fixed version (ground truth):
public void setSpecLoaded(Spec loadedSpec){
  this.loadedSpec=loadedSpec;
  if (this.loadedSpec != null) {
    this.loadedSpec.setLastModified();
  }
}
Program: 136153
Project: 136153
Buggy source:
public static String PeekAtAlgToken(int tokNum){
  while ((LATsize < tokNum)) {
    charReader.peek();
    curTokCol[LATsize]=charReader.getColumnNumber();
    curTokLine[LATsize]=charReader.getLineNumber();
    LAT[LATsize]=Tokenize.GetAlgorithmToken(charReader);
    LATsize=LATsize + 1;
  }
  ;
  return LAT[tokNum - 1];
}

Fixed version (ground truth):
public static String PeekAtAlgToken(int tokNum){
  while ((LATsize < tokNum)) {
    if (charReader.peek().equals("String_Node_Str")) {
      PcalDebug.ReportError("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + (curTokLine[LATsize] + 1) + "String_Node_Str"+ (curTokCol[LATsize] + 1));
    }
    ;
    curTokCol[LATsize]=charReader.getColumnNumber();
    curTokLine[LATsize]=charReader.getLineNumber();
    LAT[LATsize]=Tokenize.GetAlgorithmToken(charReader);
    LATsize=LATsize + 1;
  }
  ;
  return LAT[tokNum - 1];
}
Program: 136156
Project: 136156
Buggy source:
/** 
 * {@link org.opentravel.schemas.actions.VersionMajorAction#run()}
 */
@Override public LibraryNode createMajorVersion(LibraryNode library){
}

Fixed version (ground truth):
/** 
 * {@link org.opentravel.schemas.actions.VersionMajorAction#run()}
 */
@Override public LibraryNode createMajorVersion(LibraryNode library){
  if (!versionPreparation(library))   return null;
  RepositoryNode rn=find(library.getProjectItem().getRepository());
  MajorVersionHelper mvh=new MajorVersionHelper(library.getProject().getTLProject());
  TLLibrary tlMajor=null;
  LibraryNode newLib=null;
  LibraryChainNode lcn=null;
  ProjectNode thisProject=library.getProject();
  try {
    tlMajor=mvh.createNewMajorVersion(library.getTLLibrary());
  }
 catch (  VersionSchemeException e) {
    postRepoException(e);
  }
catch (  ValidationException e) {
    postRepoException(e);
  }
catch (  LibrarySaveException e) {
    postRepoException(e);
  }
catch (  IllegalArgumentException e) {
    postRepoException(e);
  }
  if (tlMajor != null) {
    newLib=new LibraryNode(tlMajor,library.getProject());
    List<LibraryChainNode> chains=manage(rn,Collections.singletonList(newLib));
    lcn=findLibrary(chains,newLib.getLibrary().getName());
    if (lcn != null) {
      LibraryModelManager libMrg=Node.getLibraryModelManager();
      ProjectController pc=mc.getProjectController();
      List<ProjectNode> pList=libMrg.findProjects(library);
      LibraryNavNode lnnToRemove=null;
      for (      ProjectNode pn : pList) {
        if (pn != thisProject)         new LibraryNavNode(lcn,pn);
      }
      lock(newLib);
    }
    sync(rn);
  }
  return newLib;
}
Program: 136157
Project: 136157
Buggy source:
/** 
 * Prepare the library for new version. Preparation includes committing, unlocking and finalizing. User interactions is sought before making changes.
 * @param library
 * @return true if ready.
 */
private boolean versionPreparation(LibraryNode library){
  if (library.getProject() == null) {
    postRepoError("String_Node_Str");
    return false;
  }
  if (library.getProjectItem() == null) {
    postRepoError("String_Node_Str");
    return false;
  }
  RepositoryNode rn=find(library.getProjectItem().getRepository());
  if (rn == null) {
    postRepoError("String_Node_Str");
    return false;
  }
  if (!library.getStatus().equals(TLLibraryStatus.FINAL)) {
    postRepoError("String_Node_Str");
    return false;
  }
  if (!library.isReadyToVersion()) {
    postRepoError("String_Node_Str");
    return false;
  }
  if (library.getChain() == null) {
    LOGGER.warn("String_Node_Str" + library);
    return false;
  }
  String msgID="String_Node_Str";
  boolean isOK=false;
  boolean editable=library.getEditStatus().equals(NodeEditStatus.FULL);
  msgID="String_Node_Str";
  isOK=DialogUserNotifier.openConfirm(Messages.getString("String_Node_Str"),Messages.getString(msgID));
  return isOK;
}

Fixed version (ground truth):
/** 
 * Prepare the library for new version. Preparation includes committing, unlocking and finalizing. User interactions is sought before making changes.
 * @param library
 * @return true if ready.
 */
private boolean versionPreparation(LibraryNode library){
  if (library == null) {
    LOGGER.warn("String_Node_Str");
    return false;
  }
  if (library.getProject() == null) {
    postRepoError("String_Node_Str");
    return false;
  }
  if (library.getProjectItem() == null) {
    postRepoError("String_Node_Str");
    return false;
  }
  RepositoryNode rn=find(library.getProjectItem().getRepository());
  if (rn == null) {
    postRepoError("String_Node_Str");
    return false;
  }
  if (!library.getStatus().equals(TLLibraryStatus.FINAL)) {
    postRepoError("String_Node_Str");
    return false;
  }
  if (!library.isReadyToVersion()) {
    postRepoError("String_Node_Str");
    return false;
  }
  if (library.getChain() == null) {
    LOGGER.warn("String_Node_Str" + library);
    return false;
  }
  String msgID="String_Node_Str";
  boolean isOK=false;
  boolean editable=library.getEditStatus().equals(NodeEditStatus.FULL);
  msgID="String_Node_Str";
  isOK=DialogUserNotifier.openConfirm(Messages.getString("String_Node_Str"),Messages.getString(msgID));
  return isOK;
}
Program: 136158
Project: 136158
Buggy source:
@Override public void processValueChangeEvent(ValueChangeEvent<?,?> event){
  super.processValueChangeEvent(event);
switch (event.getType()) {
case LOCATION_MODIFIED:
case PARAM_GROUP_ADDED:
case PARAM_GROUP_MODIFIED:
case PARAM_GROUP_REMOVED:
case PAYLOAD_TYPE_MODIFIED:
case FACET_REF_MODIFIED:
    if (thisNode instanceof ActionRequest)     ((ActionRequest)thisNode).setPathTemplate();
  break;
case BASE_PATH_MODIFIED:
default :
}
}

Fixed version (ground truth):
@Override public void processValueChangeEvent(ValueChangeEvent<?,?> event){
  LOGGER.debug("String_Node_Str" + event.getType());
  super.processValueChangeEvent(event);
switch (event.getType()) {
case LOCATION_MODIFIED:
case PARAM_GROUP_ADDED:
case PARAM_GROUP_MODIFIED:
case PARAM_GROUP_REMOVED:
case PAYLOAD_TYPE_MODIFIED:
case FACET_REF_MODIFIED:
    if (thisNode instanceof ActionRequest)     ((ActionRequest)thisNode).setPathTemplate();
  break;
case BASE_PATH_MODIFIED:
default :
}
}
Program: 136160
Project: 136160
Buggy source:
/** 
 * If view is set return the current node from the view. Use navigator node otherwise.
 */
private void setSelected(){
  if (mc.getCurrentNode_NavigatorView() instanceof BusinessObjectNode)   predicate=(BusinessObjectNode)mc.getCurrentNode_NavigatorView();
  if (view != null)   selectedNode=(Node)view.getCurrentNode();
 else   selectedNode=mc.getCurrentNode_NavigatorView();
}

Fixed version (ground truth):
/** 
 * If view is set return the current node from the view. Use navigator node otherwise.
 */
private void setSelected(){
  if (mc.getCurrentNode_NavigatorView() instanceof BusinessObjectNode)   predicate=(BusinessObjectNode)mc.getCurrentNode_NavigatorView();
  selectedNode=getFirstSelected();
  if (selectedNode == null)   if (view != null)   selectedNode=(Node)view.getCurrentNode();
 else   selectedNode=mc.getCurrentNode_NavigatorView();
}
Program: 136161
Project: 136161
Buggy source:
private void postWarning(CommandType type){
switch (type) {
case DELETE:
    DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str");
  break;
default :
DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str");
}
}

Fixed version (ground truth):
private void postWarning(CommandType type){
switch (type) {
case DELETE:
    DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str");
  break;
case RESOURCE:
DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str");
break;
default :
DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str");
}
}
Program: 136162
Project: 136162
Buggy source:
@Override public boolean isEnabled(){
  Node n=mc.getGloballySelectNode();
  Node rn=mc.getCurrentNode_ResourceView();
  return true;
}

Fixed version (ground truth):
@Override public boolean isEnabled(){
  Node n=getFirstSelected();
  Node rn=mc.getCurrentNode_ResourceView();
  return n.isEditable();
}
Program: 136163
Project: 136163
Buggy source:
@Override public Object execute(ExecutionEvent exEvent) throws ExecutionException {
  String filePathParam=exEvent.getParameter("String_Node_Str");
  view=OtmRegistry.getResourceView();
  setSelected();
  if (selectedNode == null)   return null;
  runCommand(getCmdType(exEvent.getCommand().getId()));
  if (view != null)   view.activate();
  return null;
}

Fixed version (ground truth):
@Override public Object execute(ExecutionEvent exEvent) throws ExecutionException {
  view=OtmRegistry.getResourceView();
  setSelected();
  if (selectedNode == null)   return null;
  runCommand(getCmdType(exEvent.getCommand().getId()));
  if (view != null)   view.activate();
  return null;
}
Program: 136164
Project: 136164
Buggy source:
/** 
 * @return true if older than version 1.6 OR user confirms saving
 */
public static boolean post16UpgradeConfirmation(){
  if (OTM16Upgrade.otm16Enabled) {
    if (!DialogUserNotifier.openConfirm("String_Node_Str",Messages.getString("String_Node_Str")))     return false;
    return true;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * @return true if older than version 1.6 OR user confirms saving
 */
public static boolean post16UpgradeConfirmation(){
  return true;
}
Program: 136165
Project: 136165
Buggy source:
public List<Node> getAncestors(){
  List<Node> ancestors=new ArrayList<>();
  Node n=this;
  do {
    ancestors.add(n);
    n=n.getParent();
  }
 while (!(n instanceof ModelNode));
  return ancestors;
}

Fixed version (ground truth):
/** 
 * Get list of ancestors by traversing the parents of each node.
 * @return
 */
public List<Node> getAncestors(){
  List<Node> ancestors=new ArrayList<>();
  Node n=this;
  do {
    ancestors.add(n);
    n=n.getParent();
  }
 while (!(n instanceof ModelNode));
  return ancestors;
}