nus-yam/ex-repair huggingface dataset:
Program: 136051
Project: 136051
Buggy source:
public final void collectPrimedLocs(SemanticNode pred,Context c,ObjLongTable tbl){
switch (pred.getKind()) {
case OpApplKind:
{
      OpApplNode pred1=(OpApplNode)pred;
      this.collectPrimedLocsAppl(pred1,c,tbl);
      return;
    }
case LetInKind:
{
    LetInNode pred1=(LetInNode)pred;
    this.collectPrimedLocs(pred1.getBody(),c,tbl);
    return;
  }
case SubstInKind:
{
  SubstInNode pred1=(SubstInNode)pred;
  Subst[] subs=pred1.getSubsts();
  Context c1=c;
  for (int i=0; i < subs.length; i++) {
    Subst sub=subs[i];
    c1=c1.cons(sub.getOp(),this.getVal(sub.getExpr(),c,true));
  }
  this.collectPrimedLocs(pred1.getBody(),c,tbl);
  return;
}
case LabelKind:
{
LabelNode pred1=(LabelNode)pred;
this.collectPrimedLocs(pred1.getBody(),c,tbl);
return;
}
}
}

Fixed version (ground truth):
public final void collectPrimedLocs(SemanticNode pred,Context c,ObjLongTable tbl){
switch (pred.getKind()) {
case OpApplKind:
{
      OpApplNode pred1=(OpApplNode)pred;
      this.collectPrimedLocsAppl(pred1,c,tbl);
      return;
    }
case LetInKind:
{
    LetInNode pred1=(LetInNode)pred;
    this.collectPrimedLocs(pred1.getBody(),c,tbl);
    return;
  }
case SubstInKind:
{
  SubstInNode pred1=(SubstInNode)pred;
  Subst[] subs=pred1.getSubsts();
  Context c1=c;
  for (int i=0; i < subs.length; i++) {
    Subst sub=subs[i];
    c1=c1.cons(sub.getOp(),this.getVal(sub.getExpr(),c,true));
  }
  this.collectPrimedLocs(pred1.getBody(),c,tbl);
  return;
}
case APSubstInKind:
{
APSubstInNode pred1=(APSubstInNode)pred;
Subst[] subs=pred1.getSubsts();
Context c1=c;
for (int i=0; i < subs.length; i++) {
  Subst sub=subs[i];
  c1=c1.cons(sub.getOp(),this.getVal(sub.getExpr(),c,true));
}
this.collectPrimedLocs(pred1.getBody(),c,tbl);
return;
}
case LabelKind:
{
LabelNode pred1=(LabelNode)pred;
this.collectPrimedLocs(pred1.getBody(),c,tbl);
return;
}
}
}
Program: 136054
Project: 136054
Buggy source:
/** 
 * This method only returns an approximation of the level of the expression.  The "real" level is at most the return value. Adding <name, ValOne> to the context means that there is no need to compute level for name. Note that this method does not work if called on a part of an EXCEPT expression.
 */
public final int getLevelBound(SemanticNode expr,Context c){
switch (expr.getKind()) {
case OpApplKind:
{
      OpApplNode expr1=(OpApplNode)expr;
      return this.getLevelBoundAppl(expr1,c);
    }
case LetInKind:
{
    LetInNode expr1=(LetInNode)expr;
    OpDefNode[] letDefs=expr1.getLets();
    int letLen=letDefs.length;
    Context c1=c;
    int level=0;
    for (int i=0; i < letLen; i++) {
      OpDefNode opDef=letDefs[i];
      level=Math.max(level,this.getLevelBound(opDef.getBody(),c1));
      c1=c1.cons(opDef,ValOne);
    }
    return Math.max(level,this.getLevelBound(expr1.getBody(),c1));
  }
case SubstInKind:
{
  SubstInNode expr1=(SubstInNode)expr;
  Subst[] subs=expr1.getSubsts();
  int slen=subs.length;
  Context c1=c;
  for (int i=0; i < slen; i++) {
    Subst sub=subs[i];
    c1=c1.cons(sub.getOp(),this.getVal(sub.getExpr(),c,true));
  }
  return this.getLevelBound(expr1.getBody(),c1);
}
case LabelKind:
{
LabelNode expr1=(LabelNode)expr;
return this.getLevelBound(expr1.getBody(),c);
}
default :
{
return 0;
}
}
}

Fixed version (ground truth):
/** 
 * This method only returns an approximation of the level of the expression.  The "real" level is at most the return value. Adding <name, ValOne> to the context means that there is no need to compute level for name. Note that this method does not work if called on a part of an EXCEPT expression.
 */
public final int getLevelBound(SemanticNode expr,Context c){
switch (expr.getKind()) {
case OpApplKind:
{
      OpApplNode expr1=(OpApplNode)expr;
      return this.getLevelBoundAppl(expr1,c);
    }
case LetInKind:
{
    LetInNode expr1=(LetInNode)expr;
    OpDefNode[] letDefs=expr1.getLets();
    int letLen=letDefs.length;
    Context c1=c;
    int level=0;
    for (int i=0; i < letLen; i++) {
      OpDefNode opDef=letDefs[i];
      level=Math.max(level,this.getLevelBound(opDef.getBody(),c1));
      c1=c1.cons(opDef,ValOne);
    }
    return Math.max(level,this.getLevelBound(expr1.getBody(),c1));
  }
case SubstInKind:
{
  SubstInNode expr1=(SubstInNode)expr;
  Subst[] subs=expr1.getSubsts();
  int slen=subs.length;
  Context c1=c;
  for (int i=0; i < slen; i++) {
    Subst sub=subs[i];
    c1=c1.cons(sub.getOp(),this.getVal(sub.getExpr(),c,true));
  }
  return this.getLevelBound(expr1.getBody(),c1);
}
case APSubstInKind:
{
APSubstInNode expr1=(APSubstInNode)expr;
Subst[] subs=expr1.getSubsts();
int slen=subs.length;
Context c1=c;
for (int i=0; i < slen; i++) {
  Subst sub=subs[i];
  c1=c1.cons(sub.getOp(),this.getVal(sub.getExpr(),c,true));
}
return this.getLevelBound(expr1.getBody(),c1);
}
case LabelKind:
{
LabelNode expr1=(LabelNode)expr;
return this.getLevelBound(expr1.getBody(),c);
}
default :
{
return 0;
}
}
}
Program: 136056
Project: 136056
Buggy source:
public boolean canFinish(){
  return (assignmentPage.isCurrentPage() && !assignmentPage.isTypeInputPossible()) || !assignmentPage.isCurrentPage();
}

Fixed version (ground truth):
/** 
 * This returns whether the Finish button should be enabled. In order for this to be evaluated, getContainer().updateButtons() must be called by the page whose buttons are to be updated. For this particular wizard, that page is a AssignmentWizardPage. Within the method createControl a listener is added to the text field which calls updateButtons() whenever the input text is modified.
 */
public boolean canFinish(){
  String inputText=assignmentPage.getInputText();
  return (assignmentPage.isCurrentPage() && !assignmentPage.isTypeInputPossible() && inputText != null && inputText.trim().length() != 0) || !assignmentPage.isCurrentPage();
}
Program: 136057
Project: 136057
Buggy source:
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NULL);
  GridLayout layout=new GridLayout(1,false);
  container.setLayout(layout);
  sourceViewer=FormHelper.createSourceViewer(container,SWT.BORDER | SWT.MULTI | SWT.H_SCROLL| SWT.V_SCROLL);
  GridData gd=new GridData(SWT.CENTER,SWT.CENTER,true,true);
  gd.heightHint=200;
  gd.widthHint=400;
  gd.grabExcessHorizontalSpace=true;
  gd.grabExcessVerticalSpace=true;
  StyledText control=sourceViewer.getTextWidget();
  control.setEditable(true);
  control.setLayoutData(gd);
  if (this.document == null) {
    this.document=new Document();
  }
  sourceViewer.setDocument(this.getDocument());
  setControl(container);
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NULL);
  GridLayout layout=new GridLayout(1,false);
  container.setLayout(layout);
  sourceViewer=FormHelper.createSourceViewer(container,SWT.BORDER | SWT.MULTI | SWT.H_SCROLL| SWT.V_SCROLL);
  GridData gd=new GridData(SWT.CENTER,SWT.CENTER,true,true);
  gd.heightHint=200;
  gd.widthHint=400;
  gd.grabExcessHorizontalSpace=true;
  gd.grabExcessVerticalSpace=true;
  StyledText control=sourceViewer.getTextWidget();
  control.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      getContainer().updateButtons();
    }
  }
);
  control.setEditable(true);
  control.setLayoutData(gd);
  if (this.document == null) {
    this.document=new Document();
  }
  sourceViewer.setDocument(this.getDocument());
  setControl(container);
}
Program: 136058
Project: 136058
Buggy source:
/** 
 * Create the content for a single source element
 * @return a list with at most one String[] element
 * @throws CoreException 
 */
public static List createSourceContent(String propertyName,String labelingScheme,ILaunchConfiguration config) throws CoreException {
  Vector result=new Vector();
  String value=config.getAttribute(propertyName,EMPTY_STRING);
  if (EMPTY_STRING.equals(value)) {
    return result;
  }
  String identifier=getValidIdentifier(labelingScheme);
  StringBuffer buffer=new StringBuffer();
  buffer.append(identifier).append(DEFINES_CR);
  buffer.append(value);
  result.add(new String[]{identifier,buffer.toString()});
  return result;
}

Fixed version (ground truth):
/** 
 * Create the content for a single source element
 * @return a list with at most one String[] element
 * @throws CoreException 
 */
public static List createSourceContent(String propertyName,String labelingScheme,ILaunchConfiguration config) throws CoreException {
  Vector result=new Vector();
  String value=config.getAttribute(propertyName,EMPTY_STRING);
  if (value.trim().length() == 0) {
    return result;
  }
  String identifier=getValidIdentifier(labelingScheme);
  StringBuffer buffer=new StringBuffer();
  buffer.append(identifier).append(DEFINES_CR);
  buffer.append(value);
  result.add(new String[]{identifier,buffer.toString()});
  return result;
}
Program: 136059
Project: 136059
Buggy source:
/** 
 * New definitions are added to the _MC.tla file only
 * @param elements
 */
public void addNewDefinitions(String definitions,String attributeName){
  if (definitions.length() == 0) {
    return;
  }
  tlaBuffer.append(COMMENT).append("String_Node_Str").append(ATTRIBUTE).append(attributeName).append(CR);
  tlaBuffer.append(definitions).append(CR).append(SEP).append(CR);
}

Fixed version (ground truth):
/** 
 * New definitions are added to the _MC.tla file only
 * @param elements
 */
public void addNewDefinitions(String definitions,String attributeName){
  if (definitions.trim().length() == 0) {
    return;
  }
  tlaBuffer.append(COMMENT).append("String_Node_Str").append(ATTRIBUTE).append(attributeName).append(CR);
  tlaBuffer.append(definitions).append(CR).append(SEP).append(CR);
}
Program: 136062
Project: 136062
Buggy source:
TLCSequenceVariableValue(List values){
  this.value=values;
  this.elements=this.innerGetElements();
}

Fixed version (ground truth):
TLCSequenceVariableValue(List values){
  this.value=values;
  this.elements=this.innerGetElements();
  elementValues=new TLCVariableValue[elements.length];
  for (int i=0; i < elements.length; i++) {
    elementValues[i]=(TLCVariableValue)elements[i].getValue();
  }
}
Program: 136063
Project: 136063
Buggy source:
/** 
 * LL BUG  Calling toSimpleString on a sequence <<a, b>> is producing  <<1:>a, 2:>b>>.  I think that in the following, getElements  should be returning an array of TLCVariableValue objects.  I have no idea what I was doing, but it looks like the code for getElements() here should essentially be the  same as for TLCSetVariableValue.
 * @return
 */
public TLCFcnElementVariableValue[] getElements(){
  return elements;
}

Fixed version (ground truth):
public TLCFcnElementVariableValue[] getElements(){
  return elements;
}
Program: 136064
Project: 136064
Buggy source:
public String toSimpleString(){
  TLCVariableValue[] elements=getElements();
  return arrayToSimpleStringBuffer(elements,DELIMETERS).toString();
}

Fixed version (ground truth):
public String toSimpleString(){
  return arrayToSimpleStringBuffer(elementValues,DELIMETERS).toString();
}
Program: 136065
Project: 136065
Buggy source:
public void onDone(){
  this.setCurrentStatus(NOT_RUNNING);
  informPresenter(ITLCModelLaunchDataPresenter.CURRENT_STATUS);
  isDone=true;
}

Fixed version (ground truth):
public void onDone(){
  if (lastDetectedError != null) {
    this.errors.add(lastDetectedError);
    informPresenter(ITLCModelLaunchDataPresenter.ERRORS);
  }
  this.setCurrentStatus(NOT_RUNNING);
  informPresenter(ITLCModelLaunchDataPresenter.CURRENT_STATUS);
  isDone=true;
}
Program: 136066
Project: 136066
Buggy source:
/** 
 * Resets the values to defaults
 */
private void initialize(){
  isDone=false;
  isTLCStarted=false;
  errors=new Vector();
  ModelHelper.removeModelProblemMarkers(this.config,ModelHelper.TLC_MODEL_ERROR_MARKER_TLC);
  coverageInfo=new Vector();
  progressInformation=new Vector();
  startTimestamp="String_Node_Str";
  finishTimestamp="String_Node_Str";
  coverageTimestamp="String_Node_Str";
  progressOutput=new Document(NO_OUTPUT_AVAILABLE);
  userOutput=new Document(NO_OUTPUT_AVAILABLE);
}

Fixed version (ground truth):
/** 
 * Resets the values to defaults
 */
private void initialize(){
  isDone=false;
  isTLCStarted=false;
  errors=new Vector();
  ModelHelper.removeModelProblemMarkers(this.config,ModelHelper.TLC_MODEL_ERROR_MARKER_TLC);
  coverageInfo=new Vector();
  progressInformation=new Vector();
  startTimestamp="String_Node_Str";
  finishTimestamp="String_Node_Str";
  lastCheckpointTimeStamp="String_Node_Str";
  coverageTimestamp="String_Node_Str";
  progressOutput=new Document(NO_OUTPUT_AVAILABLE);
  userOutput=new Document(NO_OUTPUT_AVAILABLE);
}
Program: 136067
Project: 136067
Buggy source:
/** 
 * Reinitialize the fields has to be run in the UI thread
 */
private synchronized void reinit(){
  this.startTimestampText.setText("String_Node_Str");
  this.finishTimestampText.setText("String_Node_Str");
  this.errorStatusHyperLink.setText(TLCModelLaunchDataProvider.NO_ERRORS);
  this.coverage.setInput(new Vector());
  this.stateSpace.setInput(new Vector());
  this.progressOutput.setDocument(new Document(TLCModelLaunchDataProvider.NO_OUTPUT_AVAILABLE));
  this.userOutput.setDocument(new Document(TLCModelLaunchDataProvider.NO_OUTPUT_AVAILABLE));
}

Fixed version (ground truth):
/** 
 * Reinitialize the fields has to be run in the UI thread
 */
private synchronized void reinit(){
  this.startTimestampText.setText("String_Node_Str");
  this.finishTimestampText.setText("String_Node_Str");
  this.lastCheckpointTimeText.setText("String_Node_Str");
  this.errorStatusHyperLink.setText(TLCModelLaunchDataProvider.NO_ERRORS);
  this.coverage.setInput(new Vector());
  this.stateSpace.setInput(new Vector());
  this.progressOutput.setDocument(new Document(TLCModelLaunchDataProvider.NO_OUTPUT_AVAILABLE));
  this.userOutput.setDocument(new Document(TLCModelLaunchDataProvider.NO_OUTPUT_AVAILABLE));
}
Program: 136068
Project: 136068
Buggy source:
/** 
 * Checks if checkpoint information changed 
 */
private void updateCheckpoints(){
  IResource[] checkpoints=null;
  try {
    checkpoints=ModelHelper.getCheckpoints(getConfig());
  }
 catch (  CoreException e) {
    TLCUIActivator.logError("String_Node_Str",e);
  }
  if (checkpoints != null && checkpoints.length > 0) {
    this.checkpointIdText.setText(checkpoints[0].getName());
  }
 else {
    this.checkpointIdText.setText(EMPTY_STRING);
  }
}

Fixed version (ground truth):
/** 
 * Checks if checkpoint information changed 
 */
private void updateCheckpoints(){
  IResource[] checkpoints=null;
  try {
    checkpoints=ModelHelper.getCheckpoints(getConfig(),true);
  }
 catch (  CoreException e) {
    TLCUIActivator.logError("String_Node_Str",e);
  }
  if (checkpoints != null && checkpoints.length > 0) {
    this.checkpointIdText.setText(checkpoints[0].getName());
  }
 else {
    this.checkpointIdText.setText(EMPTY_STRING);
  }
}
Program: 136072
Project: 136072
Buggy source:
/** 
 * Checks whether the checkpoint files exist for a given model 
 * @param launchConfig
 * @return the array of checkpoint directories, sorted from last to first
 */
public static IResource[] getCheckpoints(ILaunchConfiguration config) throws CoreException {
  Pattern pattern=Pattern.compile("String_Node_Str");
  Vector checkpoints=new Vector();
  IFolder directory=getModelTargetDirectory(config);
  if (directory != null && directory.exists()) {
    IResource[] members=directory.members();
    for (int i=0; i < members.length; i++) {
      if (members[i].getType() == IResource.FOLDER) {
        Matcher matcher=pattern.matcher(members[i].getName());
        if (matcher.matches()) {
          if (((IFolder)members[i]).findMember(CHECKPOINT_QUEUE) != null && ((IFolder)members[i]).findMember(CHECKPOINT_VARS) != null && ((IFolder)members[i]).findMember(CHECKPOINT_STATES) != null) {
            checkpoints.add(members[i]);
          }
        }
      }
    }
  }
  IResource[] result=(IResource[])checkpoints.toArray(new IResource[checkpoints.size()]);
  Arrays.sort(result,new Comparator(){
    public int compare(    Object arg0,    Object arg1){
      return ((IResource)arg0).getName().compareTo(((IResource)arg1).getName());
    }
  }
);
  return result;
}

Fixed version (ground truth):
/** 
 * Checks whether the checkpoint files exist for a given model 
 * @param launchConfig
 * @return the array of checkpoint directories, sorted from last to first
 */
public static IResource[] getCheckpoints(ILaunchConfiguration config) throws CoreException {
  Pattern pattern=Pattern.compile("String_Node_Str");
  Vector checkpoints=new Vector();
  IFolder directory=getModelTargetDirectory(config);
  if (directory != null && directory.exists()) {
    directory.refreshLocal(IResource.DEPTH_ONE,null);
    IResource[] members=directory.members();
    for (int i=0; i < members.length; i++) {
      if (members[i].getType() == IResource.FOLDER) {
        Matcher matcher=pattern.matcher(members[i].getName());
        if (matcher.matches()) {
          members[i].refreshLocal(IResource.DEPTH_ONE,null);
          if (((IFolder)members[i]).findMember(CHECKPOINT_QUEUE) != null && ((IFolder)members[i]).findMember(CHECKPOINT_VARS) != null && ((IFolder)members[i]).findMember(CHECKPOINT_STATES) != null) {
            checkpoints.add(members[i]);
          }
        }
      }
    }
  }
  IResource[] result=(IResource[])checkpoints.toArray(new IResource[checkpoints.size()]);
  Arrays.sort(result,new Comparator(){
    public int compare(    Object arg0,    Object arg1){
      return ((IResource)arg0).getName().compareTo(((IResource)arg1).getName());
    }
  }
);
  return result;
}
Program: 136075
Project: 136075
Buggy source:
protected Assignment doEditFormula(Assignment formula){
  if (formula == null) {
    FilteredDefinitionSelectionDialog definitionSelection=new FilteredDefinitionSelectionDialog(this.getSection().getShell(),false,ToolboxHandle.getCurrentSpec().getValidRootModule());
    definitionSelection.setTitle("String_Node_Str");
    definitionSelection.setMessage("String_Node_Str");
    definitionSelection.setInitialPattern("String_Node_Str");
    if (Window.OK == definitionSelection.open()) {
      OpDefNode result=(OpDefNode)(definitionSelection.getResult())[0];
      formula=new Assignment(result.getName().toString(),Assignment.getArrayOfEmptyStrings(result.getSource().getNumberOfArgs()),"String_Node_Str");
    }
 else {
      return null;
    }
  }
  AssignmentWizard wizard=new AssignmentWizard(getSection().getText(),getSection().getDescription(),(Assignment)formula,AssignmentWizard.NONE,AssignmentWizardPage.DEF_OVERRIDE_WIZARD_ID,"String_Node_Str");
  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){
  if (formula == null) {
    FilteredDefinitionSelectionDialog definitionSelection=new FilteredDefinitionSelectionDialog(this.getSection().getShell(),false,ToolboxHandle.getCurrentSpec().getValidRootModule());
    definitionSelection.setTitle("String_Node_Str");
    definitionSelection.setMessage("String_Node_Str");
    definitionSelection.setInitialPattern("String_Node_Str");
    if (Window.OK == definitionSelection.open()) {
      OpDefNode result=(OpDefNode)(definitionSelection.getResult())[0];
      formula=new Assignment(result.getName().toString(),Assignment.getArrayOfEmptyStrings(result.getSource().getNumberOfArgs()),"String_Node_Str");
    }
 else {
      return null;
    }
  }
  OpDefNode opDefNode=(OpDefNode)ModelHelper.getOpDefNode(formula.getLabel());
  if (opDefNode.getSource().getNumberOfArgs() != formula.getParams().length) {
    String[] newParams=new String[opDefNode.getSource().getNumberOfArgs()];
    for (int i=0; i < newParams.length; i++) {
      newParams[i]="String_Node_Str";
    }
    formula.setParams(newParams);
  }
  AssignmentWizard wizard=new AssignmentWizard(getSection().getText(),getSection().getDescription(),(Assignment)formula,AssignmentWizard.NONE,AssignmentWizardPage.DEF_OVERRIDE_WIZARD_ID,"String_Node_Str");
  WizardDialog dialog=new WizardDialog(getTableViewer().getTable().getShell(),wizard);
  dialog.setHelpAvailable(true);
  if (Window.OK == dialog.open()) {
    return wizard.getFormula();
  }
 else {
    return null;
  }
}
Program: 136077
Project: 136077
Buggy source:
/** 
 * Create the partial state space for given starting state up to the given depth or the number of states.
 */
public final boolean runTLC(int depth) throws Exception {
  if (this.cancellationFlag) {
    return false;
  }
  if (depth < 2) {
    return true;
  }
  IdThread[] workers=startWorkers(this,depth);
  int count=TLCGlobals.coverageInterval / TLCGlobals.progressInterval;
  runTLCPreLoop();
synchronized (this) {
    this.wait(30000);
  }
  while (!this.cancellationFlag) {
    long now=System.currentTimeMillis();
    if (now - this.lastChkpt >= TLCGlobals.chkptDuration) {
      if (!this.doPeriodicWork()) {
        return false;
      }
      this.lastChkpt=now;
    }
synchronized (this) {
      if (!this.done) {
        runTLCContinueDoing(count,depth);
        if (count == 0) {
          count=TLCGlobals.coverageInterval / TLCGlobals.progressInterval;
        }
 else {
          count--;
        }
      }
      if (this.done)       break;
    }
  }
  for (int i=0; i < workers.length; i++) {
    workers[i].join();
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Create the partial state space for given starting state up to the given depth or the number of states.
 */
public final boolean runTLC(int depth) throws Exception {
  if (this.cancellationFlag) {
    return false;
  }
  if (depth < 2) {
    return true;
  }
  IdThread[] workers=startWorkers(this,depth);
  int count=TLCGlobals.coverageInterval / TLCGlobals.progressInterval;
  runTLCPreLoop();
  for (int i=0; i < 10; i++) {
synchronized (this) {
      if (this.done) {
        break;
      }
      this.wait(3000);
    }
  }
  while (!this.cancellationFlag) {
    long now=System.currentTimeMillis();
    if (now - this.lastChkpt >= TLCGlobals.chkptDuration) {
      if (!this.doPeriodicWork()) {
        return false;
      }
      this.lastChkpt=now;
    }
synchronized (this) {
      if (!this.done) {
        runTLCContinueDoing(count,depth);
        if (count == 0) {
          count=TLCGlobals.coverageInterval / TLCGlobals.progressInterval;
        }
 else {
          count--;
        }
      }
      if (this.done)       break;
    }
  }
  for (int i=0; i < workers.length; i++) {
    workers[i].join();
  }
  return true;
}
Program: 136078
Project: 136078
Buggy source:
/** 
 * Create the partial state space for given starting state up to the given depth or the number of states.
 */
public final boolean runTLC(int depth) throws Exception {
  if (this.cancellationFlag) {
    return false;
  }
  if (depth < 2) {
    return true;
  }
  IdThread[] workers=startWorkers(this,depth);
  int count=TLCGlobals.coverageInterval / TLCGlobals.progressInterval;
  runTLCPreLoop();
synchronized (this) {
    this.wait(30000);
  }
  while (!this.cancellationFlag) {
    long now=System.currentTimeMillis();
    if (now - this.lastChkpt >= TLCGlobals.chkptDuration) {
      if (!this.doPeriodicWork()) {
        return false;
      }
      this.lastChkpt=now;
    }
synchronized (this) {
      if (!this.done) {
        runTLCContinueDoing(count,depth);
      }
      if (this.done)       break;
    }
  }
  for (int i=0; i < workers.length; i++) {
    workers[i].join();
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Create the partial state space for given starting state up to the given depth or the number of states.
 */
public final boolean runTLC(int depth) throws Exception {
  if (this.cancellationFlag) {
    return false;
  }
  if (depth < 2) {
    return true;
  }
  IdThread[] workers=startWorkers(this,depth);
  int count=TLCGlobals.coverageInterval / TLCGlobals.progressInterval;
  runTLCPreLoop();
synchronized (this) {
    this.wait(30000);
  }
  while (!this.cancellationFlag) {
    long now=System.currentTimeMillis();
    if (now - this.lastChkpt >= TLCGlobals.chkptDuration) {
      if (!this.doPeriodicWork()) {
        return false;
      }
      this.lastChkpt=now;
    }
synchronized (this) {
      if (!this.done) {
        runTLCContinueDoing(count,depth);
        if (count == 0) {
          count=TLCGlobals.coverageInterval / TLCGlobals.progressInterval;
        }
 else {
          count--;
        }
      }
      if (this.done)       break;
    }
  }
  for (int i=0; i < workers.length; i++) {
    workers[i].join();
  }
  return true;
}
Program: 136079
Project: 136079
Buggy source:
/** 
 * Process calculation 
 * @param count
 * @param depth
 * @throws Exception
 */
protected void runTLCContinueDoing(int count,int depth) throws Exception {
  int level=this.trace.getLevel();
  MP.printMessage(EC.TLC_PROGRESS_STATS,new String[]{String.valueOf(level),String.valueOf(this.numOfGenStates),String.valueOf(this.theFPSet.size()),String.valueOf(this.theStateQueue.size())});
  if (level > depth) {
    this.theStateQueue.finishAll();
    this.done=true;
  }
 else {
    if (count == 0) {
      super.reportCoverage(this.workers);
      count=TLCGlobals.coverageInterval / TLCGlobals.progressInterval;
    }
 else {
      count--;
    }
    this.wait(TLCGlobals.progressInterval);
  }
}

Fixed version (ground truth):
/** 
 * Process calculation 
 * @param count
 * @param depth
 * @throws Exception
 */
protected void runTLCContinueDoing(int count,int depth) throws Exception {
  int level=this.trace.getLevel();
  MP.printMessage(EC.TLC_PROGRESS_STATS,new String[]{String.valueOf(level),String.valueOf(this.numOfGenStates),String.valueOf(this.theFPSet.size()),String.valueOf(this.theStateQueue.size())});
  if (level > depth) {
    this.theStateQueue.finishAll();
    this.done=true;
  }
 else {
    if (count == 0) {
      super.reportCoverage(this.workers);
    }
    this.wait(TLCGlobals.progressInterval);
  }
}
Program: 136080
Project: 136080
Buggy source:
public void resourceChanged(IResourceChangeEvent event){
  IResourceDelta delta=event.getDelta();
  if (delta != null) {
    OutOfBuildSpecModulesGatheringDeltaVisitor moduleFinder=new OutOfBuildSpecModulesGatheringDeltaVisitor();
    try {
      delta.accept(moduleFinder);
      List modules=moduleFinder.getModules();
      if (!modules.isEmpty()) {
        getSpecManager().getSpecLoaded().setStatus(IParseConstants.UNPARSED);
      }
    }
 catch (    CoreException e) {
      Activator.logError("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public void resourceChanged(IResourceChangeEvent event){
  IResourceDelta delta=event.getDelta();
  if (delta != null) {
    OutOfBuildSpecModulesGatheringDeltaVisitor moduleFinder=new OutOfBuildSpecModulesGatheringDeltaVisitor();
    try {
      if (Activator.isSpecManagerInstantiated()) {
        delta.accept(moduleFinder);
        List modules=moduleFinder.getModules();
        if (!modules.isEmpty()) {
          getSpecManager().getSpecLoaded().setStatus(IParseConstants.UNPARSED);
        }
      }
    }
 catch (    CoreException e) {
      Activator.logError("String_Node_Str",e);
    }
  }
}
Program: 136083
Project: 136083
Buggy source:
/** 
 * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
 */
public boolean visit(IResourceDelta delta) throws CoreException {
  return false;
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
 */
public boolean visit(IResourceDelta delta) throws CoreException {
  IResource resource=delta.getResource();
  if (resource.exists() && IResource.FILE == resource.getType()) {
    if (ResourceHelper.isModule(resource)) {
      if (spec == null) {
        modules.add(resource);
      }
 else       if (resource.getPersistentProperty(TLAParsingBuilderConstants.LAST_BUILT) == null) {
        if (spec.getStatus() < IParseConstants.PARSED && spec.getStatus() > IParseConstants.UNKNOWN) {
          modules.add(resource);
        }
      }
 else       if (Long.parseLong(resource.getPersistentProperty(TLAParsingBuilderConstants.LAST_BUILT)) < resource.getLocalTimeStamp() && (dependancyTable.containsKey(resource.getName()) || (spec.getStatus() < IParseConstants.PARSED && spec.getStatus() > IParseConstants.UNPARSED))) {
        modules.add(resource);
      }
    }
  }
  return true;
}
Program: 136084
Project: 136084
Buggy source:
public OutOfBuildSpecModulesGatheringDeltaVisitor(){
  String specRootFileName=spec.getRootFile().getName();
  List dependancyList=Activator.getModuleDependencyStorage().getListOfExtendedModules(specRootFileName);
  dependancyTable=new Hashtable(dependancyList.size());
  dependancyTable.put(specRootFileName,specRootFileName);
  Iterator iterator=dependancyList.iterator();
  while (iterator.hasNext()) {
    String moduleName=(String)iterator.next();
    dependancyTable.put(moduleName,moduleName);
  }
}

Fixed version (ground truth):
public OutOfBuildSpecModulesGatheringDeltaVisitor(){
  if (Activator.isSpecManagerInstantiated()) {
    spec=Activator.getSpecManager().getSpecLoaded();
    String specRootFileName=spec.getRootFile().getName();
    List dependancyList=Activator.getModuleDependencyStorage().getListOfExtendedModules(specRootFileName);
    dependancyTable=new Hashtable(dependancyList.size());
    dependancyTable.put(specRootFileName,specRootFileName);
    Iterator iterator=dependancyList.iterator();
    while (iterator.hasNext()) {
      String moduleName=(String)iterator.next();
      dependancyTable.put(moduleName,moduleName);
    }
  }
}
Program: 136086
Project: 136086
Buggy source:
public void resourceChanged(IResourceChangeEvent event){
  IResourceDelta delta=event.getDelta();
  ChangedSpecModulesGatheringDeltaVisitor visitor=new ChangedSpecModulesGatheringDeltaVisitor(){
    public IResource getModel(){
      return ModelEditor.this.getConfig().getFile();
    }
  }
;
  try {
    delta.accept(visitor);
    List modules=visitor.getModules();
    if (!modules.isEmpty()) {
      helper.resetSpecNames();
      UIHelper.runUIAsync(validateRunable);
      return;
    }
    if (visitor.isModelChanged()) {
      UIHelper.runUIAsync(new Runnable(){
        public void run(){
          for (int i=0; i < getPageCount(); i++) {
            BasicFormPage page=(BasicFormPage)pages.get(i);
            page.resetAllMessages(true);
          }
          handleProblemMarkers(true);
        }
      }
);
    }
  }
 catch (  CoreException e) {
    TLCUIActivator.logError("String_Node_Str",e);
    return;
  }
}

Fixed version (ground truth):
public void resourceChanged(IResourceChangeEvent event){
  IResourceDelta delta=event.getDelta();
  ChangedSpecModulesGatheringDeltaVisitor visitor=new ChangedSpecModulesGatheringDeltaVisitor(){
    public IResource getModel(){
      return ModelEditor.this.getConfig().getFile();
    }
  }
;
  try {
    delta.accept(visitor);
    List modules=visitor.getModules();
    if (!modules.isEmpty() || visitor.isModelChanged()) {
      helper.resetSpecNames();
      validateRunable.switchToErrorPage=visitor.isModelChanged();
      UIHelper.runUIAsync(validateRunable);
      return;
    }
  }
 catch (  CoreException e) {
    TLCUIActivator.logError("String_Node_Str",e);
    return;
  }
}
Program: 136087
Project: 136087
Buggy source:
/** 
 * Deletes messages (with bubbles) from the current page
 * @param applyChange iff set to <code>true</code> makes the changes visible
 */
public void resetAllMessages(boolean applyChange){
  getManagedForm().getMessageManager().setAutoUpdate(false);
  getManagedForm().getMessageManager().removeAllMessages();
  setComplete(true);
  getManagedForm().getMessageManager().setAutoUpdate(applyChange);
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Deletes messages (with bubbles) from the current page
 * @param applyChange iff set to <code>true</code> makes the changes visible
 */
public void resetAllMessages(boolean applyChange){
  getManagedForm().getMessageManager().setAutoUpdate(false);
  getManagedForm().getMessageManager().removeAllMessages();
  setComplete(true);
  getManagedForm().getMessageManager().setAutoUpdate(applyChange);
}
Program: 136088
Project: 136088
Buggy source:
public void validate(){
  page.validate();
}

Fixed version (ground truth):
public void validate(){
  page.validatePage(false);
}
Program: 136089
Project: 136089
Buggy source:
public void validate(){
  page.validate();
}

Fixed version (ground truth):
public void validate(){
  page.validatePage(false);
}
Program: 136090
Project: 136090
Buggy source:
/** 
 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor) This method saves the model even if the spec is not parsed.  This is probably a good idea, since the user may want to quit in the middle of his work without losing what he's done to the model.
 */
public void doSave(IProgressMonitor monitor){
  this.commitPages(monitor,true);
  ModelHelper.doSaveConfigurationCopy(configurationCopy);
  ModelHelper.removeModelProblemMarkers(configurationCopy);
  boolean revalidate=TLCUIActivator.getDefault().getPreferenceStore().getBoolean(ITLCPreferenceConstants.I_TLC_REVALIDATE_ON_MODIFY);
  if (revalidate) {
    launchModel(TLCModelLaunchDelegate.MODE_GENERATE,false);
  }
  this.editorDirtyStateChanged();
}

Fixed version (ground truth):
/** 
 * This method saves the model even if the spec is not parsed.  This is probably a good idea, since the user may want to quit in the middle of his work without losing what he's done to the model.
 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
 */
public void doSave(IProgressMonitor monitor){
  this.commitPages(monitor,true);
  ModelHelper.doSaveConfigurationCopy(configurationCopy);
  ModelHelper.removeModelProblemMarkers(configurationCopy);
  boolean revalidate=TLCUIActivator.getDefault().getPreferenceStore().getBoolean(ITLCPreferenceConstants.I_TLC_REVALIDATE_ON_MODIFY);
  if (revalidate) {
    launchModel(TLCModelLaunchDelegate.MODE_GENERATE,false);
  }
  this.editorDirtyStateChanged();
}
Program: 136091
Project: 136091
Buggy source:
/** 
 * Simple editor constructor
 */
public ModelEditor(){
  helper=new SemanticHelper();
  pagesToAdd=new BasicFormPage[]{new MainModelPage(this),new AdvancedModelPage(this),new ResultPage(this)};
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Simple editor constructor
 */
public ModelEditor(){
  helper=new SemanticHelper();
  pagesToAdd=new BasicFormPage[]{new MainModelPage(this),new AdvancedModelPage(this),new ResultPage(this)};
}
Program: 136095
Project: 136095
Buggy source:
/** 
 * @param name
 */
public TranslatorJob(IResource fileToBuild){
  super("String_Node_Str");
  this.translator=new Translator();
  this.fileToBuild=fileToBuild;
  this.callParams=new Vector();
  Activator.logDebug("String_Node_Str" + fileToBuild.getLocation().toOSString());
  boolean hasPcalAlg=false;
  String[] params;
  try {
    hasPcalAlg=((Boolean)fileToBuild.getSessionProperty(ResourceHelper.getQName(IPreferenceConstants.CONTAINS_PCAL_ALGORITHM))).booleanValue();
    String paramString=((String)fileToBuild.getProject().getPersistentProperty(ResourceHelper.getQName(IPreferenceConstants.PCAL_CAL_PARAMS)));
    if (paramString != null) {
      params=paramString.split("String_Node_Str");
    }
 else {
      params=new String[0];
    }
  }
 catch (  CoreException e1) {
    e1.printStackTrace();
    params=new String[0];
  }
  if (!hasPcalAlg) {
    Activator.logDebug("String_Node_Str");
  }
 else {
    Activator.logDebug("String_Node_Str");
  }
  for (int i=0; i < params.length; i++) {
    if (params[i] != null && !params[i].equals("String_Node_Str")) {
      callParams.add(params[i]);
    }
  }
  callParams.add(fileToBuild.getLocation().toOSString());
}

Fixed version (ground truth):
/** 
 * @param name
 */
public TranslatorJob(IResource fileToBuild){
  super("String_Node_Str");
  this.translator=new Translator();
  this.fileToBuild=fileToBuild;
  this.callParams=new Vector();
  Activator.logDebug("String_Node_Str" + fileToBuild.getLocation().toOSString());
  boolean hasPcalAlg=false;
  String[] params;
  Object prop;
  try {
    prop=fileToBuild.getSessionProperty(ResourceHelper.getQName(IPreferenceConstants.CONTAINS_PCAL_ALGORITHM));
    if (prop != null) {
      hasPcalAlg=((Boolean)prop).booleanValue();
    }
    IPreferenceStore projectPreferenceStore=PreferenceStoreHelper.getProjectPreferenceStore(fileToBuild.getProject());
    String paramString=projectPreferenceStore.getString(IPreferenceConstants.PCAL_CAL_PARAMS);
    if (paramString != null) {
      params=paramString.split("String_Node_Str");
    }
 else {
      params=new String[0];
    }
  }
 catch (  CoreException e1) {
    Activator.logError("String_Node_Str",e1);
    params=new String[0];
  }
  if (!hasPcalAlg) {
    Activator.logDebug("String_Node_Str");
  }
 else {
    Activator.logDebug("String_Node_Str");
  }
  for (int i=0; i < params.length; i++) {
    if (params[i] != null && !params[i].equals("String_Node_Str")) {
      callParams.add(params[i]);
    }
  }
  callParams.add(fileToBuild.getLocation().toOSString());
}
Program: 136096
Project: 136096
Buggy source:
/** 
 * Retrieves preference store with the project scope
 * @return a store instance
 */
public static IPreferenceStore getProjectPreferenceStore(IProject project){
  ProjectScope scope=new ProjectScope(project);
  ScopedPreferenceStore store=new ScopedPreferenceStore(scope,Activator.getDefault().getBundle().getSymbolicName());
  return store;
}

Fixed version (ground truth):
/** 
 * Retrieves preference store with the project scope
 * @return a store instance
 */
public static IPreferenceStore getProjectPreferenceStore(IProject project){
  ProjectScope scope=new ProjectScope(project);
  ScopedPreferenceStore store=new ScopedPreferenceStore(scope,Activator.PLUGIN_ID);
  return store;
}
Program: 136099
Project: 136099
Buggy source:
/** 
 * Prints the stacktrace
 * @param code error code
 * @param params params
 * @param s1 
 * @param s2
 */
public final void printTrace(int errorCode,String[] parameters,TLCState s1,TLCState s2){
  MP.printError(errorCode,parameters);
  MP.printMessage(EC.TLC_BEHAVIOR_UP_TO_THIS_POINT);
  int idx=0;
  while (idx < this.curLevel) {
    StatePrinter.printState(this.stateStack[idx],++idx);
  }
  if (s2 != null) {
    StatePrinter.printState(s2,idx + 1);
  }
}

Fixed version (ground truth):
/** 
 * Prints the stacktrace
 * @param code error code
 * @param params params
 * @param s1 
 * @param s2
 */
public final void printTrace(int errorCode,String[] parameters,TLCState s1,TLCState s2){
  MP.printError(errorCode,parameters);
  MP.printError(EC.TLC_BEHAVIOR_UP_TO_THIS_POINT);
  int idx=0;
  while (idx < this.curLevel) {
    StatePrinter.printState(this.stateStack[idx],++idx);
  }
  if (s2 != null) {
    StatePrinter.printState(s2,idx + 1);
  }
}
Program: 136100
Project: 136100
Buggy source:
/** 
 * Prints out the simulation behavior, in case of an error. (unless we're at maximum depth, in which case don't!)
 */
public final void printBehavior(int errorCode,String[] parameters,TLCState state,int traceIdx){
  MP.printMessage(errorCode,parameters);
  if (this.traceDepth == Long.MAX_VALUE) {
    MP.printMessage(EC.TLC_ERROR_STATE);
    StatePrinter.printState(state);
  }
 else {
    MP.printMessage(EC.TLC_BEHAVIOR_UP_TO_THIS_POINT);
    TLCState lastState=null;
    for (int i=0; i < traceIdx; i++) {
      StatePrinter.printState(this.stateTrace[i],lastState,i + 1);
      lastState=this.stateTrace[i];
    }
    StatePrinter.printState(state,null,traceIdx + 1);
  }
  this.printSummary();
}

Fixed version (ground truth):
/** 
 * Prints out the simulation behavior, in case of an error. (unless we're at maximum depth, in which case don't!)
 */
public final void printBehavior(int errorCode,String[] parameters,TLCState state,int traceIdx){
  MP.printMessage(errorCode,parameters);
  if (this.traceDepth == Long.MAX_VALUE) {
    MP.printMessage(EC.TLC_ERROR_STATE);
    StatePrinter.printState(state);
  }
 else {
    MP.printError(EC.TLC_BEHAVIOR_UP_TO_THIS_POINT);
    TLCState lastState=null;
    for (int i=0; i < traceIdx; i++) {
      StatePrinter.printState(this.stateTrace[i],lastState,i + 1);
      lastState=this.stateTrace[i];
    }
    StatePrinter.printState(state,null,traceIdx + 1);
  }
  this.printSummary();
}
Program: 136101
Project: 136101
Buggy source:
/** 
 * Write out a sequence of states that reaches s2 from an initial state, according to the spec. s2 is a next state of s1.
 */
public synchronized final void printTrace(long loc1,TLCState s1,TLCState s2) throws IOException, WorkerException {
  MP.printMessage(EC.TLC_BEHAVIOR_UP_TO_THIS_POINT);
  TLCState lastState=null;
  TLCStateInfo[] prefix=this.getTrace(loc1,false);
  int idx=0;
  while (idx < prefix.length) {
    StatePrinter.printState(prefix[idx],lastState,idx + 1);
    lastState=prefix[idx].state;
    idx++;
  }
  TLCStateInfo sinfo;
  if (prefix.length == 0) {
    sinfo=this.tool.getState(s1.fingerPrint());
    if (sinfo == null) {
      MP.printError(EC.TLC_FAILED_TO_RECOVER_INIT);
      MP.printError(EC.TLC_BUG,"String_Node_Str");
      System.exit(1);
    }
  }
 else {
    TLCState s0=prefix[prefix.length - 1].state;
    sinfo=this.tool.getState(s1.fingerPrint(),s0);
    if (sinfo == null) {
      MP.printError(EC.TLC_FAILED_TO_RECOVER_INIT);
      MP.printError(EC.TLC_BUG,"String_Node_Str");
      StatePrinter.printState(s1);
      System.exit(1);
    }
  }
  if (s2 == null) {
    lastState=null;
  }
  StatePrinter.printState(sinfo,lastState,++idx);
  lastState=sinfo.state;
  if (s2 != null) {
    sinfo=this.tool.getState(s2,s1);
    if (sinfo == null) {
      MP.printError(EC.TLC_FAILED_TO_RECOVER_INIT);
      MP.printError(EC.TLC_BUG,"String_Node_Str");
      StatePrinter.printState(s2);
      System.exit(1);
    }
    StatePrinter.printState(sinfo,null,++idx);
  }
}

Fixed version (ground truth):
/** 
 * Write out a sequence of states that reaches s2 from an initial state, according to the spec. s2 is a next state of s1.
 */
public synchronized final void printTrace(long loc1,TLCState s1,TLCState s2) throws IOException, WorkerException {
  MP.printError(EC.TLC_BEHAVIOR_UP_TO_THIS_POINT);
  TLCState lastState=null;
  TLCStateInfo[] prefix=this.getTrace(loc1,false);
  int idx=0;
  while (idx < prefix.length) {
    StatePrinter.printState(prefix[idx],lastState,idx + 1);
    lastState=prefix[idx].state;
    idx++;
  }
  TLCStateInfo sinfo;
  if (prefix.length == 0) {
    sinfo=this.tool.getState(s1.fingerPrint());
    if (sinfo == null) {
      MP.printError(EC.TLC_FAILED_TO_RECOVER_INIT);
      MP.printError(EC.TLC_BUG,"String_Node_Str");
      System.exit(1);
    }
  }
 else {
    TLCState s0=prefix[prefix.length - 1].state;
    sinfo=this.tool.getState(s1.fingerPrint(),s0);
    if (sinfo == null) {
      MP.printError(EC.TLC_FAILED_TO_RECOVER_INIT);
      MP.printError(EC.TLC_BUG,"String_Node_Str");
      StatePrinter.printState(s1);
      System.exit(1);
    }
  }
  if (s2 == null) {
    lastState=null;
  }
  StatePrinter.printState(sinfo,lastState,++idx);
  lastState=sinfo.state;
  if (s2 != null) {
    sinfo=this.tool.getState(s2,s1);
    if (sinfo == null) {
      MP.printError(EC.TLC_FAILED_TO_RECOVER_INIT);
      MP.printError(EC.TLC_BUG,"String_Node_Str");
      StatePrinter.printState(s2);
      System.exit(1);
    }
    StatePrinter.printState(sinfo,null,++idx);
  }
}
Program: 136103
Project: 136103
Buggy source:
/** 
 * args: {markerId, attributeName} expectedValue: {value of the attribute}  
 */
public boolean test(Object receiver,String property,Object[] args,Object expectedValue){
  if ("String_Node_Str".equals(property)) {
    if (args.length > 0 && args[0] instanceof String) {
      String markerId=(String)args[0];
      String attributeName=null;
      if (args.length > 1 && args[1] instanceof String) {
        attributeName=(String)args[1];
      }
      if (receiver != null && receiver instanceof ILaunchConfiguration) {
        try {
          IMarker[] foundMarkers=((ILaunchConfiguration)receiver).getFile().findMarkers(markerId,true,IResource.DEPTH_INFINITE);
          if (attributeName != null) {
            for (int i=0; i < foundMarkers.length; i++) {
              Object value=foundMarkers[i].getAttribute(attributeName);
              if (!value.equals(expectedValue)) {
                return false;
              }
            }
            return true;
          }
 else {
            boolean isPresent=true;
            if (expectedValue != null && expectedValue instanceof Boolean) {
              isPresent=((Boolean)expectedValue).booleanValue();
            }
            if (isPresent) {
              return foundMarkers.length > 0;
            }
 else {
              return foundMarkers.length == 0;
            }
          }
        }
 catch (        CoreException e) {
          TLCActivator.logError("String_Node_Str",e);
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * args: {markerId, attributeName} expectedValue: {value of the attribute}  
 */
public boolean test(Object receiver,String property,Object[] args,Object expectedValue){
  if ("String_Node_Str".equals(property)) {
    if (args.length > 0 && args[0] instanceof String) {
      String markerId=(String)args[0];
      String attributeName=null;
      if (args.length > 1 && args[1] instanceof String) {
        attributeName=(String)args[1];
      }
      if (receiver != null && receiver instanceof ILaunchConfiguration) {
        try {
          IMarker[] foundMarkers=((ILaunchConfiguration)receiver).getFile().findMarkers(markerId,true,IResource.DEPTH_INFINITE);
          if (attributeName != null) {
            for (int i=0; i < foundMarkers.length; i++) {
              Object value=foundMarkers[i].getAttribute(attributeName);
              if (value == null || !value.equals(expectedValue)) {
                return false;
              }
            }
            return foundMarkers.length > 0;
          }
 else {
            boolean result;
            int expectedCount=-1;
            if (expectedValue != null && expectedValue instanceof Integer) {
              expectedCount=((Integer)expectedValue).intValue();
            }
            if (expectedCount == -1) {
              result=foundMarkers.length > 0;
            }
 else {
              result=foundMarkers.length == expectedCount;
            }
            return result;
          }
        }
 catch (        CoreException e) {
          TLCActivator.logError("String_Node_Str",e);
        }
      }
    }
  }
  return false;
}
Program: 136104
Project: 136104
Buggy source:
public static IntValue Times(IntValue x,IntValue y){
  int n1=x.val;
  int n2=y.val;
  long res=n1 * n2;
  if (-2147483648 > res || res > 2147483647) {
    throw new EvalException("String_Node_Str" + n1 + "String_Node_Str"+ n2);
  }
  return IntValue.gen((int)res);
}

Fixed version (ground truth):
public static IntValue Times(IntValue x,IntValue y){
  int n1=x.val;
  int n2=y.val;
  long res=((long)n1) * ((long)n2);
  if (-2147483648 > res || res > 2147483647) {
    throw new EvalException("String_Node_Str" + n1 + "String_Node_Str"+ n2);
  }
  return IntValue.gen((int)res);
}