nus-yam/ex-repair huggingface dataset:
Program: 133562
Project: 133562
Buggy source:
/** 
 * Adds a new series to the drawn plot.
 * @param category The category of the series to add.
 * @param type The type of the series to add.
 * @param drawnPlot The drawn plot that will get a new series.
 */
public void addSeries(ISeries series){
  double plotTime=0.0;
  if (series.enabled() && !seriesMap.containsKey(series)) {
    plotProvider.addSeries(plotTime,series);
    final ISeries finSeries=series;
    ActionTree tree=new ActionTree(new Action(series.getLabel()){
      @Override public void run(){
        finSeries.setEnabled(false);
        removeSeries(finSeries);
        refresh();
      }
    }
);
    removeSeriesTree.add(tree);
    seriesMap.put(series,tree);
  }
  return;
}

Fixed version (ground truth):
/** 
 * Adds a new series to the drawn plot.
 * @param category The category of the series to add.
 * @param type The type of the series to add.
 * @param drawnPlot The drawn plot that will get a new series.
 */
public void addSeries(ISeries series){
  double plotTime=0.0;
  if (series.enabled() && !seriesMap.containsKey(series)) {
    plotProvider.addSeries(plotTime,series);
    final ISeries finSeries=series;
    ActionTree tree=new ActionTree(new Action(series.getLabel()){
      @Override public void run(){
        removeSeries(finSeries);
        finSeries.setEnabled(false);
        refresh();
      }
    }
);
    removeSeriesTree.add(tree);
    seriesMap.put(finSeries,tree);
  }
  return;
}
Program: 133563
Project: 133563
Buggy source:
@Override public void run(){
  finSeries.setEnabled(false);
  removeSeries(finSeries);
  refresh();
}

Fixed version (ground truth):
@Override public void run(){
  removeSeries(finSeries);
  finSeries.setEnabled(false);
  refresh();
}
Program: 133564
Project: 133564
Buggy source:
/** 
 * Removes the specified series from the drawn plot.
 * @param series The series to remove.
 */
public void removeSeries(ISeries series){
  ActionTree tree=seriesMap.remove(series);
  if (tree != null) {
    double plotTime=0.0;
    removeSeriesTree.remove(tree);
    plotProvider.removeSeries(plotTime,series);
    editor.removeSeries(series);
  }
  return;
}

Fixed version (ground truth):
/** 
 * Removes the specified series from the drawn plot.
 * @param series The series to remove.
 */
public void removeSeries(ISeries series){
  ActionTree tree=seriesMap.remove(series);
  if (tree != null) {
    double plotTime=0.0;
    removeSeriesTree.remove(tree);
    plotProvider.removeSeries(plotTime,series);
    editor.removeSeries(series);
    seriesMap.remove(series);
  }
  return;
}
Program: 133565
Project: 133565
Buggy source:
@Override public boolean equals(Object other){
  boolean isEqual=false;
  if (other != null || (other instanceof CSVSeries) && super.equals(other)) {
    if (other == this) {
      isEqual=true;
    }
 else {
      CSVSeries series=(CSVSeries)other;
      isEqual=this.isEnabled == series.isEnabled && label == series.label && (parent == null ? parent == series.parent : parent.equals(series.parent)) && style.equals(series.style) && time == series.time && unit.equals(series.unit);
    }
  }
  return isEqual;
}

Fixed version (ground truth):
@Override public boolean equals(Object other){
  boolean isEqual=false;
  if (other != null && (other instanceof CSVSeries) && super.equals(other)) {
    if (other == this) {
      isEqual=true;
    }
 else {
      CSVSeries series=(CSVSeries)other;
      isEqual=this.isEnabled == series.isEnabled && label == series.label && (parent == null ? series.parent == null : parent.equals(series.parent)) && style.equals(series.style) && time == series.time && unit.equals(series.unit);
    }
  }
  return isEqual;
}
Program: 133566
Project: 133566
Buggy source:
public void setIOService(IOService service){
  (new Item(null)).setIOService(service);
}

Fixed version (ground truth):
/** 
 * This operation configures the IOService that should be used by Items
 * @param service The IOService that provides Input/Output capabilities to Items managed by the Core.
 */
public void setIOService(IOService service){
  itemManager.setIOService(service);
}
Program: 133567
Project: 133567
Buggy source:
/** 
 * The Constructor
 */
public Core(){
  itemManager=new ItemManager();
  projectTable=new Hashtable<String,IProject>();
  if (!setupProjectLocation()) {
    throw new RuntimeException("String_Node_Str");
  }
  if (System.getProperty("String_Node_Str") != null) {
    debuggingEnabled=true;
  }
  updateLock=new AtomicBoolean(false);
  return;
}

Fixed version (ground truth):
/** 
 * The Constructor
 */
public Core(){
  itemManager=new ItemManager();
  projectTable=new Hashtable<String,IProject>();
  if (!setupProjectLocation()) {
    throw new RuntimeException("String_Node_Str");
  }
  updateLock=new AtomicBoolean(false);
  return;
}
Program: 133569
Project: 133569
Buggy source:
/** 
 * Updates the properties for a connection based on the specified name and preference value. If necessary, the connection may be reset.
 * @param name The name of the connection (a preference name in the store).
 * @param preferences The <i>new</i> preference value for the connection. This value should come straight from the  {@link #preferenceStore}.
 */
private void updateConnection(String name,String preferences){
  final VizConnection<T> connection=connectionsByName.get(name);
  if (updateConnectionPreferences(connection,preferences)) {
    final Future<ConnectionState> disconnectRequest=connection.disconnect();
    final ExecutorService executor=Executors.newSingleThreadExecutor();
    executor.submit(new Runnable(){
      @Override public void run(){
        try {
          disconnectRequest.get();
        }
 catch (        InterruptedException|ExecutionException e) {
          e.printStackTrace();
        }
        connection.connect();
      }
    }
);
  }
  return;
}

Fixed version (ground truth):
/** 
 * Updates the properties for a connection based on the specified name and preference value. If necessary, the connection may be reset.
 * @param name The name of the connection (a preference name in the store).
 * @param preferences The <i>new</i> preference value for the connection. This value should come straight from the  {@link #preferenceStore}.
 */
private void updateConnection(String name,String preferences){
  System.out.println("String_Node_Str" + "String_Node_Str" + name + "String_Node_Str"+ preferences+ "String_Node_Str");
  final VizConnection<T> connection=connectionsByName.get(name);
  if (updateConnectionPreferences(connection,preferences)) {
    final Future<ConnectionState> disconnectRequest=connection.disconnect();
    final ExecutorService executor=Executors.newSingleThreadExecutor();
    executor.submit(new Runnable(){
      @Override public void run(){
        try {
          disconnectRequest.get();
        }
 catch (        InterruptedException|ExecutionException e) {
          e.printStackTrace();
        }
        connection.connect();
      }
    }
);
  }
  return;
}
Program: 133570
Project: 133570
Buggy source:
/** 
 * Adds a new connection based on the specified name and preference value. The connection will attempt to connect.
 * @param name The name of the connection (a preference name in the store).
 * @param preferences The preference value for the connection. This value should come straight from the  {@link #preferenceStore}.
 */
private void addConnection(String name,String preferences){
  VizConnection<T> connection=createConnection(name,preferences);
  String[] split=preferences.split(getDelimiter());
  try {
    connection.setName(name);
    connection.setHost(split[0]);
    connection.setPort(Integer.parseInt(split[1]));
    connection.setPath(split[2]);
    connectionsByName.put(name,connection);
    String host=connection.getHost();
    Set<String> connections=connectionsByHost.get(host);
    if (connections == null) {
      connections=new HashSet<String>();
      connectionsByHost.put(host,connections);
    }
    connections.add(name);
    connection.connect();
  }
 catch (  IndexOutOfBoundsException|NullPointerException|NumberFormatException e) {
  }
  return;
}

Fixed version (ground truth):
/** 
 * Adds a new connection based on the specified name and preference value. The connection will attempt to connect.
 * @param name The name of the connection (a preference name in the store).
 * @param preferences The preference value for the connection. This value should come straight from the  {@link #preferenceStore}.
 */
private void addConnection(String name,String preferences){
  System.out.println("String_Node_Str" + "String_Node_Str" + name + "String_Node_Str"+ preferences+ "String_Node_Str");
  VizConnection<T> connection=createConnection(name,preferences);
  String[] split=preferences.split(getDelimiter(),-1);
  try {
    connection.setName(name);
    connection.setHost(split[0]);
    connection.setPort(Integer.parseInt(split[1]));
    connection.setPath(split[2]);
    connectionsByName.put(name,connection);
    String host=connection.getHost();
    Set<String> connections=connectionsByHost.get(host);
    if (connections == null) {
      connections=new HashSet<String>();
      connectionsByHost.put(host,connections);
    }
    connections.add(name);
    connection.connect();
  }
 catch (  IndexOutOfBoundsException|NullPointerException|NumberFormatException e) {
  }
  return;
}
Program: 133571
Project: 133571
Buggy source:
/** 
 * Removes a connection based on the specified name. The connection will be disconnected.
 * @param name The name of the connection to remove.
 */
private void removeConnection(String name){
  VizConnection<T> connection=connectionsByName.remove(name);
  String host=connection.getHost();
  Set<String> connections=connectionsByHost.get(host);
  connections.remove(name);
  if (connections.isEmpty()) {
    connectionsByHost.remove(host);
  }
  return;
}

Fixed version (ground truth):
/** 
 * Removes a connection based on the specified name. The connection will be disconnected.
 * @param name The name of the connection to remove.
 */
private void removeConnection(String name){
  System.out.println("String_Node_Str" + "String_Node_Str" + name + "String_Node_Str");
  VizConnection<T> connection=connectionsByName.remove(name);
  String host=connection.getHost();
  Set<String> connections=connectionsByHost.get(host);
  connections.remove(name);
  if (connections.isEmpty()) {
    connectionsByHost.remove(host);
  }
  return;
}
Program: 133572
Project: 133572
Buggy source:
/** 
 * Gets each connection property from the string of preferences, if possible, and updates the connection based on them.
 * @return True if one of the properties changed and a reset of theconnection is required, false if a reset is <i>not</i> required.
 */
protected boolean updateConnectionPreferences(VizConnection<T> connection,String preferences){
  boolean requiresReset=false;
  String[] split=preferences.split(getDelimiter());
  try {
    String host=split[0];
    int port=Integer.parseInt(split[1]);
    String path=split[2];
    requiresReset|=connection.setHost(host);
    requiresReset|=connection.setPort(port);
    requiresReset|=connection.setPath(path);
  }
 catch (  IndexOutOfBoundsException|NullPointerException|NumberFormatException e) {
    requiresReset=false;
  }
  return requiresReset;
}

Fixed version (ground truth):
/** 
 * Gets each connection property from the string of preferences, if possible, and updates the connection based on them. <p> <b>Note:</b> If overridden, it is recommended to call the super method so that teh host, port, and path will be updated. This method will return true if any of those three properties change. </p>
 * @param connection The connection whose preferences are being updated.
 * @param preferences The serialized string of preferences.
 * @return True if one of the properties changed and a reset of theconnection is required, false if a reset is <i>not</i> required.
 */
protected boolean updateConnectionPreferences(VizConnection<T> connection,String preferences){
  boolean requiresReset=false;
  String[] split=preferences.split(getDelimiter(),-1);
  try {
    String host=split[0];
    int port=Integer.parseInt(split[1]);
    String path=split[2];
    requiresReset|=connection.setHost(host);
    requiresReset|=connection.setPort(port);
    requiresReset|=connection.setPath(path);
  }
 catch (  IndexOutOfBoundsException|NullPointerException|NumberFormatException e) {
    requiresReset=false;
  }
  return requiresReset;
}
Program: 133573
Project: 133573
Buggy source:
/** 
 * Initializes the viz connection manager that is tested as well as any other class variables frequently used to test the connection.
 */
@Before public void beforeEachTest(){
  fakeConnections=new HashMap<String,FakeVizConnection>();
  manager=new VizConnectionManager<FakeClient>(){
    @Override protected VizConnection<FakeClient> createConnection(    String name,    String preferences){
      FakeVizConnection fakeConnection=new FakeVizConnection();
      fakeConnections.put(name,fakeConnection);
      return fakeConnection;
    }
  }
;
  store=new CustomScopedPreferenceStore(getClass());
  return;
}

Fixed version (ground truth):
/** 
 * Initializes the viz connection manager that is tested as well as any other class variables frequently used to test the connection.
 */
@Before public void beforeEachTest(){
  fakeConnections=new HashMap<String,FakeVizConnection>();
  manager=new VizConnectionManager<FakeClient>(){
    @Override protected VizConnection<FakeClient> createConnection(    String name,    String preferences){
      FakeVizConnection fakeConnection=new FakeVizConnection();
      fakeConnections.put(name,fakeConnection);
      return fakeConnection;
    }
  }
;
  store=new CustomScopedPreferenceStore(getClass());
  store.removeNode(NODE_ID);
  return;
}
Program: 133574
Project: 133574
Buggy source:
/** 
 * This operation retrieves the DataComponent that is currently rendered, updated and monitored by the ICESectionPart.
 * @return The DataComponent
 */
public DataComponent getDataComponent(){
  return dataComposite.getDataComponent();
}

Fixed version (ground truth):
/** 
 * This operation retrieves the DataComponent that is currently rendered, updated and monitored by the ICESectionPart.
 * @return The DataComponent
 */
public DataComponent getDataComponent(){
  return dataComp;
}
Program: 133575
Project: 133575
Buggy source:
/** 
 * <p> This operation retrieves the Components that are managed by this page. This operation should not be generally used, but for testing purposes where there is a setter there must be a getter. </p>
 * @return <p>The set of Components managed by this page. </p>
 */
public ArrayList<Component> getComponents(){
  ArrayList<Component> compList=new ArrayList<Component>();
  compList.addAll(dataComponents);
  compList.addAll(tableComponents);
  compList.addAll(matrixComponents);
  return components;
}

Fixed version (ground truth):
/** 
 * <p> This operation retrieves the Components that are managed by this page. This operation should not be generally used, but for testing purposes where there is a setter there must be a getter. </p>
 * @return <p>The set of Components managed by this page. </p>
 */
public ArrayList<Component> getComponents(){
  ArrayList<Component> compList=new ArrayList<Component>();
  compList.addAll(dataComponents);
  compList.addAll(tableComponents);
  compList.addAll(matrixComponents);
  return compList;
}
Program: 133576
Project: 133576
Buggy source:
/** 
 * <p> The Constructor </p>
 * @param editor <p> The FormEditor for which the Page should be constructed. </p>
 * @param id <p> The id of the page. </p>
 * @param title <p> The title of the page. </p>
 */
public ICESectionPage(FormEditor editor,String id,String title){
  super(editor,id,title);
  if (editor != null && editor instanceof ICEFormEditor) {
    this.editor=(ICEFormEditor)editor;
  }
 else {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str");
  }
  components=new ArrayList<Component>();
  dataComponents=new ArrayList<DataComponent>();
  tableComponents=new ArrayList<TableComponent>();
  matrixComponents=new ArrayList<MatrixComponent>();
  return;
}

Fixed version (ground truth):
/** 
 * <p> The Constructor </p>
 * @param editor <p> The FormEditor for which the Page should be constructed. </p>
 * @param id <p> The id of the page. </p>
 * @param title <p> The title of the page. </p>
 */
public ICESectionPage(FormEditor editor,String id,String title){
  super(editor,id,title);
  if (editor != null && editor instanceof ICEFormEditor) {
    this.editor=(ICEFormEditor)editor;
  }
 else {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str");
  }
  dataComponents=new ArrayList<DataComponent>();
  tableComponents=new ArrayList<TableComponent>();
  matrixComponents=new ArrayList<MatrixComponent>();
  return;
}
Program: 133577
Project: 133577
Buggy source:
@Override public void register(IVizService service){
  if (service != null) {
    String name=service.getName();
    serviceMap.put(name,service);
    Set<String> supportedExtensions=new HashSet<String>();
    supportedExtensions.addAll(((AbstractVizService)service).supportedExtensions);
    for (    String ext : supportedExtensions) {
      EditorRegistry editorReg=(EditorRegistry)PlatformUI.getWorkbench().getEditorRegistry();
      EditorDescriptor editor=(EditorDescriptor)editorReg.findEditor("String_Node_Str");
      FileEditorMapping mapping=new FileEditorMapping(ext);
      mapping.addEditor(editor);
      mapping.setDefaultEditor(editor);
      IFileEditorMapping[] mappings=editorReg.getFileEditorMappings();
      FileEditorMapping[] newMappings=new FileEditorMapping[mappings.length + 1];
      for (int i=0; i < mappings.length; i++) {
        newMappings[i]=(FileEditorMapping)mappings[i];
      }
      newMappings[mappings.length]=mapping;
      editorReg.setFileEditorMappings(newMappings);
    }
    logger.info("String_Node_Str" + "String_Node_Str" + name + "String_Node_Str");
    if (getPreferenceStore().getBoolean("String_Node_Str")) {
      if (service.connect()) {
        logger.info("String_Node_Str" + "String_Node_Str" + name + "String_Node_Str");
      }
 else {
        logger.info("String_Node_Str" + "String_Node_Str" + name + "String_Node_Str");
      }
    }
  }
  return;
}

Fixed version (ground truth):
@Override public void register(IVizService service){
  if (service != null) {
    String name=service.getName();
    serviceMap.put(name,service);
    if (service instanceof AbstractVizService) {
      Set<String> supportedExtensions=new HashSet<String>();
      supportedExtensions.addAll(((AbstractVizService)service).supportedExtensions);
      for (      String ext : supportedExtensions) {
        EditorRegistry editorReg=(EditorRegistry)PlatformUI.getWorkbench().getEditorRegistry();
        EditorDescriptor editor=(EditorDescriptor)editorReg.findEditor("String_Node_Str");
        FileEditorMapping mapping=new FileEditorMapping(ext);
        mapping.addEditor(editor);
        mapping.setDefaultEditor(editor);
        IFileEditorMapping[] mappings=editorReg.getFileEditorMappings();
        FileEditorMapping[] newMappings=new FileEditorMapping[mappings.length + 1];
        for (int i=0; i < mappings.length; i++) {
          newMappings[i]=(FileEditorMapping)mappings[i];
        }
        newMappings[mappings.length]=mapping;
        editorReg.setFileEditorMappings(newMappings);
      }
    }
    logger.info("String_Node_Str" + "String_Node_Str" + name + "String_Node_Str");
    if (getPreferenceStore().getBoolean("String_Node_Str")) {
      if (service.connect()) {
        logger.info("String_Node_Str" + "String_Node_Str" + name + "String_Node_Str");
      }
 else {
        logger.info("String_Node_Str" + "String_Node_Str" + name + "String_Node_Str");
      }
    }
  }
  return;
}
Program: 133578
Project: 133578
Buggy source:
@Override public boolean disconnect(){
  return connections.disconnect();
}

Fixed version (ground truth):
@Override public boolean disconnect(){
  return false;
}
Program: 133579
Project: 133579
Buggy source:
/** 
 * The default constructor. <p> <b>Note:</b> Only OSGi should call this method! </p>
 */
public VisItVizService(){
  instance=this;
  connections=null;
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  return;
}

Fixed version (ground truth):
/** 
 * The default constructor. <p> <b>Note:</b> Only OSGi should call this method! </p>
 */
public VisItVizService(){
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  supportedExtensions.add("String_Node_Str");
  manager=new VisItConnectionManager();
  manager.setPreferenceStore((CustomScopedPreferenceStore)getPreferenceStore(),CONNECTIONS_NODE_ID);
  return;
}
Program: 133580
Project: 133580
Buggy source:
/** 
 * The default constructor.
 */
public VisItConnection(){
  propertyHandlers.remove("String_Node_Str");
  propertyHandlers.put("String_Node_Str",propertyHandlers.remove("String_Node_Str"));
  propertyHandlers.put("String_Node_Str",propertyHandlers.remove("String_Node_Str"));
  propertyHandlers.put("String_Node_Str",propertyHandlers.remove("String_Node_Str"));
  propertyHandlers.put("String_Node_Str",propertyHandlers.remove("String_Node_Str"));
  propertyHandlers.put("String_Node_Str",propertyHandlers.get("String_Node_Str"));
  propertyHandlers.put("String_Node_Str",propertyHandlers.get("String_Node_Str"));
  propertyHandlers.put("String_Node_Str",propertyHandlers.get("String_Node_Str"));
  return;
}

Fixed version (ground truth):
/** 
 * The default constructor.
 */
public VisItConnection(){
  propertyHandlers.remove("String_Node_Str");
  propertyHandlers.put("String_Node_Str",propertyHandlers.remove("String_Node_Str"));
  propertyHandlers.put("String_Node_Str",propertyHandlers.remove("String_Node_Str"));
  propertyHandlers.put("String_Node_Str",propertyHandlers.remove("String_Node_Str"));
  propertyHandlers.put("String_Node_Str",propertyHandlers.remove("String_Node_Str"));
  propertyHandlers.put("String_Node_Str",new IPropertyHandler(){
    @Override public String validateValue(    String value){
      String newValue=null;
      if (value != null) {
        newValue=value.trim();
      }
      return newValue;
    }
  }
);
  propertyHandlers.put("String_Node_Str",propertyHandlers.get("String_Node_Str"));
  propertyHandlers.put("String_Node_Str",new IPropertyHandler(){
    @Override public String validateValue(    String value){
      String newValue=null;
      if (value != null) {
        newValue=value.trim();
      }
      return newValue;
    }
  }
);
  return;
}
Program: 133581
Project: 133581
Buggy source:
/** 
 * Gets the key ("connection ID") associated with the default connection. This can be set on the preference page.
 * @return The key for the default connection, or null if one is not set.
 */
private String getDefaultConnectionKey(){
  int id=getPreferenceStore().getInt("String_Node_Str");
  List<String> connectionNames=table.getConnectionNames();
  return (id < connectionNames.size() ? connectionNames.get(id) : null);
}

Fixed version (ground truth):
/** 
 * Gets the key ("connection ID") associated with the default connection. This can be set on the preference page.
 * @return The key for the default connection, or null if one is not set.
 */
private String getDefaultConnectionKey(){
  int id=getPreferenceStore().getInt("String_Node_Str");
  String key=null;
  if (id >= 0 && id < table.numberOfRows()) {
    key=table.getRow(id).get(0).getValue();
  }
  return key;
}
Program: 133582
Project: 133582
Buggy source:
@Override public void init(IWorkbench workbench){
  setDescription(getVizService().getName() + "String_Node_Str");
  TableComponentPreferenceAdapter adapter=new TableComponentPreferenceAdapter();
  adapter.toTableComponent((CustomScopedPreferenceStore)getPreferenceStore(),connectionManager);
  resetKeyChangeInfo();
  connectionManager.addKeyChangeListener(this);
  return;
}

Fixed version (ground truth):
@Override public void init(IWorkbench workbench){
  super.init(workbench);
  TableComponentPreferenceAdapter adapter=new TableComponentPreferenceAdapter();
  adapter.toTableComponent((CustomScopedPreferenceStore)getPreferenceStore(),connectionManager);
  resetKeyChangeInfo();
  return;
}
Program: 133583
Project: 133583
Buggy source:
@Override protected void createFieldEditors(){
  Composite parent=getFieldEditorParent();
  final DynamicComboFieldEditor defaultConnection;
  defaultConnection=new DynamicComboFieldEditor("String_Node_Str","String_Node_Str",parent,connectionManager.getConnectionNames());
  addField(defaultConnection);
  connectionManager.addKeyChangeListener(new IKeyChangeListener(){
    @Override public void keyChanged(    String oldKey,    String newKey){
      String value=defaultConnection.getValue();
      List<String> names=connectionManager.getConnectionNames();
      defaultConnection.setAllowedValues(names);
      if (oldKey != null && newKey != null && oldKey.equals(value)) {
        defaultConnection.setValue(newKey);
      }
      return;
    }
  }
);
  return;
}

Fixed version (ground truth):
@Override protected void createFieldEditors(){
  Composite parent=getFieldEditorParent();
  return;
}
Program: 133584
Project: 133584
Buggy source:
/** 
 * This operation is used to check equality between the MOOSE Item and another MOOSE Item. It returns true if the Items are equal and false if they are not.
 * @param otherMoose The MOOSE Item that should be checked for equality.
 * @return True if the launchers are equal, false if not
 */
public boolean equals(MOOSE otherMoose){
  boolean retVal;
  if (this == otherMoose) {
    return true;
  }
  if (otherMoose == null || !(otherMoose instanceof Item) || !super.equals(otherMoose)) {
    return false;
  }
  retVal=(this.allowedActions.equals(otherMoose.allowedActions)) && (this.form.equals(otherMoose.form)) && (this.itemType == otherMoose.itemType)&& (this.status.equals(otherMoose.status));
  if (this.project != null && otherMoose.project != null && (!(this.project.equals(otherMoose.project)))) {
    return false;
  }
  if (this.project == null && otherMoose.project != null || this.project != null && otherMoose.project == null) {
    return false;
  }
  if (!mooseModel.equals(otherMoose.mooseModel) && !mooseLauncher.equals(otherMoose.mooseLauncher)) {
    return false;
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * This operation is used to check equality between the MOOSE Item and another MOOSE Item. It returns true if the Items are equal and false if they are not.
 * @param otherMoose The MOOSE Item that should be checked for equality.
 * @return True if the launchers are equal, false if not
 */
public boolean equals(Object other){
  boolean retVal;
  if (this == other) {
    return true;
  }
  if (other == null || !(other instanceof MOOSE) || !super.equals(other)) {
    return false;
  }
  MOOSE otherMoose=(MOOSE)other;
  retVal=(this.allowedActions.equals(otherMoose.allowedActions)) && (this.form.equals(otherMoose.form)) && (this.itemType == otherMoose.itemType)&& (this.status.equals(otherMoose.status));
  if (this.project != null && otherMoose.project != null && (!(this.project.equals(otherMoose.project)))) {
    return false;
  }
  if (this.project == null && otherMoose.project != null || this.project != null && otherMoose.project == null) {
    return false;
  }
  if (!mooseModel.equals(otherMoose.mooseModel) && !mooseLauncher.equals(otherMoose.mooseLauncher)) {
    return false;
  }
  return retVal;
}
Program: 133585
Project: 133585
Buggy source:
/** 
 * <p> This operation returns the hashcode value of the MOOSELauncher. </p>
 * @return <p> The hashcode </p>
 */
public int hashCode(){
  int hash=9;
  hash=31 * hash + super.hashCode();
  hash=31 * hash + inputFileName.hashCode();
  return hash;
}

Fixed version (ground truth):
/** 
 * <p> This operation returns the hashcode value of the MOOSELauncher. </p>
 * @return <p>The hashcode </p>
 */
public int hashCode(){
  int hash=9;
  hash=31 * hash + super.hashCode();
  hash=31 * hash + inputFileName.hashCode();
  return hash;
}
Program: 133586
Project: 133586
Buggy source:
/** 
 * <p> This operation is used to check equality between the MOOSEModel Item and another MOOSEModel Item. It returns true if the Items are equal and false if they are not. </p>
 * @param otherMoose <p> The MOOSEModel Item that should be checked for equality. </p>
 * @return <p> True if the launchers are equal, false if not </p>
 */
public boolean equals(MOOSELauncher otherMoose){
  boolean retVal;
  if (this == otherMoose) {
    return true;
  }
  if (otherMoose == null || !(otherMoose instanceof Item) || !super.equals(otherMoose)) {
    return false;
  }
  retVal=(this.allowedActions.equals(otherMoose.allowedActions)) && (this.form.equals(otherMoose.form)) && (this.itemType == otherMoose.itemType)&& (this.status.equals(otherMoose.status));
  if (this.project != null && otherMoose.project != null && (!(this.project.equals(otherMoose.project)))) {
    return false;
  }
  if (this.project == null && otherMoose.project != null || this.project != null && otherMoose.project == null) {
    return false;
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * <p> This operation is used to check equality between the MOOSEModel Item and another MOOSEModel Item. It returns true if the Items are equal and false if they are not. </p>
 * @param otherMoose <p> The MOOSEModel Item that should be checked for equality. </p>
 * @return <p>True if the launchers are equal, false if not </p>
 */
public boolean equals(Object other){
  boolean retVal;
  if (this == other) {
    return true;
  }
  if (other == null || !(other instanceof MOOSELauncher) || !super.equals(other)) {
    return false;
  }
  MOOSELauncher otherMooseLauncher=(MOOSELauncher)other;
  retVal=(this.allowedActions.equals(otherMooseLauncher.allowedActions)) && (this.form.equals(otherMooseLauncher.form)) && (this.itemType == otherMooseLauncher.itemType)&& (this.status.equals(otherMooseLauncher.status));
  if (this.project != null && otherMooseLauncher.project != null && (!(this.project.equals(otherMooseLauncher.project)))) {
    return false;
  }
  if (this.project == null && otherMooseLauncher.project != null || this.project != null && otherMooseLauncher.project == null) {
    return false;
  }
  return retVal;
}
Program: 133587
Project: 133587
Buggy source:
/** 
 * <p> This operation provides a deep copy of the MOOSELauncher Item. </p>
 * @return <p> A clone of the MOOSELauncher Item. </p>
 */
public Object clone(){
  MOOSELauncher clone=new MOOSELauncher();
  clone.copy(this);
  return clone;
}

Fixed version (ground truth):
/** 
 * <p> This operation provides a deep copy of the MOOSELauncher Item. </p>
 * @return <p>A clone of the MOOSELauncher Item. </p>
 */
public Object clone(){
  MOOSELauncher clone=new MOOSELauncher();
  clone.copy(this);
  return clone;
}
Program: 133588
Project: 133588
Buggy source:
/** 
 * <p> This operation is used to check equality between the MOOSEModel Item and another MOOSEModel Item. It returns true if the Items are equal and false if they are not. </p>
 * @param otherMoose <p> The MOOSEModel Item that should be checked for equality. </p>
 * @return <p> True if the launchers are equal, false if not </p>
 */
public boolean equals(MOOSEModel otherMooseModel){
  boolean retVal;
  if (this == otherMooseModel) {
    return true;
  }
  if (otherMooseModel == null || !(otherMooseModel instanceof Item) || !super.equals(otherMooseModel)) {
    return false;
  }
  retVal=(this.allowedActions.equals(otherMooseModel.allowedActions)) && (this.form.equals(otherMooseModel.form)) && (this.itemType == otherMooseModel.itemType)&& (this.status.equals(otherMooseModel.status));
  if (this.project != null && otherMooseModel.project != null && (!(this.project.equals(otherMooseModel.project)))) {
    return false;
  }
  if (this.project == null && otherMooseModel.project != null || this.project != null && otherMooseModel.project == null) {
    return false;
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * <p> This operation is used to check equality between the MOOSEModel Item and another MOOSEModel Item. It returns true if the Items are equal and false if they are not. </p>
 * @param otherMoose <p> The MOOSEModel Item that should be checked for equality. </p>
 * @return <p> True if the launchers are equal, false if not </p>
 */
public boolean equals(Object other){
  boolean retVal;
  if (this == other) {
    return true;
  }
  if (other == null || !(other instanceof MOOSEModel) || !super.equals(other)) {
    return false;
  }
  MOOSEModel otherMooseModel=(MOOSEModel)other;
  retVal=(this.allowedActions.equals(otherMooseModel.allowedActions)) && (this.form.equals(otherMooseModel.form)) && (this.itemType == otherMooseModel.itemType)&& (this.status.equals(otherMooseModel.status));
  if (this.project != null && otherMooseModel.project != null && (!(this.project.equals(otherMooseModel.project)))) {
    return false;
  }
  if (this.project == null && otherMooseModel.project != null || this.project != null && otherMooseModel.project == null) {
    return false;
  }
  return retVal;
}
Program: 133589
Project: 133589
Buggy source:
@Override public boolean deleteRow(int index){
  boolean deleted=false;
  if (index >= 0 && index < numberOfRows()) {
    List<Entry> row=getRow(index);
    deleted=super.deleteRow(index);
    if (deleted) {
      row.get(0).unregister(keyListeners.remove(index));
      String key=row.get(0).getValue();
      keyToIndexMap.remove(key);
      for (int i=index; i < numberOfRows(); i++) {
        key=getRow(index).get(0).getValue();
        keyToIndexMap.put(key,i);
      }
    }
  }
  return deleted;
}

Fixed version (ground truth):
@Override public boolean deleteRow(int index){
  boolean deleted=false;
  if (index >= 0 && index < numberOfRows()) {
    List<Entry> row=getRow(index);
    deleted=super.deleteRow(index);
    if (deleted) {
      row.get(0).unregister(keyListeners.remove(index));
      String key=row.get(0).getValue();
      keyToIndexMap.remove(key);
      for (int i=index; i < numberOfRows(); i++) {
        key=getRow(i).get(0).getValue();
        keyToIndexMap.put(key,i);
      }
    }
  }
  return deleted;
}
Program: 133592
Project: 133592
Buggy source:
@Override protected void setup(){
  allowedValueType=AllowedValueType.Discrete;
  allowedValues.add("String_Node_Str");
  allowedValues.add("String_Node_Str");
  return;
}

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

Fixed version (ground truth):
@Override public void setupFormWithServices(){
  ListComponent<Material> matList=(ListComponent<Material>)form.getComponent(matListId);
  ArrayList<String> names=new ArrayList<String>();
  names.add("String_Node_Str");
  names.add("String_Node_Str");
  names.add("String_Node_Str");
  names.add(Material.SCAT_LENGTH_DENSITY);
  names.add(Material.MASS_ABS_COHERENT);
  names.add(Material.MASS_ABS_INCOHERENT);
  MaterialWritableTableFormat format=new MaterialWritableTableFormat(names);
  matList.setTableFormat(format);
  IMaterialsDatabase database=getMaterialsDatabase();
  if (database != null) {
    matList.setElementSource(database);
  }
  return;
}
Program: 133596
Project: 133596
Buggy source:
@Override protected void setup(){
  allowedValueType=AllowedValueType.Continuous;
  allowedValues.add("String_Node_Str");
  allowedValues.add("String_Node_Str");
  return;
}

Fixed version (ground truth):
@Override protected void setup(){
  allowedValueType=AllowedValueType.Discrete;
  allowedValues.add("String_Node_Str");
  allowedValues.add("String_Node_Str");
  return;
}
Program: 133598
Project: 133598
Buggy source:
/** 
 * Attempts to disconnect from the connection widget on a separate worker thread.
 * @return A future wrapping the connection's state when the disconnectoperation completes. To wait for the connection to disconnect (or fail), use the future's  {@code get()} method.
 */
public Future<ConnectionState> disconnect(){
  return null;
}

Fixed version (ground truth):
/** 
 * Attempts to disconnect from the connection widget on a separate worker thread.
 * @return A future wrapping the connection's state when the disconnectoperation completes. To wait for the connection to disconnect (or fail), use the future's  {@code get()} method.
 */
public Future<ConnectionState> disconnect(){
  Future<ConnectionState> retVal;
  connectionLock.lock();
  try {
    if (state == ConnectionState.Disconnected) {
      retVal=createInstantFuture(state);
    }
 else     if (state == ConnectionState.Failed && widget == null) {
      retVal=createInstantFuture(state);
    }
 else {
      retVal=startDisconnectThread();
    }
  }
  finally {
    connectionLock.unlock();
  }
  return retVal;
}
Program: 133599
Project: 133599
Buggy source:
@Override public ConnectionState call() throws Exception {
  return state;
}

Fixed version (ground truth):
@Override public ConnectionState call() throws Exception {
  ConnectionState threadState;
  T connectionWidget;
  connectionLock.lock();
  try {
    threadState=state;
    connectionWidget=widget;
  }
  finally {
    connectionLock.unlock();
  }
  if (threadState != ConnectionState.Disconnected && connectionWidget != null) {
    boolean success=disconnectFromWidget(connectionWidget);
    connectionLock.lock();
    try {
      if (success) {
        state=ConnectionState.Disconnected;
        statusMessage="String_Node_Str";
        widget=null;
        executorService.shutdown();
        executorService=null;
      }
 else {
        state=ConnectionState.Failed;
        statusMessage="String_Node_Str";
      }
      threadState=state;
    }
  finally {
      connectionLock.unlock();
    }
    notifyListeners(threadState,statusMessage);
  }
  return state;
}
Program: 133600
Project: 133600
Buggy source:
@Override public void connectionStateChanged(IVizConnection<FakeClient> connection,ConnectionState state,String message){
  wasNotified.set(true);
}

Fixed version (ground truth):
@Override public void connectionStateChanged(IVizConnection<FakeClient> connection,ConnectionState state,String message){
  notifyCount.incrementAndGet();
  wasNotified.set(true);
}
Program: 133601
Project: 133601
Buggy source:
/** 
 * Checks that the proper sequence of notifications are posted to registered listeners when the   {@link VizConnection#disconnect()} operation fails.
 */
@Test public void checkNotificationsForFailedDisconnect(){
  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 {
    size=notificationQueue.size();
  }
  finally {
    notificationLock.unlock();
  }
  if (size != 6) {
    assertTrue(fakeListener1.wasNotified());
  }
  notificationLock.lock();
  try {
    assertEquals(6,notificationQueue.size());
    notificationQueue.clear();
  }
  finally {
    notificationLock.unlock();
  }
  fakeConnection.failOperation=true;
  try {
    connection.disconnect().get();
  }
 catch (  InterruptedException|ExecutionException e) {
    e.printStackTrace();
    fail("String_Node_Str" + "String_Node_Str");
  }
  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#disconnect()} operation fails.
 */
@Test public void checkNotificationsForFailedDisconnect(){
  fakeConnection.failOperation=false;
  try {
    connection.connect().get();
  }
 catch (  InterruptedException|ExecutionException e) {
    e.printStackTrace();
    fail("String_Node_Str" + "String_Node_Str");
  }
  assertTrue(fakeListener1.wasNotified(2));
  notificationLock.lock();
  try {
    assertEquals(6,notificationQueue.size());
    notificationQueue.clear();
  }
  finally {
    notificationLock.unlock();
  }
  fakeListener1.wasNotified.set(false);
  fakeConnection.failOperation=true;
  try {
    connection.disconnect().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.Failed,notificationQueue.poll());
    assertEquals("String_Node_Str",notificationQueue.poll());
    assertTrue(notificationQueue.isEmpty());
  }
  finally {
    notificationLock.unlock();
  }
  return;
}
Program: 133602
Project: 133602
Buggy source:
/** 
 * Determines if the listener was notified of a connection state change since the last call to this method. <p> This will wait for a certain amount of time until either the flag is true or a timeout occurs. </p>
 * @return True if the listener was notified, false otherwise.
 */
public boolean wasNotified(){
  boolean notified;
  long threshold=3000;
  long interval=50;
  long time=0;
  while (!(notified=wasNotified.getAndSet(false)) && time < threshold) {
    try {
      Thread.sleep(interval);
      time+=threshold;
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
      fail("String_Node_Str" + "String_Node_Str");
    }
  }
  return notified;
}

Fixed version (ground truth):
/** 
 * Determines if the listener was notified of a connection state change a certain number of times. <p> This will wait for a certain amount of time until either the count is reached or a timeout occurs. </p>
 * @param expectedCount The number of times the listener is expected to be updated.
 * @return True if the listener was updated the expected number oftimes, false otherwise.
 */
public boolean wasNotified(int expectedCount){
  long threshold=3000;
  long interval=50;
  long time=0;
  while (notifyCount.get() < expectedCount && time < threshold) {
    try {
      Thread.sleep(interval);
      time+=threshold;
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
      fail("String_Node_Str" + "String_Node_Str");
    }
  }
  return notifyCount.get() >= expectedCount;
}
Program: 133603
Project: 133603
Buggy source:
/** 
 * Checks that the proper sequence of notifications are posted to registered listeners when the   {@link VizConnection#disconnect()} operation issuccessful.
 */
@Test public void checkNotificationsForSuccessfulDisconnect(){
  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 {
    size=notificationQueue.size();
  }
  finally {
    notificationLock.unlock();
  }
  if (size != 6) {
    assertTrue(fakeListener1.wasNotified());
  }
  notificationLock.lock();
  try {
    assertEquals(6,notificationQueue.size());
    notificationQueue.clear();
  }
  finally {
    notificationLock.unlock();
  }
  try {
    connection.disconnect().get();
  }
 catch (  InterruptedException|ExecutionException e) {
    e.printStackTrace();
    fail("String_Node_Str" + "String_Node_Str");
  }
  notificationLock.lock();
  try {
    assertSame(connection,notificationQueue.poll());
    assertEquals(ConnectionState.Disconnected,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#disconnect()} operation issuccessful.
 */
@Test public void checkNotificationsForSuccessfulDisconnect(){
  fakeConnection.failOperation=false;
  try {
    connection.connect().get();
  }
 catch (  InterruptedException|ExecutionException e) {
    e.printStackTrace();
    fail("String_Node_Str" + "String_Node_Str");
  }
  assertTrue(fakeListener1.wasNotified(2));
  notificationLock.lock();
  try {
    assertEquals(6,notificationQueue.size());
    notificationQueue.clear();
  }
  finally {
    notificationLock.unlock();
  }
  fakeListener1.wasNotified.set(false);
  try {
    connection.disconnect().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.Disconnected,notificationQueue.poll());
    assertEquals("String_Node_Str",notificationQueue.poll());
    assertTrue(notificationQueue.isEmpty());
  }
  finally {
    notificationLock.unlock();
  }
  return;
}
Program: 133604
Project: 133604
Buggy source:
/** 
 * (non-Javadoc)
 * @see IEntryContentProvider#equals(IEntryContentProvider otherProvider)
 */
@Override public boolean equals(IEntryContentProvider otherProvider){
  boolean retVal=false;
  if (otherProvider != null) {
    if (this == otherProvider) {
      retVal=true;
    }
 else {
      retVal=super.equals((ICEObject)otherProvider) && (this.defaultValue.equals(otherProvider.getDefaultValue())) && (this.allowedValues.equals(otherProvider.getAllowedValues()))&& (this.parent.equals(otherProvider.getParent()))&& (this.allowedValueType.equals(otherProvider.getAllowedValueType()));
      if (this.tag != null) {
        retVal=retVal && (this.tag.equals(otherProvider.getTag()));
      }
 else {
        if (otherProvider.getTag() != null) {
          return false;
        }
      }
    }
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @see IEntryContentProvider#equals(IEntryContentProvider otherProvider)
 */
@Override public boolean equals(Object otherProvider){
  boolean retVal=false;
  if (otherProvider != null && otherProvider instanceof IEntryContentProvider) {
    IEntryContentProvider provider=(IEntryContentProvider)otherProvider;
    if (this == otherProvider) {
      retVal=true;
    }
 else {
      retVal=super.equals((ICEObject)provider) && (this.defaultValue.equals(provider.getDefaultValue())) && (this.allowedValues.equals(provider.getAllowedValues()))&& (this.parent.equals(provider.getParent()))&& (this.allowedValueType.equals(provider.getAllowedValueType()));
      if (this.tag != null) {
        retVal=retVal && (this.tag.equals(provider.getTag()));
      }
 else {
        if (provider.getTag() != null) {
          return false;
        }
      }
    }
  }
  return retVal;
}
Program: 133605
Project: 133605
Buggy source:
/** 
 * <p> Returns true if equal. False otherwise. </p>
 * @param otherProvider <p> The other provider to compare against. </p>
 * @return True if equivalent, false otherwise.
 */
public boolean equals(IEntryContentProvider otherProvider);

Fixed version (ground truth):
/** 
 * <p> Returns true if equal. False otherwise. </p>
 * @param otherProvider <p> The other provider to compare against. </p>
 * @return True if equivalent, false otherwise.
 */
public boolean equals(Object otherProvider);