nus-yam/ex-repair huggingface dataset:
Program: 133606
Project: 133606
Buggy source:
/** 
 * <p> This operation is used to check equality between the MatrixComponent and another MatrixComponent. It returns true if the MatrixComponents are equal and false if they are not. </p>
 * @param otherMatrixComponent <p> The TableComponent that should be checked for equality. </p>
 * @return <p>True if the TableComponents are equal, false if not </p>
 */
public boolean equals(MatrixComponent otherMatrixComponent){
  boolean retVal=true;
  if (this == otherMatrixComponent) {
    return true;
  }
  if (otherMatrixComponent == null || !(otherMatrixComponent instanceof MatrixComponent)) {
    return false;
  }
  if (!super.equals(otherMatrixComponent)) {
    return false;
  }
  MatrixComponent castedComponent=(MatrixComponent)otherMatrixComponent;
  retVal=(this.isSquare == castedComponent.isSquare) && (this.resizable == castedComponent.resizable) && (this.allowedValues.equals(castedComponent.allowedValues))&& (this.elements.equals(castedComponent.elements))&& (this.nCols == castedComponent.nCols)&& (this.nRows == castedComponent.nRows)&& (this.valueType == castedComponent.valueType);
  return retVal;
}

Fixed version (ground truth):
/** 
 * <p> This operation is used to check equality between the MatrixComponent and another MatrixComponent. It returns true if the MatrixComponents are equal and false if they are not. </p>
 * @param otherMatrixComponent <p> The TableComponent that should be checked for equality. </p>
 * @return <p>True if the TableComponents are equal, false if not </p>
 */
public boolean equals(Object otherMatrixComponent){
  boolean retVal=true;
  if (this == otherMatrixComponent) {
    return true;
  }
  if (otherMatrixComponent == null || !(otherMatrixComponent instanceof MatrixComponent)) {
    return false;
  }
  if (!super.equals(otherMatrixComponent)) {
    return false;
  }
  MatrixComponent castedComponent=(MatrixComponent)otherMatrixComponent;
  retVal=(this.isSquare == castedComponent.isSquare) && (this.resizable == castedComponent.resizable) && (this.allowedValues.equals(castedComponent.allowedValues))&& (this.elements.equals(castedComponent.elements))&& (this.nCols == castedComponent.nCols)&& (this.nRows == castedComponent.nRows)&& (this.valueType == castedComponent.valueType);
  return retVal;
}
Program: 133607
Project: 133607
Buggy source:
/** 
 * <p> This operation is used to check equality between the TableComponent and another TableComponent. It returns true if the TableComponents are equal and false if they are not. </p>
 * @param otherTableComponent <p> The TableComponent that should be checked for equality. </p>
 * @return <p>True if the TableComponents are equal, false if not </p>
 */
public boolean equals(TableComponent otherTableComponent){
  boolean retVal=true;
  if (this == otherTableComponent) {
    return true;
  }
  if (otherTableComponent == null || !(otherTableComponent instanceof TableComponent)) {
    return false;
  }
  if (!super.equals(otherTableComponent)) {
    return false;
  }
  TableComponent castedComponent=(TableComponent)otherTableComponent;
  retVal=(this.columnNames.equals(castedComponent.columnNames)) && (this.rowComponents.equals(castedComponent.rowComponents)) && (this.selectedRows.equals(castedComponent.selectedRows));
  return retVal;
}

Fixed version (ground truth):
/** 
 * <p> This operation is used to check equality between the TableComponent and another TableComponent. It returns true if the TableComponents are equal and false if they are not. </p>
 * @param otherTableComponent <p> The TableComponent that should be checked for equality. </p>
 * @return <p>True if the TableComponents are equal, false if not </p>
 */
public boolean equals(Object otherTableComponent){
  boolean retVal=true;
  if (this == otherTableComponent) {
    return true;
  }
  if (otherTableComponent == null || !(otherTableComponent instanceof TableComponent)) {
    return false;
  }
  if (!super.equals(otherTableComponent)) {
    return false;
  }
  TableComponent castedComponent=(TableComponent)otherTableComponent;
  retVal=(this.columnNames.equals(castedComponent.columnNames)) && (this.rowComponents.equals(castedComponent.rowComponents)) && (this.selectedRows.equals(castedComponent.selectedRows));
  return retVal;
}
Program: 133609
Project: 133609
Buggy source:
/** 
 * This operation overrides JobLauncher.equals() to check the additional pieces of this class.
 * @param otherLauncher The launcher to compare against.
 * @return True if equal, false otherwise.
 */
public boolean equals(SuiteLauncher otherLauncher){
  boolean retVal=super.equals(otherLauncher) && executablesList.equals(otherLauncher.executablesList);
  return retVal;
}

Fixed version (ground truth):
/** 
 * This operation overrides JobLauncher.equals() to check the additional pieces of this class.
 * @param otherLauncher The launcher to compare against.
 * @return True if equal, false otherwise.
 */
public boolean equals(Object otherLauncher){
  boolean retVal=super.equals(otherLauncher) && executablesList.equals(((SuiteLauncher)otherLauncher).executablesList);
  return retVal;
}
Program: 133610
Project: 133610
Buggy source:
/** 
 * <p> This method indicates whether or not this KDDMatrix and the given KDDMatrix argument are equal. </p>
 * @param matrix
 * @return
 */
public boolean equals(KDDMatrix matrix){
  if (matrix.numberOfColumns() != nCols || matrix.numberOfRows() != nRows) {
    return false;
  }
  for (int i=0; i < nRows; i++) {
    for (int j=0; j < nCols; j++) {
      if (!matrix.getElement(i,j).equals(getElement(i,j))) {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * <p> This method indicates whether or not this KDDMatrix and the given KDDMatrix argument are equal. </p>
 * @param matrix
 * @return true if the matrices are equal to each other, false otherwise.
 */
public boolean equals(Object matrix){
  boolean retVal=true;
  if (matrix != null && matrix instanceof KDDMatrix && matrix != this) {
    KDDMatrix otherMatrix=(KDDMatrix)matrix;
    if (otherMatrix.numberOfColumns() != nCols || otherMatrix.numberOfRows() != nRows) {
      retVal=false;
    }
    for (int i=0; i < nRows; i++) {
      for (int j=0; j < nCols; j++) {
        if (!otherMatrix.getElement(i,j).equals(getElement(i,j))) {
          retVal=false;
        }
      }
    }
  }
  return retVal;
}
Program: 133611
Project: 133611
Buggy source:
/** 
 * This operation checks to see if this PlotEntryContentProvider is equal to an input IEntryContentProvider.
 * @param otherProvider The IEntryContentProvider to check if this is equal to.
 */
@Override public boolean equals(IEntryContentProvider otherProvider){
  boolean equal=false;
  if (otherProvider != null && otherProvider instanceof PlotEntryContentProvider) {
    PlotEntryContentProvider other=(PlotEntryContentProvider)otherProvider;
    equal=(super.equals(otherProvider) && parent.equals(other.parent));
  }
  return equal;
}

Fixed version (ground truth):
/** 
 * This operation checks to see if this PlotEntryContentProvider is equal to an input IEntryContentProvider.
 * @param otherProvider The IEntryContentProvider to check if this is equal to.
 */
@Override public boolean equals(Object otherProvider){
  boolean equal=false;
  if (otherProvider != null && otherProvider instanceof PlotEntryContentProvider) {
    PlotEntryContentProvider other=(PlotEntryContentProvider)otherProvider;
    equal=(super.equals(otherProvider) && parent.equals(other.parent));
  }
  return equal;
}
Program: 133612
Project: 133612
Buggy source:
/** 
 * <p> This operation sets the input files that may be selected in the Form for the input type with the specified name. Passing null for the name or file list will not make any changes to the Form. </p>
 * @param name	Name of the input file type.
 * @param desc	Description of the file type.
 * @param files	List of files available for the job.
 */
public void setInputFiles(String name,String desc,ArrayList<String> files){
  int oldId=0;
  Entry oldEntry=null;
  DataComponent fileComponent=((DataComponent)getComponent(1));
  final ArrayList<String> finalFiles=(files != null) ? (ArrayList<String>)files.clone() : new ArrayList<String>();
  String oldValue="String_Node_Str";
  if (fileComponent.contains(name)) {
    oldEntry=fileComponent.retrieveEntry(name);
    oldId=oldEntry.getId();
    oldValue=oldEntry.getValue();
  }
  Entry fileEntry=new Entry(){
    @Override public void setup(){
      this.allowedValues=finalFiles;
      this.allowedValueType=AllowedValueType.File;
      return;
    }
  }
;
  fileEntry.setDescription(desc);
  fileEntry.setName(name);
  fileEntry.setId((oldId > 0) ? oldId : fileComponent.retrieveAllEntries().size());
  if (fileEntry.getAllowedValues().contains(oldValue)) {
    fileEntry.setValue(oldValue);
  }
  if (oldEntry != null) {
    oldEntry.copy(fileEntry);
  }
 else {
    fileComponent.addEntry(fileEntry);
  }
  return;
}

Fixed version (ground truth):
/** 
 * <p> This operation sets the input files that may be selected in the Form for the input type with the specified name. Passing null for the name or file list will not make any changes to the Form. </p>
 * @param name	Name of the input file type.
 * @param desc	Description of the file type.
 * @param files	List of files available for the job.
 */
public void setInputFiles(String name,String desc,ArrayList<String> files){
  int oldId=0;
  Entry oldEntry=null;
  DataComponent fileComponent=((DataComponent)getComponent(1));
  final ArrayList<String> finalFiles=(files != null) ? (ArrayList<String>)files.clone() : new ArrayList<String>();
  String oldValue="String_Node_Str";
  if (fileComponent.contains(name)) {
    oldEntry=fileComponent.retrieveEntry(name);
    oldId=oldEntry.getId();
    oldValue=oldEntry.getValue();
  }
  Entry fileEntry=new Entry(){
    @Override protected void setup(){
      this.allowedValues=finalFiles;
      this.allowedValueType=AllowedValueType.File;
      return;
    }
  }
;
  fileEntry.setDescription(desc);
  fileEntry.setName(name);
  fileEntry.setId((oldId > 0) ? oldId : fileComponent.retrieveAllEntries().size());
  if (fileEntry.getAllowedValues().contains(oldValue)) {
    fileEntry.setValue(oldValue);
  }
  if (oldEntry != null) {
    oldEntry.copy(fileEntry);
  }
 else {
    fileComponent.addEntry(fileEntry);
  }
  return;
}
Program: 133614
Project: 133614
Buggy source:
/** 
 * Attempts to establish the connection on a separate worker thread.
 * @return A future wrapping the connection's state when the connectionoperation completes. To wait for the connection to connect (or fail), use the future's  {@code get()} method.
 */
public Future<ConnectionState> connect(){
  return null;
}

Fixed version (ground truth):
/** 
 * Attempts to establish the connection on a separate worker thread.
 * @return A future wrapping the connection's state when the connectionoperation completes. To wait for the connection to connect (or fail), use the future's  {@code get()} method.
 */
public Future<ConnectionState> connect(){
  Future<ConnectionState> retVal;
  connectionLock.lock();
  try {
    if (state == ConnectionState.Connected) {
      retVal=createInstantFuture(state);
    }
 else     if (state == ConnectionState.Connecting) {
      retVal=hookIntoConnectThread();
    }
 else {
      retVal=startConnectThread();
    }
  }
  finally {
    connectionLock.unlock();
  }
  return retVal;
}
Program: 133616
Project: 133616
Buggy source:
/** 
 * Checks that the proper sequence of notifications are posted to registered listeners when the   {@link VizConnection#connect()} operation<i>fails</i>.
 */
@Test public void checkNotificationsForFailedConnect(){
  int size;
  fakeConnection.failOperation=true;
  try {
    connection.connect().get();
  }
 catch (  InterruptedException|ExecutionException e) {
    e.printStackTrace();
    fail("String_Node_Str" + "String_Node_Str");
  }
  assertTrue(fakeListener1.wasNotified());
  notificationLock.lock();
  try {
    assertSame(connection,notificationQueue.poll());
    assertEquals(ConnectionState.Connecting,notificationQueue.poll());
    assertEquals("String_Node_Str",notificationQueue.poll());
    size=notificationQueue.size();
  }
  finally {
    notificationLock.unlock();
  }
  if (size != 0) {
    assertTrue(fakeListener1.wasNotified());
  }
  notificationLock.lock();
  try {
    assertSame(connection,notificationQueue.poll());
    assertEquals(ConnectionState.Failed,notificationQueue.poll());
    assertEquals("String_Node_Str",notificationQueue.poll());
    assertTrue(notificationQueue.isEmpty());
  }
  finally {
    notificationLock.unlock();
  }
  return;
}

Fixed version (ground truth):
/** 
 * Checks that the proper sequence of notifications are posted to registered listeners when the   {@link VizConnection#connect()} operation<i>fails</i>.
 */
@Test public void checkNotificationsForFailedConnect(){
  int size;
  fakeConnection.failOperation=true;
  try {
    connection.connect().get();
  }
 catch (  InterruptedException|ExecutionException e) {
    e.printStackTrace();
    fail("String_Node_Str" + "String_Node_Str");
  }
  assertTrue(fakeListener1.wasNotified());
  notificationLock.lock();
  try {
    assertSame(connection,notificationQueue.poll());
    assertEquals(ConnectionState.Connecting,notificationQueue.poll());
    assertEquals("String_Node_Str",notificationQueue.poll());
    size=notificationQueue.size();
  }
  finally {
    notificationLock.unlock();
  }
  if (size == 0) {
    assertTrue(fakeListener1.wasNotified());
  }
  notificationLock.lock();
  try {
    assertSame(connection,notificationQueue.poll());
    assertEquals(ConnectionState.Failed,notificationQueue.poll());
    assertEquals("String_Node_Str",notificationQueue.poll());
    assertTrue(notificationQueue.isEmpty());
  }
  finally {
    notificationLock.unlock();
  }
  return;
}
Program: 133617
Project: 133617
Buggy source:
/** 
 * Checks that the proper sequence of notifications are posted to registered listeners when the   {@link VizConnection#connect()} operation issuccessful.
 */
@Test public void checkNotificationsForSuccessfulConnect(){
  int size;
  fakeConnection.failOperation=false;
  try {
    connection.connect().get();
  }
 catch (  InterruptedException|ExecutionException e) {
    e.printStackTrace();
    fail("String_Node_Str" + "String_Node_Str");
  }
  assertTrue(fakeListener1.wasNotified());
  notificationLock.lock();
  try {
    assertSame(connection,notificationQueue.poll());
    assertEquals(ConnectionState.Connecting,notificationQueue.poll());
    assertEquals("String_Node_Str",notificationQueue.poll());
    size=notificationQueue.size();
  }
  finally {
    notificationLock.unlock();
  }
  if (size != 0) {
    assertTrue(fakeListener1.wasNotified());
  }
  notificationLock.lock();
  try {
    assertSame(connection,notificationQueue.poll());
    assertEquals(ConnectionState.Connected,notificationQueue.poll());
    assertEquals("String_Node_Str",notificationQueue.poll());
    assertTrue(notificationQueue.isEmpty());
  }
  finally {
    notificationLock.unlock();
  }
  return;
}

Fixed version (ground truth):
/** 
 * Checks that the proper sequence of notifications are posted to registered listeners when the   {@link VizConnection#connect()} operation issuccessful.
 */
@Test public void checkNotificationsForSuccessfulConnect(){
  int size;
  fakeConnection.failOperation=false;
  try {
    connection.connect().get();
  }
 catch (  InterruptedException|ExecutionException e) {
    e.printStackTrace();
    fail("String_Node_Str" + "String_Node_Str");
  }
  assertTrue(fakeListener1.wasNotified());
  notificationLock.lock();
  try {
    assertSame(connection,notificationQueue.poll());
    assertEquals(ConnectionState.Connecting,notificationQueue.poll());
    assertEquals("String_Node_Str",notificationQueue.poll());
    size=notificationQueue.size();
  }
  finally {
    notificationLock.unlock();
  }
  if (size == 0) {
    assertTrue(fakeListener1.wasNotified());
  }
  notificationLock.lock();
  try {
    assertSame(connection,notificationQueue.poll());
    assertEquals(ConnectionState.Connected,notificationQueue.poll());
    assertEquals("String_Node_Str",notificationQueue.poll());
    assertTrue(notificationQueue.isEmpty());
  }
  finally {
    notificationLock.unlock();
  }
  return;
}
Program: 133618
Project: 133618
Buggy source:
@Override public void setupFormWithServices(){
  IMaterialsDatabase database=getMaterialsDatabase();
  if (database != null) {
    ListComponent<Material> matList=(ListComponent<Material>)form.getComponent(1);
    matList.setElementSource(database);
  }
  return;
}

Fixed version (ground truth):
@Override public void setupFormWithServices(){
  IMaterialsDatabase database=getMaterialsDatabase();
  if (database != null) {
    ListComponent<Material> matList=(ListComponent<Material>)form.getComponent(matListId);
    matList.setElementSource(database);
  }
  return;
}
Program: 133619
Project: 133619
Buggy source:
@Override protected void setup(){
  allowedValueType=AllowedValueType.File;
  return;
}

Fixed version (ground truth):
@Override protected void setup(){
  allowedValueType=AllowedValueType.Continuous;
  allowedValues.add("String_Node_Str");
  allowedValues.add("String_Node_Str");
  return;
}
Program: 133621
Project: 133621
Buggy source:
/** 
 * Test method for  {@link org.eclipse.ice.item.AbstractItemBuilder#build(org.eclipse.core.resources.IProject)}.
 */
@Test public void testBuild(){
  int listID=1;
  ListComponent<Material> list;
  ReflectivityModelBuilder builder=new ReflectivityModelBuilder();
  builder.setMaterialsDatabase(this);
  ReflectivityModel model=(ReflectivityModel)builder.build(null);
  assertNotNull(model.getForm());
  assertEquals(1,model.getForm().getComponents().size());
  list=(ListComponent<Material>)model.getForm().getComponent(listID);
  assertNotNull(list);
  assertEquals("String_Node_Str",list.getName());
  assertNotNull(list.getElementSource());
  assertEquals(list.getElementSource(),this);
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.eclipse.ice.item.AbstractItemBuilder#build(org.eclipse.core.resources.IProject)}.
 */
@Test public void testBuild(){
  ListComponent<Material> list;
  ReflectivityModelBuilder builder=new ReflectivityModelBuilder();
  builder.setMaterialsDatabase(this);
  ReflectivityModel model=(ReflectivityModel)builder.build(null);
  assertNotNull(model.getForm());
  assertEquals(2,model.getForm().getComponents().size());
  list=(ListComponent<Material>)model.getForm().getComponent(ReflectivityModel.matListId);
  assertNotNull(list);
  assertEquals("String_Node_Str",list.getName());
  assertNotNull(list.getElementSource());
  assertEquals(list.getElementSource(),this);
}
Program: 133622
Project: 133622
Buggy source:
/** 
 * This operation checks the ReflectivityModel and makes sure that it can properly construct its Form.
 */
@Test public void checkConstruction(){
  int listID=1;
  ListComponent<Material> list;
  ReflectivityModel model=new ReflectivityModel();
  model.setMaterialsDatabase(this);
  model.setupFormWithServices();
  assertNotNull(model.getForm());
  assertEquals(1,model.getForm().getComponents().size());
  list=(ListComponent<Material>)model.getForm().getComponent(listID);
  assertNotNull(list);
  assertEquals("String_Node_Str",list.getName());
  assertNotNull(list.getElementSource());
  assertEquals(list.getElementSource(),this);
  return;
}

Fixed version (ground truth):
/** 
 * This operation checks the ReflectivityModel and makes sure that it can properly construct its Form.
 */
@Test public void checkConstruction(){
  ListComponent<Material> list;
  ReflectivityModel model=new ReflectivityModel();
  model.setMaterialsDatabase(this);
  model.setupFormWithServices();
  assertNotNull(model.getForm());
  assertEquals(2,model.getForm().getComponents().size());
  list=(ListComponent<Material>)model.getForm().getComponent(ReflectivityModel.matListId);
  assertNotNull(list);
  assertEquals("String_Node_Str",list.getName());
  assertNotNull(list.getElementSource());
  assertEquals(list.getElementSource(),this);
  return;
}
Program: 133623
Project: 133623
Buggy source:
/** 
 * Compares two material stacks to tell if they are equal to one another.
 * @param stack The stack to compare this one with
 * @return Returns true if the stacks are equal (same material, same amount)and false if otherwise.
 */
public boolean equals(MaterialStack stack){
  boolean val=(number == stack.getAmount()) && material.equals(stack.getMaterial());
  System.out.println(number == stack.getAmount());
  return val;
}

Fixed version (ground truth):
/** 
 * Compares two material stacks to tell if they are equal to one another.
 * @param stack The stack to compare this one with
 * @return Returns true if the stacks are equal (same material, same amount)and false if otherwise.
 */
@Override public boolean equals(Object toCompare){
  boolean isEqual=false;
  if (toCompare instanceof MaterialStack) {
    if (this == toCompare) {
      isEqual=true;
    }
 else {
      MaterialStack stack=(MaterialStack)toCompare;
      isEqual=(number == stack.getAmount()) && material.equals(stack.getMaterial());
    }
  }
  return isEqual;
}
Program: 133624
Project: 133624
Buggy source:
/** 
 * Test method for   {@link org.eclipse.ice.datastructures.form.MaterialStack#getAmount()}.
 */
public void testGetAmount(){
  fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Test method for   {@link org.eclipse.ice.datastructures.form.MaterialStack#getAmount()}.
 */
@Test public void testGetAmount(){
  int amount=3;
  MaterialStack stack=new MaterialStack(TestMaterialFactory.createH2O(),amount);
  int testAmount=stack.getAmount();
  assertTrue(amount == testAmount);
}
Program: 133625
Project: 133625
Buggy source:
/** 
 * Test method for   {@link org.eclipse.ice.datastructures.form.MaterialStack#incrementAmount()}.
 */
public void testIncrementAmount(){
  fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Test method for   {@link org.eclipse.ice.datastructures.form.MaterialStack#incrementAmount()}.
 */
@Test public void testIncrementAmount(){
  int startAmount=2;
  MaterialStack stack=new MaterialStack(TestMaterialFactory.createH2O(),startAmount);
  stack.incrementAmount();
  assertEquals(startAmount + 1,stack.getAmount());
  startAmount++;
  int add=5;
  stack.addAmount(add);
  assertEquals(startAmount + add,stack.getAmount());
}
Program: 133626
Project: 133626
Buggy source:
/** 
 * Test method for   {@link org.eclipse.ice.datastructures.form.MaterialStack#getMaterial()}.
 */
public void testGetMaterial(){
  fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Test method for   {@link org.eclipse.ice.datastructures.form.MaterialStack#getMaterial()}.
 */
@Test public void testGetMaterial(){
  Material C02=TestMaterialFactory.createCO2();
  MaterialStack stack=new MaterialStack(C02,3);
  Material testMat=stack.getMaterial();
  assertTrue(C02.equals(testMat));
}
Program: 133627
Project: 133627
Buggy source:
/** 
 * Test method for   {@link org.eclipse.ice.datastructures.form.MaterialStack#MaterialStack()}.
 */
public void testConstruction(){
  fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Test method for   {@link org.eclipse.ice.datastructures.form.MaterialStack#MaterialStack()}.
 */
@Test public void testConstruction(){
  Material matTest1=new Material();
  matTest1.setName("String_Node_Str");
  MaterialStack stack1=new MaterialStack(matTest1,3);
  assertNotNull(matTest1);
  MaterialStack stack2=new MaterialStack();
  stack2.setMaterial(matTest1);
  stack2.setAmount(3);
  assertTrue(stack1.equals(stack2));
}
Program: 133629
Project: 133629
Buggy source:
@Override public Material setColumnValue(Material baseObject,Object editedValue,int column){
  if (column != 0) {
    baseObject.setProperty(properties.get(column),Double.valueOf(editedValue.toString()));
  }
  return baseObject;
}

Fixed version (ground truth):
@Override public Material setColumnValue(Material baseObject,Object editedValue,int column){
  if (column != 0) {
    try {
      baseObject.setProperty(properties.get(column),Double.valueOf(editedValue.toString()));
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return baseObject;
}
Program: 133630
Project: 133630
Buggy source:
@Override public void update(IUpdateable updateable){
  if (updateable instanceof ResourceComponent) {
    ResourceComponent comp=(ResourceComponent)updateable;
    ResourceComponent ourComp=(ResourceComponent)form.getComponent(3);
    ArrayList<String> names=new ArrayList<String>();
    for (    ICEResource r : ourComp.getResources()) {
      names.add(r.getName());
    }
    for (    ICEResource r : comp.getResources()) {
      if (!names.contains(r.getName())) {
        System.out.println("String_Node_Str" + r.getName());
        ourComp.add(r);
      }
    }
  }
 else   if (updateable instanceof TreeComposite) {
    TreeComposite tree=(TreeComposite)updateable;
    if (tree.getName().equals("String_Node_Str") || (tree.getParent() != null && tree.getParent().getName().equals("String_Node_Str"))) {
      System.out.println("String_Node_Str" + tree.getName() + "String_Node_Str");
      if (tree.getName().equals("String_Node_Str") && tree.getNumberOfChildren() < variables.size()) {
        variables.clear();
      }
      for (int i=0; i < tree.getNumberOfChildren(); i++) {
        TreeComposite variable=tree.getChildAtIndex(i);
        if (!variables.contains(variable)) {
          variables.add(variable);
          variable.register(this);
        }
      }
      updateAllVariableEntries();
    }
 else {
      BreadthFirstTreeCompositeIterator iter=new BreadthFirstTreeCompositeIterator(tree);
      while (iter.hasNext()) {
        updateBlockVariableEntries(iter.next());
      }
    }
  }
}

Fixed version (ground truth):
@Override public boolean update(Message message){
  super.update(message);
  String type=message.getType();
  String text=message.getMessage();
  if ("String_Node_Str".equals(type)) {
  }
 else   if ("String_Node_Str".equals(type)) {
  }
  return true;
}
Program: 133631
Project: 133631
Buggy source:
public void run(){
  while (!status.equals(FormStatus.Processed)) {
    Thread.currentThread();
    try {
      Thread.sleep(100);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    status=mooseLauncher.getStatus();
  }
  return;
}

Fixed version (ground truth):
@Override public void run(){
  new MOOSEFileHandler().setupVariables(modelTree);
  new MOOSEFileHandler().setupAuxVariables(modelTree);
}
Program: 133632
Project: 133632
Buggy source:
/** 
 * The constructor.
 * @param projectSpace
 */
public MOOSE(IProject projectSpace){
  super(projectSpace);
  mooseModel=new MOOSEModel(projectSpace);
  mooseLauncher=new MOOSELauncher(projectSpace);
  for (  Component c : mooseModel.getForm().getComponents()) {
    if (c.getName().equals("String_Node_Str")) {
      c.setName("String_Node_Str");
    }
    form.addComponent(c);
  }
  modelFiles=(DataComponent)form.getComponent(1);
  form.addComponent(mooseLauncher.getForm().getComponent(3));
  modelTree=(TreeComposite)form.getComponent(2);
  variables=new ArrayList<TreeComposite>();
}

Fixed version (ground truth):
/** 
 * The constructor.
 * @param projectSpace
 */
public MOOSE(IProject projectSpace){
  super(projectSpace);
  mooseModel=new MOOSEModel(projectSpace);
  mooseLauncher=new MOOSELauncher(projectSpace);
  for (  Component c : mooseModel.getForm().getComponents()) {
    if (c.getName().equals("String_Node_Str")) {
      c.setName("String_Node_Str");
    }
    form.addComponent(c);
  }
  modelFiles=(DataComponent)form.getComponent(1);
  form.addComponent(mooseLauncher.getForm().getComponent(3));
  modelTree=(TreeComposite)form.getComponent(2);
}
Program: 133633
Project: 133633
Buggy source:
/** 
 * (non-Javadoc)
 * @see org.eclipse.ice.item.Item#loadInput(java.lang.String)
 */
@Override public void loadInput(String input){
  mooseModel.loadInput(input);
  form=new Form();
  String description="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  form.setName("String_Node_Str");
  form.setDescription(description);
  form.setItemID(getId());
  form.setActionList(allowedActions);
  for (  Component c : mooseModel.getForm().getComponents()) {
    form.addComponent(c);
  }
  modelFiles=(DataComponent)form.getComponent(1);
  for (  Component c : mooseLauncher.getForm().getComponents()) {
    if ("String_Node_Str".equals(c.getName()) || "String_Node_Str".equals(c.getName())) {
      form.addComponent(c);
    }
  }
  modelTree=(TreeComposite)form.getComponent(2);
  loadFileEntries();
  TreeComposite variablesTree=getTreeByName("String_Node_Str");
  update(variablesTree);
  variablesTree.register(this);
  modelTree.register(this);
  registered=true;
  return;
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @see org.eclipse.ice.item.Item#loadInput(java.lang.String)
 */
@Override public void loadInput(String input){
  mooseModel.loadInput(input);
  form=new Form();
  String description="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  form.setName("String_Node_Str");
  form.setDescription(description);
  form.setItemID(getId());
  form.setActionList(allowedActions);
  for (  Component c : mooseModel.getForm().getComponents()) {
    form.addComponent(c);
  }
  modelFiles=(DataComponent)form.getComponent(1);
  for (  Component c : mooseLauncher.getForm().getComponents()) {
    if ("String_Node_Str".equals(c.getName()) || "String_Node_Str".equals(c.getName())) {
      form.addComponent(c);
    }
  }
  modelTree=(TreeComposite)form.getComponent(2);
  loadFileEntries();
  getTreeByName("String_Node_Str").register(this);
  getTreeByName("String_Node_Str").register(this);
  modelTree.register(this);
  registered=true;
  return;
}
Program: 133635
Project: 133635
Buggy source:
@Override public Future<Boolean> setFeature(String category,String feature) throws NullPointerException, IllegalArgumentException {
  if (category == null || feature == null) {
    throw new NullPointerException("String_Node_Str" + "String_Node_Str");
  }
  final String newCategory=category;
  final String newFeature=feature;
  Callable<Boolean> operation=new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      boolean changed=false;
      String category=getCategory();
      String feature=getFeature();
      if (!newCategory.equals(category) || !newFeature.equals(feature)) {
        Set<String> featureSet=featureMap.get(category);
        if (featureSet != null) {
          if (featureSet.contains(feature)) {
            if (connection.getState() == ConnectionState.Connected && setFeatureOnClient(connection,category,feature)) {
              category=newCategory;
              feature=newFeature;
              changed=true;
            }
          }
 else {
            throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + feature + "String_Node_Str");
          }
        }
 else {
          throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + category + "String_Node_Str");
        }
      }
      return changed;
    }
  }
;
  return requestExecutor.submit(operation);
}

Fixed version (ground truth):
@Override public Future<Boolean> setFeature(String category,String feature) throws NullPointerException, IllegalArgumentException {
  if (category == null || feature == null) {
    throw new NullPointerException("String_Node_Str" + "String_Node_Str");
  }
  final String newCategory=category;
  final String newFeature=feature;
  Callable<Boolean> operation=new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      boolean changed=false;
      String category=getCategory();
      String feature=getFeature();
      if (!newCategory.equals(category) || !newFeature.equals(feature)) {
        Set<String> featureSet=featureMap.get(newCategory);
        if (featureSet != null) {
          if (featureSet.contains(newFeature)) {
            if (connection.getState() == ConnectionState.Connected && setFeatureOnClient(connection,newCategory,newFeature)) {
              AbstractParaViewProxy.this.category=newCategory;
              AbstractParaViewProxy.this.feature=newFeature;
              changed=true;
            }
          }
 else {
            throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + newFeature + "String_Node_Str");
          }
        }
 else {
          throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + newCategory + "String_Node_Str");
        }
      }
      return changed;
    }
  }
;
  return requestExecutor.submit(operation);
}
Program: 133636
Project: 133636
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void widgetSelected(SelectionEvent arg0){
  if (list.size() > 0) {
    ListComponent selected=table.getSelectedObjects();
    if (selected.size() > 0) {
      int numSelected=selected.size();
      if (!(selected.get(numSelected - 1).equals(list.get(list.size() - 1)))) {
        list.getReadWriteLock().writeLock().lock();
        int index=0;
        Object toMove=list.get(0);
        for (int i=0; i < numSelected; i++) {
          index=list.indexOf(selected.get(i)) + 1;
          toMove=list.get(index);
          list.set(index,selected.get(i));
          list.set(index - 1,toMove);
        }
        list.set(index - 1,toMove);
        list.getReadWriteLock().writeLock().unlock();
        table.setSelection(selected);
      }
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void widgetSelected(SelectionEvent arg0){
  if (list.size() > 0) {
    ListComponent selected=table.getSelectedObjects();
    if (selected.size() > 0) {
      int numSelected=selected.size();
      if (!(selected.get(numSelected - 1).equals(list.get(list.size() - 1)))) {
        list.getReadWriteLock().writeLock().lock();
        int index=0;
        Object toMove=list.get(0);
        for (int i=numSelected - 1; i >= 0; i--) {
          index=list.indexOf(selected.get(i)) + 1;
          toMove=list.get(index);
          list.set(index,selected.get(i));
          list.set(index - 1,toMove);
        }
        list.set(index - 1,toMove);
        list.getReadWriteLock().writeLock().unlock();
        table.setSelection(selected);
      }
    }
  }
}
Program: 133638
Project: 133638
Buggy source:
@Override public void mouseScrolled(MouseEvent e){
  String direction=(e.count > 0) ? "String_Node_Str" : "String_Node_Str";
  widget.zoom(direction);
}

Fixed version (ground truth):
@Override public void mouseScrolled(MouseEvent e){
  String direction=(e.count > 0) ? "String_Node_Str" : "String_Node_Str";
  widget.zoom(direction);
  System.out.println(direction);
}
Program: 133642
Project: 133642
Buggy source:
/** 
 * Disposes class instance resources (i.e., the   {@link #bot}) after the instance's tests have been run. <p> <b>Note:</b> If overridden, be sure to call   {@code super.afterTests()} atthe end of the method, or the bot will not be freed. </p>
 */
@After public void afterTests(){
  bot=null;
}

Fixed version (ground truth):
/** 
 * Disposes class instance resources (i.e., the   {@link #bot}) after the instance's tests have been run. <p> <b>Note:</b> If overridden, be sure to call   {@code super.afterTests()} atthe end of the method, or the bot will not be freed. </p>
 */
@After public void afterTests(){
  disposeTestResources();
  bot=null;
}
Program: 133643
Project: 133643
Buggy source:
/** 
 * Creates the   {@link #bot} for testing <i>after</i> the {@link #shell} iscreated. <p> <b>Note:</b> If overridden, be sure to call  {@code super.beforeTests()}at the beginning of the method, or the bot will not be created. </p>
 * @throws InterruptedException If there is an error while waiting for the shell to be created.
 */
@Before public void beforeTests() throws InterruptedException {
  shellLatch.await();
  bot=new SWTBot(shell);
}

Fixed version (ground truth):
/** 
 * Creates the   {@link #bot} for testing <i>after</i> the {@link #shell} iscreated. <p> <b>Note:</b> If overridden, be sure to call  {@code super.beforeTests()}at the beginning of the method, or the bot will not be created. </p>
 * @throws InterruptedException If there is an error while waiting for the shell to be created.
 */
@Before public void beforeTests() throws InterruptedException {
  shellLatch.await();
  bot=new SWTBot(shell);
  createTestResources(shell);
}
Program: 133646
Project: 133646
Buggy source:
/** 
 * This method is responsible for toggling a ControlDecoration on and off on the EntryComposite. The decoration will toggle on if the editor is dirty and the selection was recently changed (monitored by   {@link EntryComposite#currentSelection}). Otherwise, it will toggle off.
 */
public void toggleSaveDecoration(){
  if (decoration == null) {
    decoration=new ControlDecoration(this,SWT.TOP | SWT.LEFT);
    final String saveMessage="String_Node_Str";
    decoration.setDescriptionText(saveMessage);
    Image image=FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage();
    decoration.setImage(image);
    final IEditorPart editor=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    editor.addPropertyListener(new IPropertyListener(){
      @Override public void propertyChanged(      Object source,      int propId){
        if (editor != null && editor.isDirty()) {
          EntryComposite.this.decoration.show();
          if (messageManager != null) {
            messageManager.addMessage(messageName,saveMessage,null,IMessageProvider.ERROR);
          }
        }
 else         if (editor != null) {
          EntryComposite.this.decoration.hide();
          messageManager.removeMessage(messageName);
        }
        return;
      }
    }
);
  }
  return;
}

Fixed version (ground truth):
/** 
 * This method is responsible for toggling a ControlDecoration on and off on the EntryComposite. The decoration will toggle on if the editor is dirty and the selection was recently changed (monitored by   {@link EntryComposite#currentSelection}). Otherwise, it will toggle off.
 */
public void toggleSaveDecoration(){
  if (decoration == null) {
    decoration=new ControlDecoration(this,SWT.TOP | SWT.LEFT);
    final String saveMessage="String_Node_Str";
    decoration.setDescriptionText(saveMessage);
    Image image=FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage();
    decoration.setImage(image);
    final IEditorPart editor=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    editor.addPropertyListener(new IPropertyListener(){
      @Override public void propertyChanged(      Object source,      int propId){
        if (editor != null) {
          if (editor.isDirty() && !EntryComposite.this.entry.getValue().equals(currentSelection)) {
            EntryComposite.this.decoration.show();
            if (messageManager != null) {
            }
          }
 else           if (!editor.isDirty()) {
            EntryComposite.this.decoration.hide();
          }
        }
        return;
      }
    }
);
  }
  return;
}
Program: 133647
Project: 133647
Buggy source:
@Override public void propertyChanged(Object source,int propId){
  if (editor != null && editor.isDirty()) {
    EntryComposite.this.decoration.show();
    if (messageManager != null) {
      messageManager.addMessage(messageName,saveMessage,null,IMessageProvider.ERROR);
    }
  }
 else   if (editor != null) {
    EntryComposite.this.decoration.hide();
    messageManager.removeMessage(messageName);
  }
  return;
}

Fixed version (ground truth):
@Override public void propertyChanged(Object source,int propId){
  if (editor != null) {
    if (editor.isDirty() && !EntryComposite.this.entry.getValue().equals(currentSelection)) {
      EntryComposite.this.decoration.show();
      if (messageManager != null) {
      }
    }
 else     if (!editor.isDirty()) {
      EntryComposite.this.decoration.hide();
    }
  }
  return;
}
Program: 133648
Project: 133648
Buggy source:
/** 
 * If the specified value is an allowed key for the   {@link #keyManager}, then this   {@code KeyEntry} will assume that key within the key manager.Otherwise, this method will return false and set an appropriate error message.
 */
@Override public boolean setValue(String newValue){
  boolean returnCode=false;
  AllowedValueType valueType=iEntryContentProvider.getAllowedValueType();
  if (valueType == AllowedValueType.Undefined) {
    if (contentProvider.keyAvailable(newValue)) {
      value=newValue;
      returnCode=true;
      changeState=true;
      errorMessage=null;
      notifyListeners();
    }
 else {
      String error=undefinedErrMsg;
      error=error.replace("String_Node_Str",newValue);
    }
  }
 else {
    returnCode=super.setValue(newValue);
  }
  return returnCode;
}

Fixed version (ground truth):
/** 
 * If the specified value is an allowed key for the   {@link #keyManager}, then this   {@code KeyEntry} will assume that key within the key manager.Otherwise, this method will return false and set an appropriate error message.
 */
@Override public boolean setValue(String newValue){
  boolean returnCode=false;
  AllowedValueType valueType=contentProvider.getAllowedValueType();
  if (value == newValue || (value != null && value.equals(newValue))) {
    returnCode=true;
    changeState=false;
    errorMessage=null;
  }
 else   if (valueType == AllowedValueType.Undefined) {
    if (contentProvider.keyAvailable(newValue)) {
      value=newValue;
      returnCode=true;
      changeState=true;
      errorMessage=null;
      notifyListeners();
    }
 else {
      String error=undefinedErrMsg;
      changeState=false;
      errorMessage=error.replace("String_Node_Str",newValue != null ? newValue : "String_Node_Str");
    }
  }
 else {
    returnCode=super.setValue(newValue);
  }
  return returnCode;
}
Program: 133649
Project: 133649
Buggy source:
@Override public boolean equals(Object object){
  boolean equals=false;
  if (super.equals(object) && object instanceof KeyEntry) {
    equals=true;
  }
  return equals;
}

Fixed version (ground truth):
@Override public boolean equals(Object object){
  boolean equals=false;
  if (object != null) {
    if (object == this) {
      equals=true;
    }
 else     if (object instanceof KeyEntry) {
      equals=super.equals(object);
    }
  }
  return equals;
}
Program: 133650
Project: 133650
Buggy source:
/** 
 * The copy constructor. When used, both   {@code KeyEntry}s will use the exact same   {@link #keyManager} (but valid or unique keys).<p> <b>Note:</b> This method should not be used. It is implemented so that a template  {@code KeyEntry} can be copied when used in{@code ConnectionManager} {@code TableComponent}s. </p>
 * @param otherEntry The other  {@code KeyEntry} to copy.
 */
private KeyEntry(KeyEntry entry){
  this(entry != null ? entry.contentProvider : null);
  if (entry != null) {
    super.copy(entry);
  }
  return;
}

Fixed version (ground truth):
/** 
 * The copy constructor. When used, both   {@code KeyEntry}s will use the exact same   {@link #keyManager} (but valid or unique keys).<p> <b>Note:</b> This method should not be used. It is implemented so that a template  {@code KeyEntry} can be copied when used in{@code ConnectionManager} {@code TableComponent}s. </p>
 * @param otherEntry The other  {@code KeyEntry} to copy.
 */
public KeyEntry(KeyEntry entry){
  if (entry != null) {
    super.copy(entry);
    contentProvider=(KeyEntryContentProvider)iEntryContentProvider;
  }
 else {
    throw new NullPointerException("String_Node_Str" + "String_Node_Str");
  }
  return;
}
Program: 133652
Project: 133652
Buggy source:
public int getPort(){
  String port=getConnectionProperty("String_Node_Str");
  return (port != null ? Integer.parseInt(port) : -1);
}

Fixed version (ground truth):
public int getPort(){
  int port=-1;
  String portString=getConnectionProperty("String_Node_Str");
  if (portString != null) {
    try {
      port=Integer.parseInt(portString);
    }
 catch (    NumberFormatException e) {
    }
  }
  return port;
}
Program: 133654
Project: 133654
Buggy source:
public String getHost(){
  return getConnectionProperty("String_Node_Str");
}

Fixed version (ground truth):
public String getHost(){
  String host=getConnectionProperty("String_Node_Str");
  return (host != null && !host.isEmpty() ? host : "String_Node_Str");
}
Program: 133655
Project: 133655
Buggy source:
/** 
 * Sets the data source (which is currently rendered if the plot is drawn). If the data source is valid and new, then the plot will be updated accordingly. <p> <b>Note:</b>   {@link ConnectionPlot} additionally performs basic checks onthe files. For instance, it will throw an exception if the file does not exist or if there are read permission issues. </p>
 * @param file The new data source URI.
 * @throws NullPointerException if the specified file is null
 * @throws IOException if there was an error while reading the file's contents
 * @throws IllegalArgumentException if there are no plots available
 * @throws Exception if there is some other unspecified problem with the file
 */
@Override public void setDataSource(URI file) throws NullPointerException, IOException, IllegalArgumentException, Exception {
  if (file != null) {
    if (adapter != null) {
      throw new NullPointerException("String_Node_Str" + "String_Node_Str");
    }
    final String message;
    if (!adapter.isRemote()) {
      File fileRef=new File(file);
      if (!fileRef.isFile()) {
        message="String_Node_Str" + file + "String_Node_Str";
      }
 else       if (!fileRef.canRead()) {
        message="String_Node_Str" + file + "String_Node_Str";
      }
 else {
        message=null;
      }
    }
 else {
      message=null;
    }
    if (message != null) {
      throw new IllegalArgumentException("String_Node_Str" + message);
    }
  }
  super.setDataSource(file);
}

Fixed version (ground truth):
/** 
 * Sets the data source (which is currently rendered if the plot is drawn). If the data source is valid and new, then the plot will be updated accordingly. <p> <b>Note:</b>   {@link ConnectionPlot} additionally performs basic checks onthe files. For instance, it will throw an exception if the file does not exist or if there are read permission issues. </p>
 * @param file The new data source URI.
 * @throws NullPointerException if the specified file is null
 * @throws IOException if there was an error while reading the file's contents
 * @throws IllegalArgumentException if there are no plots available
 * @throws Exception if there is some other unspecified problem with the file
 */
@Override public void setDataSource(URI file) throws NullPointerException, IOException, IllegalArgumentException, Exception {
  if (file != null) {
    if (adapter == null) {
      throw new NullPointerException("String_Node_Str" + "String_Node_Str");
    }
    final String message;
    if (!adapter.isRemote()) {
      File fileRef=new File(file);
      if (!fileRef.isFile()) {
        message="String_Node_Str" + file + "String_Node_Str";
      }
 else       if (!fileRef.canRead()) {
        message="String_Node_Str" + file + "String_Node_Str";
      }
 else {
        message=null;
      }
    }
 else {
      message=null;
    }
    if (message != null) {
      throw new IllegalArgumentException("String_Node_Str" + message);
    }
  }
  super.setDataSource(file);
}