nus-yam/ex-repair huggingface dataset:
Program: 190335
Project: 190335
Buggy source:
public boolean init(Graph graph){
  if (!(graph instanceof DirectedGraph)) {
    return false;
  }
  values=new ArrayList<Integer>(graph.getNodeCount());
  min=Integer.MAX_VALUE;
  max=Integer.MIN_VALUE;
  return true;
}

Fixed version (ground truth):
public boolean init(Graph graph){
  if (!(graph instanceof DirectedGraph)) {
    return false;
  }
  if (range == null) {
    getValues();
    refreshRange();
  }
  values=new ArrayList<Integer>(graph.getNodeCount());
  min=Integer.MAX_VALUE;
  max=Integer.MIN_VALUE;
  return true;
}
Program: 190336
Project: 190336
Buggy source:
private void refreshRange(){
  Integer lowerBound=range.getLowerInteger();
  Integer upperBound=range.getUpperInteger();
  if ((Integer)min > lowerBound || (Integer)max < lowerBound || lowerBound.equals(upperBound)) {
    lowerBound=(Integer)min;
  }
  if ((Integer)min > upperBound || (Integer)max < upperBound || lowerBound.equals(upperBound)) {
    upperBound=(Integer)max;
  }
  range=new Range(lowerBound,upperBound);
}

Fixed version (ground truth):
private void refreshRange(){
  if (range == null) {
    range=new Range(min,max);
  }
 else {
    range.trimBounds(min,max);
  }
}
Program: 190337
Project: 190337
Buggy source:
public void actionPerformed(ActionEvent e){
  if (!topComponent.isOpened()) {
    topComponent.open();
    topComponent.requestActive();
    button.setText("String_Node_Str");
  }
 else {
    topComponent.close();
    button.setText("String_Node_Str");
  }
  dynamicRangeFilter.refreshRange();
  TimelineController timelineController=Lookup.getDefault().lookup(TimelineController.class);
  timelineController.getModel().setFilterProperty(dynamicRangeFilter.getRangeProperty());
  timelineController.setMin(dynamicRangeFilter.getMinimum());
  timelineController.setMax(dynamicRangeFilter.getMaximum());
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  if (!topComponent.isOpened()) {
    topComponent.open();
    topComponent.requestActive();
    button.setText("String_Node_Str");
    dynamicRangeFilter.refreshRange();
    TimelineController timelineController=Lookup.getDefault().lookup(TimelineController.class);
    timelineController.getModel().setFilterProperty(dynamicRangeFilter.getRangeProperty());
    timelineController.setMin(dynamicRangeFilter.getMinimum());
    timelineController.setMax(dynamicRangeFilter.getMaximum());
  }
 else {
    topComponent.close();
    button.setText("String_Node_Str");
  }
}
Program: 190338
Project: 190338
Buggy source:
public JPanel getPanel(Filter filter){
  final DynamicRangeFilter dynamicRangeFilter=(DynamicRangeFilter)filter;
  JPanel panel=new JPanel();
  final TopComponent topComponent=WindowManager.getDefault().findTopComponent("String_Node_Str");
  final JButton button=new JButton(topComponent.isOpened() ? "String_Node_Str" : "String_Node_Str");
  button.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (!topComponent.isOpened()) {
        topComponent.open();
        topComponent.requestActive();
        button.setText("String_Node_Str");
      }
 else {
        topComponent.close();
        button.setText("String_Node_Str");
      }
      dynamicRangeFilter.refreshRange();
      TimelineController timelineController=Lookup.getDefault().lookup(TimelineController.class);
      timelineController.getModel().setFilterProperty(dynamicRangeFilter.getRangeProperty());
      timelineController.setMin(dynamicRangeFilter.getMinimum());
      timelineController.setMax(dynamicRangeFilter.getMaximum());
    }
  }
);
  panel.add(button);
  return panel;
}

Fixed version (ground truth):
public JPanel getPanel(Filter filter){
  final DynamicRangeFilter dynamicRangeFilter=(DynamicRangeFilter)filter;
  JPanel panel=new JPanel();
  final TopComponent topComponent=WindowManager.getDefault().findTopComponent("String_Node_Str");
  final JButton button=new JButton(topComponent.isOpened() ? "String_Node_Str" : "String_Node_Str");
  if (topComponent.isOpened()) {
    dynamicRangeFilter.refreshRange();
    TimelineController timelineController=Lookup.getDefault().lookup(TimelineController.class);
    timelineController.getModel().setFilterProperty(dynamicRangeFilter.getRangeProperty());
    timelineController.setMin(dynamicRangeFilter.getMinimum());
    timelineController.setMax(dynamicRangeFilter.getMaximum());
  }
  button.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (!topComponent.isOpened()) {
        topComponent.open();
        topComponent.requestActive();
        button.setText("String_Node_Str");
        dynamicRangeFilter.refreshRange();
        TimelineController timelineController=Lookup.getDefault().lookup(TimelineController.class);
        timelineController.getModel().setFilterProperty(dynamicRangeFilter.getRangeProperty());
        timelineController.setMin(dynamicRangeFilter.getMinimum());
        timelineController.setMax(dynamicRangeFilter.getMaximum());
      }
 else {
        topComponent.close();
        button.setText("String_Node_Str");
      }
    }
  }
);
  panel.add(button);
  return panel;
}
Program: 190342
Project: 190342
Buggy source:
public void computeMetaEdges(AbstractNode node,AbstractNode enabledAncestor){
  if (!dhns.getSettingsManager().isAutoMetaEdgeCreation()) {
    return;
  }
  if (enabledAncestor == null) {
    enabledAncestor=node;
  }
  int clusterEnd=node.getPre() + node.size;
  for (int i=node.pre; i <= clusterEnd; i++) {
    AbstractNode desc=treeStructure.getNodeAt(i);
    if (desc.getEdgesOutTree().getCount() > 0) {
      edgeIterator.setNode(desc.getEdgesOutTree());
      while (edgeIterator.hasNext()) {
        AbstractEdge edge=edgeIterator.next();
        AbstractNode[] enabledAncestors=treeStructure.getEnabledAncestorsOrSelf(edge.getTarget(viewId));
        if (enabledAncestors != null) {
          for (int j=0; j < enabledAncestors.length; j++) {
            AbstractNode targetNode=enabledAncestors[j];
            if (!(targetNode == edge.getTarget(viewId) && enabledAncestor == edge.getSource(viewId))) {
              createMetaEdge(enabledAncestor,targetNode,edge);
            }
          }
        }
      }
    }
    if (desc.getEdgesInTree().getCount() > 0) {
      edgeIterator.setNode(desc.getEdgesInTree());
      while (edgeIterator.hasNext()) {
        AbstractEdge edge=edgeIterator.next();
        AbstractNode[] enabledAncestors=treeStructure.getEnabledAncestorsOrSelf(edge.getSource(viewId));
        if (enabledAncestors != null) {
          for (int j=0; j < enabledAncestors.length; j++) {
            AbstractNode sourceNode=enabledAncestors[j];
            if (!(sourceNode == edge.getSource(viewId) && enabledAncestor == edge.getTarget(viewId))) {
              createMetaEdge(sourceNode,enabledAncestor,edge);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void computeMetaEdges(){
  for (TreeIterator itr=new TreeIterator(treeStructure,true,Tautology.instance); itr.hasNext(); ) {
    AbstractNode node=itr.next();
    computeMetaEdges(node,node);
  }
}
Program: 190343
Project: 190343
Buggy source:
public void readEdges(Element edgesE,GraphStructure graphStructure,GraphFactoryImpl factory){
  NodeList edgesListE=edgesE.getChildNodes();
  TreeStructure treeStructure=graphStructure.getMainView().getStructure();
  for (int i=0; i < edgesListE.getLength(); i++) {
    if (edgesListE.item(i).getNodeType() == Node.ELEMENT_NODE) {
      Element edgeE=(Element)edgesListE.item(i);
      Integer id=Integer.parseInt(edgeE.getAttribute("String_Node_Str"));
      AbstractNode source=treeStructure.getNodeAt(Integer.parseInt(edgeE.getAttribute("String_Node_Str")));
      AbstractNode target=treeStructure.getNodeAt(Integer.parseInt(edgeE.getAttribute("String_Node_Str")));
      AbstractEdge edge;
      if (edgeE.getTagName().equals(ELEMENT_EDGES_PROPER)) {
        edge=new ProperEdgeImpl(id,source,target);
      }
 else       if (edgeE.getTagName().equals(ELEMENT_EDGES_MIXED)) {
        edge=new MixedEdgeImpl(id,source,target,Boolean.parseBoolean(edgeE.getAttribute("String_Node_Str")));
      }
 else {
        edge=new SelfLoopImpl(id,source);
      }
      edge.setWeight(Float.parseFloat(edgeE.getAttribute("String_Node_Str")));
      edge.getEdgeData().setAttributes(factory.newEdgeAttributes());
      edge.getEdgeData().setTextData(factory.newTextData());
      source.getEdgesOutTree().add(edge);
      target.getEdgesInTree().add(edge);
      graphStructure.getEdgeDictionnary().add(edge);
    }
  }
}

Fixed version (ground truth):
public void readEdges(Element edgesE,GraphStructure graphStructure,GraphFactoryImpl factory){
  NodeList edgesListE=edgesE.getChildNodes();
  TreeStructure treeStructure=graphStructure.getMainView().getStructure();
  for (int i=0; i < edgesListE.getLength(); i++) {
    if (edgesListE.item(i).getNodeType() == Node.ELEMENT_NODE) {
      Element edgeE=(Element)edgesListE.item(i);
      Integer id=Integer.parseInt(edgeE.getAttribute("String_Node_Str"));
      AbstractNode source=treeStructure.getNodeAt(Integer.parseInt(edgeE.getAttribute("String_Node_Str")));
      AbstractNode target=treeStructure.getNodeAt(Integer.parseInt(edgeE.getAttribute("String_Node_Str")));
      AbstractEdge edge;
      if (edgeE.getTagName().equals(ELEMENT_EDGES_PROPER)) {
        edge=new ProperEdgeImpl(id,source,target);
      }
 else       if (edgeE.getTagName().equals(ELEMENT_EDGES_MIXED)) {
        edge=new MixedEdgeImpl(id,source,target,Boolean.parseBoolean(edgeE.getAttribute("String_Node_Str")));
      }
 else {
        edge=new SelfLoopImpl(id,source);
      }
      edge.setWeight(Float.parseFloat(edgeE.getAttribute("String_Node_Str")));
      edge.getEdgeData().setAttributes(factory.newEdgeAttributes());
      edge.getEdgeData().setTextData(factory.newTextData());
      source.getEdgesOutTree().add(edge);
      target.getEdgesInTree().add(edge);
      graphStructure.getEdgeDictionnary().add(edge);
    }
  }
  graphStructure.getMainView().getStructureModifier().getEdgeProcessor().computeMetaEdges();
}
Program: 190345
Project: 190345
Buggy source:
public void refreshModel(FilterModel filterModel,FilterUIModel uiModel){
  this.filterModel=filterModel;
  this.uiModel=uiModel;
  unsetup();
  filterPanelPanel.unsetup();
  queriesExplorer.unsetup();
  setup();
  ((FiltersExplorer)libraryTree).setup(manager,filterModel,uiModel);
  queriesExplorer.setup(queriesPanel.manager,filterModel,uiModel);
  filterPanelPanel.setup(uiModel);
  updateEnabled(filterModel != null);
}

Fixed version (ground truth):
public void refreshModel(FilterModel filterModel,FilterUIModel uiModel){
  this.filterModel=filterModel;
  this.uiModel=uiModel;
  unsetup();
  filterPanelPanel.unsetup();
  queriesExplorer.unsetup();
  setup();
  ((FiltersExplorer)libraryTree).setup(manager,filterModel,uiModel);
  queriesExplorer.setup(queriesPanel.manager,filterModel,uiModel);
  filterPanelPanel.setup(uiModel);
  updateEnabled(filterModel != null);
  updateControls();
}
Program: 190346
Project: 190346
Buggy source:
public void run(){
  filterButton.setSelected(filterModel.isFiltering());
  selectButton.setSelected(filterModel.isSelecting());
  updateEnabled(true);
}

Fixed version (ground truth):
public void run(){
  if (filterModel != null) {
    filterButton.setSelected(filterModel.isFiltering());
    selectButton.setSelected(filterModel.isSelecting());
  }
 else {
    filterButton.setSelected(false);
    selectButton.setSelected(false);
  }
}
Program: 190347
Project: 190347
Buggy source:
public void stateChanged(ChangeEvent e){
  if (e.getSource() instanceof FilterUIModel) {
    if (uiModel.getSelectedQuery() != null && filterButton.isSelected()) {
      FilterController controller=Lookup.getDefault().lookup(FilterController.class);
      controller.filter(uiModel.getSelectedRoot());
    }
 else     if (uiModel.getSelectedQuery() != null && selectButton.isSelected()) {
      FilterController controller=Lookup.getDefault().lookup(FilterController.class);
      controller.select(uiModel.getSelectedRoot());
    }
  }
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      filterButton.setSelected(filterModel.isFiltering());
      selectButton.setSelected(filterModel.isSelecting());
      updateEnabled(true);
    }
  }
);
}

Fixed version (ground truth):
public void stateChanged(ChangeEvent e){
  if (e.getSource() instanceof FilterUIModel) {
    if (uiModel.getSelectedQuery() != null && filterButton.isSelected()) {
      FilterController controller=Lookup.getDefault().lookup(FilterController.class);
      controller.filter(uiModel.getSelectedRoot());
    }
 else     if (uiModel.getSelectedQuery() != null && selectButton.isSelected()) {
      FilterController controller=Lookup.getDefault().lookup(FilterController.class);
      controller.select(uiModel.getSelectedRoot());
    }
  }
  updateControls();
  updateEnabled(true);
}
Program: 190350
Project: 190350
Buggy source:
public FilterControllerImpl(){
  PropertyEditorManager.registerEditor(Range.class,RangePropertyEditor.class);
  PropertyEditorManager.registerEditor(AttributeColumn.class,AttributeColumnPropertyEditor.class);
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  pc.addWorkspaceListener(new WorkspaceListener(){
    public void initialize(    Workspace workspace){
      workspace.add(new FilterModelImpl());
    }
    public void select(    Workspace workspace){
      model=(FilterModelImpl)workspace.getLookup().lookup(FilterModel.class);
      if (model == null) {
        model=new FilterModelImpl();
        workspace.add(model);
      }
    }
    public void unselect(    Workspace workspace){
    }
    public void close(    Workspace workspace){
    }
    public void disable(){
      GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
      if (model.getCurrentResult() != null) {
        graphModel.destroyView(model.getCurrentResult());
        model.setCurrentResult(null);
      }
      model=null;
    }
  }
);
  if (pc.getCurrentWorkspace() != null) {
    Workspace workspace=pc.getCurrentWorkspace();
    model=(FilterModelImpl)workspace.getLookup().lookup(FilterModel.class);
    if (model == null) {
      model=new FilterModelImpl();
      workspace.add(model);
    }
  }
}

Fixed version (ground truth):
public FilterControllerImpl(){
  PropertyEditorManager.registerEditor(Range.class,RangePropertyEditor.class);
  PropertyEditorManager.registerEditor(AttributeColumn.class,AttributeColumnPropertyEditor.class);
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  pc.addWorkspaceListener(new WorkspaceListener(){
    public void initialize(    Workspace workspace){
      workspace.add(new FilterModelImpl());
    }
    public void select(    Workspace workspace){
      model=(FilterModelImpl)workspace.getLookup().lookup(FilterModel.class);
      if (model == null) {
        model=new FilterModelImpl();
        workspace.add(model);
      }
    }
    public void unselect(    Workspace workspace){
    }
    public void close(    Workspace workspace){
    }
    public void disable(){
      GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
      if (model.getCurrentResult() != null && graphModel != null) {
        graphModel.destroyView(model.getCurrentResult());
        model.setCurrentResult(null);
      }
      model=null;
    }
  }
);
  if (pc.getCurrentWorkspace() != null) {
    Workspace workspace=pc.getCurrentWorkspace();
    model=(FilterModelImpl)workspace.getLookup().lookup(FilterModel.class);
    if (model == null) {
      model=new FilterModelImpl();
      workspace.add(model);
    }
  }
}
Program: 190351
Project: 190351
Buggy source:
public void disable(){
  GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
  if (model.getCurrentResult() != null) {
    graphModel.destroyView(model.getCurrentResult());
    model.setCurrentResult(null);
  }
  model=null;
}

Fixed version (ground truth):
public void disable(){
  GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
  if (model.getCurrentResult() != null && graphModel != null) {
    graphModel.destroyView(model.getCurrentResult());
    model.setCurrentResult(null);
  }
  model=null;
}
Program: 190352
Project: 190352
Buggy source:
public void setMax(double max){
  if (model != null) {
    model.setMaxValue(max);
  }
}

Fixed version (ground truth):
public void setMax(double max){
  if (model != null && max > model.getMaxValue()) {
    model.setMaxValue(max);
  }
}
Program: 190353
Project: 190353
Buggy source:
public void setMin(double min){
  if (model != null) {
    model.setMinValue(min);
  }
}

Fixed version (ground truth):
public void setMin(double min){
  if (model != null && min < model.getMinValue()) {
    model.setMinValue(min);
  }
}
Program: 190354
Project: 190354
Buggy source:
public void pushSlice(Workspace workspace,String from,String to,Edge edge){
  AttributeModel am=workspace.getLookup().lookup(AttributeModel.class);
  AttributeColumn col=null;
  if (am.getEdgeTable().hasColumn(COLUMN_KEY)) {
    col=am.getEdgeTable().getColumn(COLUMN_KEY);
  }
 else {
    col=am.getEdgeTable().addColumn(COLUMN_KEY,COLUMN_TYPE);
  }
  DateFormat formatter=new SimpleDateFormat(DATE_FORMAT);
  double f=Double.NEGATIVE_INFINITY, t=Double.POSITIVE_INFINITY;
  try {
    if (from != null && !from.isEmpty())     f=((Date)formatter.parse(from)).getTime();
    if (to != null && !to.isEmpty())     t=((Date)formatter.parse(to)).getTime();
    if (model.getUnit() == null) {
      model.setUnit(DateTime.class);
    }
  }
 catch (  ParseException ex) {
    try {
      if (from != null)       f=Double.parseDouble(from);
      if (to != null)       t=Double.parseDouble(to);
      if (model.getUnit() == null) {
        model.setUnit(Double.class);
      }
    }
 catch (    NumberFormatException ex2) {
      Exceptions.printStackTrace(ex);
    }
  }
  edge.getEdgeData().getAttributes().setValue(col.getIndex(),new TimeInterval(f,t));
}

Fixed version (ground truth):
public void pushSlice(Workspace workspace,String from,String to,Edge edge){
  pushSlice(workspace,from,to,(Object)edge);
}
Program: 190357
Project: 190357
Buggy source:
private void clean(){
  this.container=null;
  this.progressTicket=null;
  this.report=null;
  this.nodePropertiesAttributes=null;
  this.edgePropertiesAttributes=null;
  this.optionsAttributes=null;
  this.cancel=false;
  this.isDynamicMode=false;
  this.isDateTypeInteger=false;
  this.unknownParents=null;
}

Fixed version (ground truth):
private void clean(){
  this.container=null;
  this.progressTicket=null;
  this.report=null;
  this.nodePropertiesAttributes=null;
  this.edgePropertiesAttributes=null;
  this.optionsAttributes=null;
  this.cancel=false;
  this.isDynamicMode=false;
  this.isDateTypeFloat=false;
  this.unknownParents=null;
}
Program: 190359
Project: 190359
Buggy source:
private void refreshModelData(){
  if (consumerThread.getQueue().remainingCapacity() > 0) {
    consumerThread.execute(new Runnable(){
      public void run(){
        Graph visibleGraph=model.getGraphVisible();
        Graph fullGraph=model.getGraph();
        visibleGraph.readLock();
        fullGraph.readLock();
        final int nodesFull=fullGraph.getNodeCount();
        final int nodesVisible=visibleGraph.getNodeCount();
        final int edgesFull=fullGraph.getEdgeCount();
        final int edgesVisible=visibleGraph.getEdgeCount();
        final GraphType graphType=visibleGraph instanceof DirectedGraph ? GraphType.DIRECTED : visibleGraph instanceof UndirectedGraph ? GraphType.UNDIRECTED : GraphType.MIXED;
        fullGraph.readUnlock();
        visibleGraph.readUnlock();
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            String nodePerc=nodesFull > 0 ? "String_Node_Str" + formatter.format(nodesVisible / (double)nodesFull) + "String_Node_Str" : "String_Node_Str";
            String edgePerc=edgesFull > 0 ? "String_Node_Str" + formatter.format(edgesVisible / (double)edgesFull) + "String_Node_Str" : "String_Node_Str";
            nodeLabel.setText(String.valueOf(nodesVisible) + nodePerc);
            edgeLabel.setText(String.valueOf(edgesVisible) + edgePerc);
            graphTypeLabel.setText(graphType.type);
            double percentage=0.5 * nodesVisible / (double)nodesFull + 0.5 * edgesVisible / (double)edgesFull;
            pieChart.refreshChart(percentage);
          }
        }
);
      }
    }
);
  }
}

Fixed version (ground truth):
private void refreshModelData(){
  if (consumerThread.getQueue().remainingCapacity() > 0) {
    consumerThread.execute(new Runnable(){
      public void run(){
        Graph visibleGraph=model.getGraphVisible();
        Graph fullGraph=model.getGraph();
        final int nodesFull=fullGraph.getNodeCount();
        final int nodesVisible=visibleGraph.getNodeCount();
        final int edgesFull=fullGraph.getEdgeCount();
        final int edgesVisible=visibleGraph.getEdgeCount();
        final GraphType graphType=visibleGraph instanceof DirectedGraph ? GraphType.DIRECTED : visibleGraph instanceof UndirectedGraph ? GraphType.UNDIRECTED : GraphType.MIXED;
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            String nodePerc=nodesFull > 0 ? "String_Node_Str" + formatter.format(nodesVisible / (double)nodesFull) + "String_Node_Str" : "String_Node_Str";
            String edgePerc=edgesFull > 0 ? "String_Node_Str" + formatter.format(edgesVisible / (double)edgesFull) + "String_Node_Str" : "String_Node_Str";
            nodeLabel.setText(String.valueOf(nodesVisible) + nodePerc);
            edgeLabel.setText(String.valueOf(edgesVisible) + edgePerc);
            graphTypeLabel.setText(graphType.type);
            double percentage=0.5 * nodesVisible / (double)nodesFull + 0.5 * edgesVisible / (double)edgesFull;
            pieChart.refreshChart(percentage);
          }
        }
);
      }
    }
);
  }
}
Program: 190360
Project: 190360
Buggy source:
public boolean sendDocument(Document document){
  try {
    TransformerFactory factory=TransformerFactory.newInstance();
    Transformer transformer=factory.newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
    transformer.setOutputProperty(OutputKeys.ENCODING,"String_Node_Str");
    StringWriter sw=new StringWriter();
    StreamResult result=new StreamResult(sw);
    DOMSource source=new DOMSource(document);
    transformer.transform(source,result);
    String xmlString="String_Node_Str" + sw.toString();
    URL url=new URL(POST_URL);
    URLConnection con=url.openConnection();
    con.setDoInput(true);
    con.setDoOutput(true);
    con.setUseCaches(false);
    con.setDefaultUseCaches(false);
    OutputStreamWriter writer=new OutputStreamWriter(con.getOutputStream());
    writer.write(xmlString);
    writer.flush();
    writer.close();
    InputStreamReader reader=new InputStreamReader(con.getInputStream());
    StringBuilder buf=new StringBuilder();
    char[] cbuf=new char[2048];
    int num;
    while (-1 != (num=reader.read(cbuf))) {
      buf.append(cbuf,0,num);
    }
    String serverResult=buf.toString();
    System.err.println("String_Node_Str" + serverResult);
    return true;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return false;
}

Fixed version (ground truth):
public boolean sendDocument(Document document){
  try {
    TransformerFactory factory=TransformerFactory.newInstance();
    Transformer transformer=factory.newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
    transformer.setOutputProperty(OutputKeys.ENCODING,"String_Node_Str");
    StringWriter sw=new StringWriter();
    StreamResult result=new StreamResult(sw);
    DOMSource source=new DOMSource(document);
    transformer.transform(source,result);
    String xmlString="String_Node_Str" + URLEncoder.encode(sw.toString(),"String_Node_Str");
    URL url=new URL(POST_URL);
    URLConnection con=url.openConnection();
    con.setDoInput(true);
    con.setDoOutput(true);
    con.setUseCaches(false);
    con.setDefaultUseCaches(false);
    OutputStreamWriter writer=new OutputStreamWriter(con.getOutputStream());
    writer.write(xmlString);
    writer.flush();
    writer.close();
    InputStreamReader reader=new InputStreamReader(con.getInputStream());
    StringBuilder buf=new StringBuilder();
    char[] cbuf=new char[2048];
    int num;
    while (-1 != (num=reader.read(cbuf))) {
      buf.append(cbuf,0,num);
    }
    String serverResult=buf.toString();
    System.err.println("String_Node_Str" + serverResult);
    return true;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return false;
}
Program: 190361
Project: 190361
Buggy source:
private void logMessageLog(Report report){
  System.err.flush();
  System.out.flush();
  String ud=System.getProperty("String_Node_Str");
  if (ud == null || "String_Node_Str".equals(ud)) {
    return;
  }
  File userDir=new File(ud);
  File directory=new File(new File(userDir,"String_Node_Str"),"String_Node_Str");
  File messagesLog=new File(directory,"String_Node_Str");
  String log="String_Node_Str";
  try {
    byte[] buffer=new byte[(int)messagesLog.length()];
    BufferedInputStream f=new BufferedInputStream(new FileInputStream(messagesLog));
    f.read(buffer);
    log=new String(buffer);
  }
 catch (  Exception e) {
  }
  report.setLog(log);
}

Fixed version (ground truth):
private void logMessageLog(Report report){
  System.err.flush();
  System.out.flush();
  String ud=System.getProperty("String_Node_Str");
  if (ud == null || "String_Node_Str".equals(ud)) {
    return;
  }
  Handler[] handlers=Logger.getLogger("String_Node_Str").getHandlers();
  handlers[0].flush();
  File userDir=new File(ud);
  File directory=new File(new File(userDir,"String_Node_Str"),"String_Node_Str");
  File messagesLog=new File(directory,"String_Node_Str");
  String log="String_Node_Str";
  try {
    byte[] buffer=new byte[(int)messagesLog.length()];
    BufferedInputStream f=new BufferedInputStream(new FileInputStream(messagesLog));
    f.read(buffer);
    log=new String(buffer);
  }
 catch (  Exception e) {
  }
  report.setLog(log);
}
Program: 190362
Project: 190362
Buggy source:
private Element createAttribute(Document document,AttributeColumn column) throws Exception {
  Element attributeE=document.createElement("String_Node_Str");
  attributeE.setAttribute("String_Node_Str",column.getId());
  attributeE.setAttribute("String_Node_Str",column.getTitle());
  attributeE.setAttribute("String_Node_Str",column.getType().getTypeString().toLowerCase());
  if (column.getDefaultValue() != null) {
    Element defaultE=document.createElement("String_Node_Str");
    Text defaultTextE=document.createTextNode(column.getDefaultValue().toString());
    defaultE.appendChild(defaultTextE);
  }
  return attributeE;
}

Fixed version (ground truth):
private Element createAttribute(Document document,AttributeColumn column) throws Exception {
  Element attributeE=document.createElement("String_Node_Str");
  attributeE.setAttribute("String_Node_Str",column.getId());
  attributeE.setAttribute("String_Node_Str",column.getTitle());
switch (column.getType()) {
case INT:
    attributeE.setAttribute("String_Node_Str","String_Node_Str");
  break;
case LIST_STRING:
attributeE.setAttribute("String_Node_Str","String_Node_Str");
break;
case TIME_INTERVAL:
break;
default :
attributeE.setAttribute("String_Node_Str",column.getType().getTypeString().toLowerCase());
break;
}
if (column.getDefaultValue() != null) {
Element defaultE=document.createElement("String_Node_Str");
Text defaultTextE=document.createTextNode(column.getDefaultValue().toString());
defaultE.appendChild(defaultTextE);
}
return attributeE;
}
Program: 190363
Project: 190363
Buggy source:
public void mouseDragged(MouseEvent evt){
  if (model == null) {
    return;
  }
  currentMousePositionX=evt.getX();
  int x=currentMousePositionX;
  double w=getWidth();
  if (x > (int)w)   x=(int)w;
  if (x < 0)   x=0;
  int r=settings.selection.visibleHookWidth;
  if (currentState == TimelineState.IDLE) {
    if (inRange(x,(int)sf - 1,(int)sf + r + 1)) {
      highlightedComponent=HighlightedComponent.LEFT_HOOK;
      currentState=TimelineState.RESIZE_FROM;
    }
 else     if (inRange(x,(int)sf + r,(int)st - r)) {
      highlightedComponent=HighlightedComponent.CENTER_HOOK;
      currentState=TimelineState.MOVING;
    }
 else     if (inRange(x,(int)st - r - 1,(int)st + 1)) {
      highlightedComponent=HighlightedComponent.RIGHT_HOOK;
      currentState=TimelineState.RESIZE_TO;
    }
  }
  double delta=0;
  if (latestMousePositionX != null) {
    delta=x - latestMousePositionX;
  }
  latestMousePositionX=x;
switch (currentState) {
case RESIZE_FROM:
    if ((sf + delta <= 0)) {
      sf=0;
    }
 else     if (Math.abs(st - sf + delta) > settings.selection.minimalWidth) {
      sf+=delta;
    }
 else {
    }
  break;
case RESIZE_TO:
if ((st + delta >= w)) {
  st=w;
}
 else if (Math.abs((st + delta) - sf) > settings.selection.minimalWidth) {
  st+=delta;
}
break;
case MOVING:
if ((sf + delta <= 0)) {
sf=0;
}
 else if (st + delta >= w) {
st=w;
}
 else {
sf+=delta;
st+=delta;
}
break;
}
if (w != 0) {
newfrom=sf * (1.0 / w);
newto=st * (1.0 / w);
}
this.repaint();
}

Fixed version (ground truth):
public void mouseDragged(MouseEvent evt){
  if (model == null) {
    return;
  }
  double w=getWidth();
  currentMousePositionX=evt.getX();
  if (currentMousePositionX > (int)w) {
    currentMousePositionX=(int)w;
  }
  if (currentMousePositionX < 0) {
    currentMousePositionX=0;
  }
  int x=currentMousePositionX;
  int r=settings.selection.visibleHookWidth;
  if (currentState == TimelineState.IDLE) {
    if (inRange(x,(int)sf - 1,(int)sf + r + 1)) {
      highlightedComponent=HighlightedComponent.LEFT_HOOK;
      currentState=TimelineState.RESIZE_FROM;
    }
 else     if (inRange(x,(int)sf + r,(int)st - r)) {
      highlightedComponent=HighlightedComponent.CENTER_HOOK;
      currentState=TimelineState.MOVING;
    }
 else     if (inRange(x,(int)st - r - 1,(int)st + 1)) {
      highlightedComponent=HighlightedComponent.RIGHT_HOOK;
      currentState=TimelineState.RESIZE_TO;
    }
  }
  double delta=0;
  if (latestMousePositionX != null) {
    delta=x - latestMousePositionX;
  }
  latestMousePositionX=x;
switch (currentState) {
case RESIZE_FROM:
    if ((sf + delta <= 0)) {
      sf=0;
    }
 else     if (Math.abs(st - sf + delta) > settings.selection.minimalWidth) {
      sf+=delta;
    }
 else {
    }
  break;
case RESIZE_TO:
if ((st + delta >= w)) {
  st=w;
}
 else if (Math.abs((st + delta) - sf) > settings.selection.minimalWidth) {
  st+=delta;
}
break;
case MOVING:
if ((sf + delta <= 0)) {
sf=0;
}
 else if (st + delta >= w) {
st=w;
}
 else {
sf+=delta;
st+=delta;
}
break;
}
if (w != 0) {
newfrom=sf * (1.0 / w);
newto=st * (1.0 / w);
}
this.repaint();
}
Program: 190365
Project: 190365
Buggy source:
public void setModel(TimelineModel model){
  if (model == null) {
    return;
  }
  if (model != this.model) {
    if (this.model != null) {
    }
    this.model=model;
    sf=model.getFromFloat() * (double)getWidth();
    st=model.getToFloat() * (double)getWidth();
  }
}

Fixed version (ground truth):
public void setModel(TimelineModel model){
  if (model == null) {
    return;
  }
  if (model != this.model) {
    if (this.model != null) {
    }
    this.model=model;
    sf=model.getFromFloat() * (double)getWidth();
    st=model.getToFloat() * (double)getWidth();
    repaint();
  }
}
Program: 190366
Project: 190366
Buggy source:
public EqualBooleanFilter getFilter(){
  EqualBooleanFilter f=new EqualBooleanFilter();
  f.setColumn(column);
  return f;
}

Fixed version (ground truth):
public EqualBooleanFilter getFilter(){
  if (AttributeUtils.getDefault().isNodeColumn(column)) {
    NodeEqualBooleanFilter f=new NodeEqualBooleanFilter();
    f.setColumn(column);
    return f;
  }
 else {
    EdgeEqualBooleanFilter f=new EdgeEqualBooleanFilter();
    f.setColumn(column);
    return f;
  }
}
Program: 190367
Project: 190367
Buggy source:
public FilterBuilder[] getBuilders(){
  List<FilterBuilder> builders=new ArrayList<FilterBuilder>();
  AttributeModel am=Lookup.getDefault().lookup(AttributeController.class).getModel();
  AttributeColumn[] columns=am.getNodeTable().getColumns();
  for (  AttributeColumn c : columns) {
    if (AttributeUtils.getDefault().isStringColumn(c)) {
      EqualStringFilterBuilder b=new EqualStringFilterBuilder(c);
      builders.add(b);
    }
 else     if (AttributeUtils.getDefault().isNumberColumn(c)) {
      EqualNumberFilterBuilder b=new EqualNumberFilterBuilder(c);
      builders.add(b);
    }
 else     if (c.getType().equals(AttributeType.BOOLEAN)) {
      EqualBooleanFilterBuilder b=new EqualBooleanFilterBuilder(c);
      builders.add(b);
    }
  }
  return builders.toArray(new FilterBuilder[0]);
}

Fixed version (ground truth):
public FilterBuilder[] getBuilders(){
  List<FilterBuilder> builders=new ArrayList<FilterBuilder>();
  AttributeModel am=Lookup.getDefault().lookup(AttributeController.class).getModel();
  for (  AttributeColumn c : am.getNodeTable().getColumns()) {
    if (AttributeUtils.getDefault().isStringColumn(c)) {
      EqualStringFilterBuilder b=new EqualStringFilterBuilder(c);
      builders.add(b);
    }
 else     if (AttributeUtils.getDefault().isNumberColumn(c)) {
      EqualNumberFilterBuilder b=new EqualNumberFilterBuilder(c);
      builders.add(b);
    }
 else     if (c.getType().equals(AttributeType.BOOLEAN)) {
      EqualBooleanFilterBuilder b=new EqualBooleanFilterBuilder(c);
      builders.add(b);
    }
  }
  for (  AttributeColumn c : am.getEdgeTable().getColumns()) {
    if (AttributeUtils.getDefault().isStringColumn(c)) {
      EqualStringFilterBuilder b=new EqualStringFilterBuilder(c);
      builders.add(b);
    }
 else     if (AttributeUtils.getDefault().isNumberColumn(c)) {
      EqualNumberFilterBuilder b=new EqualNumberFilterBuilder(c);
      builders.add(b);
    }
 else     if (c.getType().equals(AttributeType.BOOLEAN)) {
      EqualBooleanFilterBuilder b=new EqualBooleanFilterBuilder(c);
      builders.add(b);
    }
  }
  return builders.toArray(new FilterBuilder[0]);
}
Program: 190368
Project: 190368
Buggy source:
public AttributeNonNullFilter getFilter(){
  AttributeNonNullFilter f=new AttributeNonNullFilter();
  f.setColumn(column);
  return f;
}

Fixed version (ground truth):
public AttributeNonNullFilter getFilter(){
  if (AttributeUtils.getDefault().isNodeColumn(column)) {
    NodeAttributeNonNullFilter f=new NodeAttributeNonNullFilter();
    f.setColumn(column);
    return f;
  }
 else {
    EdgeAttributeNonNullFilter f=new EdgeAttributeNonNullFilter();
    f.setColumn(column);
    return f;
  }
}
Program: 190369
Project: 190369
Buggy source:
public FilterBuilder[] getBuilders(){
  List<FilterBuilder> builders=new ArrayList<FilterBuilder>();
  AttributeModel am=Lookup.getDefault().lookup(AttributeController.class).getModel();
  AttributeColumn[] columns=am.getNodeTable().getColumns();
  for (  AttributeColumn c : columns) {
    AttributeNonNullFilterBuilder b=new AttributeNonNullFilterBuilder(c);
    builders.add(b);
  }
  return builders.toArray(new FilterBuilder[0]);
}

Fixed version (ground truth):
public FilterBuilder[] getBuilders(){
  List<FilterBuilder> builders=new ArrayList<FilterBuilder>();
  AttributeModel am=Lookup.getDefault().lookup(AttributeController.class).getModel();
  for (  AttributeColumn c : am.getNodeTable().getColumns()) {
    AttributeNonNullFilterBuilder b=new AttributeNonNullFilterBuilder(c);
    builders.add(b);
  }
  for (  AttributeColumn c : am.getEdgeTable().getColumns()) {
    AttributeNonNullFilterBuilder b=new AttributeNonNullFilterBuilder(c);
    builders.add(b);
  }
  return builders.toArray(new FilterBuilder[0]);
}
Program: 190370
Project: 190370
Buggy source:
public AttributeRangelFilter getFilter(){
  AttributeRangelFilter f=new AttributeRangelFilter(column);
  return f;
}

Fixed version (ground truth):
public AttributeRangeFilter getFilter(){
  if (AttributeUtils.getDefault().isNodeColumn(column)) {
    return new NodeAttributeRangeFilter(column);
  }
 else {
    return new EdgeAttributeRangeFilter(column);
  }
}
Program: 190371
Project: 190371
Buggy source:
public FilterBuilder[] getBuilders(){
  List<FilterBuilder> builders=new ArrayList<FilterBuilder>();
  AttributeModel am=Lookup.getDefault().lookup(AttributeController.class).getModel();
  AttributeColumn[] columns=am.getNodeTable().getColumns();
  for (  AttributeColumn c : columns) {
    if (AttributeUtils.getDefault().isNumberColumn(c)) {
      AttributeRangeFilterBuilder b=new AttributeRangeFilterBuilder(c);
      builders.add(b);
    }
  }
  return builders.toArray(new FilterBuilder[0]);
}

Fixed version (ground truth):
public FilterBuilder[] getBuilders(){
  List<FilterBuilder> builders=new ArrayList<FilterBuilder>();
  AttributeModel am=Lookup.getDefault().lookup(AttributeController.class).getModel();
  for (  AttributeColumn c : am.getNodeTable().getColumns()) {
    if (AttributeUtils.getDefault().isNumberColumn(c)) {
      AttributeRangeFilterBuilder b=new AttributeRangeFilterBuilder(c);
      builders.add(b);
    }
  }
  for (  AttributeColumn c : am.getEdgeTable().getColumns()) {
    if (AttributeUtils.getDefault().isNumberColumn(c)) {
      AttributeRangeFilterBuilder b=new AttributeRangeFilterBuilder(c);
      builders.add(b);
    }
  }
  return builders.toArray(new FilterBuilder[0]);
}
Program: 190372
Project: 190372
Buggy source:
public JPanel getPanel(Filter filter){
  RangeUI ui=Lookup.getDefault().lookup(RangeUI.class);
  if (ui != null) {
    return ui.getPanel((AttributeRangelFilter)filter);
  }
  return null;
}

Fixed version (ground truth):
public JPanel getPanel(Filter filter){
  RangeUI ui=Lookup.getDefault().lookup(RangeUI.class);
  if (ui != null) {
    return ui.getPanel((AttributeRangeFilter)filter);
  }
  return null;
}
Program: 190373
Project: 190373
Buggy source:
public PartitionFilter getFilter(){
  return new PartitionFilter(partition);
}

Fixed version (ground truth):
public PartitionFilter getFilter(){
  if (AttributeUtils.getDefault().isNodeColumn(column)) {
    return new NodePartitionFilter(partition);
  }
 else {
    return new EdgePartitionFilter(partition);
  }
}
Program: 190374
Project: 190374
Buggy source:
public PartitionCountFilter getFilter(){
  return new PartitionCountFilter(partition);
}

Fixed version (ground truth):
public PartitionCountFilter getFilter(){
  if (AttributeUtils.getDefault().isNodeColumn(column)) {
    return new NodePartitionCountFilter(partition);
  }
 else {
    return new EdgePartitionCountFilter(partition);
  }
}
Program: 190378
Project: 190378
Buggy source:
/** 
 * Refresh the preview applet.
 */
public void refreshPreview(){
  System.out.println("String_Node_Str" + sketch);
  sketch.refresh();
}

Fixed version (ground truth):
/** 
 * Refresh the preview applet.
 */
public void refreshPreview(){
  sketch.refresh();
}
Program: 190379
Project: 190379
Buggy source:
/** 
 * Retreives the workspace graph and builds a preview graph from it. For each build, the supervisors' lists of supervised elements are cleared because the previous preview graph is forgotten.
 * @see PreviewController#buildGraph()
 */
public void buildGraph(){
  GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
  model.clearSupervisors();
  if (graphModel.isUndirected()) {
    previewGraph=factory.createPreviewGraph(model,graphModel.getUndirectedGraph());
  }
 else   if (graphModel.isDirected()) {
    previewGraph=factory.createPreviewGraph(model,graphModel.getDirectedGraph());
  }
 else   if (graphModel.isMixed()) {
    previewGraph=factory.createPreviewGraph(model,graphModel.getMixedGraph());
  }
  model.setUpdateFlag(true);
}

Fixed version (ground truth):
/** 
 * Retreives the workspace graph and builds a preview graph from it. For each build, the supervisors' lists of supervised elements are cleared because the previous preview graph is forgotten.
 * @see PreviewController#buildGraph()
 */
public void buildGraph(){
  GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
  model.clearSupervisors();
  if (graphModel.isUndirected()) {
    previewGraph=factory.createPreviewGraph(model,graphModel.getUndirectedGraphVisible());
  }
 else   if (graphModel.isDirected()) {
    previewGraph=factory.createPreviewGraph(model,graphModel.getDirectedGraphVisible());
  }
 else   if (graphModel.isMixed()) {
    previewGraph=factory.createPreviewGraph(model,graphModel.getMixedGraphVisible());
  }
  model.setUpdateFlag(true);
}
Program: 190380
Project: 190380
Buggy source:
public void pushSlice(Workspace workspace,String from,String to,Edge edge){
  AttributeModel am=workspace.getLookup().lookup(AttributeModel.class);
  AttributeColumn col=null;
  if (am.getEdgeTable().hasColumn(COLUMN_KEY)) {
    col=am.getEdgeTable().getColumn(COLUMN_KEY);
  }
 else {
    col=am.getEdgeTable().addColumn(COLUMN_KEY,COLUMN_TYPE);
  }
  DateFormat formatter=new SimpleDateFormat(DATE_FORMAT);
  double f=Double.NEGATIVE_INFINITY, t=Double.POSITIVE_INFINITY;
  try {
    if (from != null && !from.isEmpty()) {
      f=((Date)formatter.parse(from)).getTime();
    }
    if (to != null && !to.isEmpty()) {
      t=((Date)formatter.parse(to)).getTime();
    }
  }
 catch (  ParseException ex) {
    Exceptions.printStackTrace(ex);
  }
  edge.getEdgeData().getAttributes().setValue(col.getIndex(),new TimeInterval(f,t));
}

Fixed version (ground truth):
public void pushSlice(Workspace workspace,String from,String to,Edge edge){
  AttributeModel am=workspace.getLookup().lookup(AttributeModel.class);
  AttributeColumn col=null;
  if (am.getEdgeTable().hasColumn(COLUMN_KEY)) {
    col=am.getEdgeTable().getColumn(COLUMN_KEY);
  }
 else {
    col=am.getEdgeTable().addColumn(COLUMN_KEY,COLUMN_TYPE);
  }
  DateFormat formatter=new SimpleDateFormat(DATE_FORMAT);
  double f=Double.NEGATIVE_INFINITY, t=Double.POSITIVE_INFINITY;
  try {
    if (from != null && !from.isEmpty())     f=((Date)formatter.parse(from)).getTime();
    if (to != null && !to.isEmpty())     t=((Date)formatter.parse(to)).getTime();
    if (model.getUnit() == null) {
      model.setUnit(DateTime.class);
    }
  }
 catch (  ParseException ex) {
    try {
      if (from != null)       f=Double.parseDouble(from);
      if (to != null)       t=Double.parseDouble(to);
      if (model.getUnit() == null) {
        model.setUnit(Double.class);
      }
    }
 catch (    NumberFormatException ex2) {
      Exceptions.printStackTrace(ex);
    }
  }
  edge.getEdgeData().getAttributes().setValue(col.getIndex(),new TimeInterval(f,t));
}
Program: 190381
Project: 190381
Buggy source:
@Override public void setEnabled(boolean enabled){
  for (  Component c : getComponents()) {
    c.setEnabled(enabled);
  }
  setOpaque(enabled);
}

Fixed version (ground truth):
@Override public void setEnabled(final boolean enabled){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
    }
  }
);
  setOpaque(enabled);
}
Program: 190382
Project: 190382
Buggy source:
public JComponent getComponent(){
  JPanel panel=new JPanel(new FlowLayout(FlowLayout.RIGHT,0,0)){
    @Override public void setEnabled(    boolean enabled){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
      setOpaque(enabled);
    }
  }
;
  panel.add(new HierarchyAddonButton());
  panel.setBackground(Color.WHITE);
  return panel;
}

Fixed version (ground truth):
public JComponent getComponent(){
  JPanel panel=new JPanel(new FlowLayout(FlowLayout.RIGHT,0,0)){
    @Override public void setEnabled(    final boolean enabled){
      SwingUtilities.invokeLater(new Runnable(){
        public void run(){
          for (          Component c : getComponents()) {
            c.setEnabled(enabled);
          }
        }
      }
);
      setOpaque(enabled);
    }
  }
;
  panel.add(new HierarchyAddonButton());
  panel.setBackground(Color.WHITE);
  return panel;
}
Program: 190383
Project: 190383
Buggy source:
@Override public void setEnabled(boolean enabled){
  for (  Component c : getComponents()) {
    c.setEnabled(enabled);
  }
}

Fixed version (ground truth):
@Override public void setEnabled(final boolean enabled){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
    }
  }
);
}
Program: 190384
Project: 190384
Buggy source:
@Override public void setEnabled(boolean enabled){
  for (  Component c : getComponents()) {
    c.setEnabled(enabled);
  }
}

Fixed version (ground truth):
@Override public void setEnabled(final boolean enabled){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
    }
  }
);
}
Program: 190385
Project: 190385
Buggy source:
@Override public void setEnabled(boolean enabled){
  for (  Component c : getComponents()) {
    c.setEnabled(enabled);
  }
  selectionBar.setEnabled(enabled);
}

Fixed version (ground truth):
@Override public void setEnabled(final boolean enabled){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
      selectionBar.setEnabled(enabled);
    }
  }
);
}
Program: 190386
Project: 190386
Buggy source:
@Override public void setEnabled(boolean enabled){
  for (  Component c : getComponents()) {
    c.setEnabled(enabled);
  }
}

Fixed version (ground truth):
@Override public void setEnabled(final boolean enabled){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
    }
  }
);
}
Program: 190387
Project: 190387
Buggy source:
@Override public void setEnabled(boolean enabled){
  for (  Component c : getComponents()) {
    c.setEnabled(enabled);
  }
}

Fixed version (ground truth):
@Override public void setEnabled(final boolean enabled){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
    }
  }
);
}
Program: 190388
Project: 190388
Buggy source:
@Override public void setEnabled(boolean enabled){
  for (  Component c : getComponents()) {
    c.setEnabled(enabled);
  }
}

Fixed version (ground truth):
@Override public void setEnabled(final boolean enabled){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      Component c : getComponents()) {
        c.setEnabled(enabled);
      }
    }
  }
);
}
Program: 190390
Project: 190390
Buggy source:
public void writeLock(){
  if (SwingUtilities.isEventDispatchThread()) {
    Throwable r=new RuntimeException();
    int i=0;
    for (i=0; i < r.getStackTrace().length; i++) {
      if (!r.getStackTrace()[i].toString().startsWith("String_Node_Str")) {
        break;
      }
    }
    System.err.println("String_Node_Str" + r.getStackTrace()[i].toString());
  }
  dhns.getWriteLock().lock();
}

Fixed version (ground truth):
public void writeLock(){
  if (SwingUtilities.isEventDispatchThread()) {
    Throwable r=new RuntimeException();
    int i=0;
    for (i=0; i < r.getStackTrace().length; i++) {
      if (!r.getStackTrace()[i].toString().startsWith("String_Node_Str")) {
        break;
      }
    }
  }
  dhns.getWriteLock().lock();
}
Program: 190391
Project: 190391
Buggy source:
public void readLock(){
  if (SwingUtilities.isEventDispatchThread()) {
    Throwable r=new RuntimeException();
    int i=0;
    for (i=0; i < r.getStackTrace().length; i++) {
      if (!r.getStackTrace()[i].toString().startsWith("String_Node_Str")) {
        break;
      }
    }
    System.err.println("String_Node_Str" + r.getStackTrace()[i].toString());
  }
  dhns.getReadLock().lock();
}

Fixed version (ground truth):
public void readLock(){
  if (SwingUtilities.isEventDispatchThread()) {
    Throwable r=new RuntimeException();
    int i=0;
    for (i=0; i < r.getStackTrace().length; i++) {
      if (!r.getStackTrace()[i].toString().startsWith("String_Node_Str")) {
        break;
      }
    }
  }
  dhns.getReadLock().lock();
}