nus-yam/ex-repair huggingface dataset:
Program: 190222
Project: 190222
Buggy source:
public boolean canExpand(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (graph.getDescendantCount(node) > 0) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean canExpand(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (node != null && graph.getDescendantCount(node) > 0) {
      return true;
    }
  }
  return false;
}
Program: 190223
Project: 190223
Buggy source:
public void expand(){
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        for (        ModelImpl metaModelImpl : models) {
          Node node=((NodeData)metaModelImpl.getObj()).getNode(graph.getView().getViewId());
          if (graph.getDescendantCount(node) > 0) {
            expandPositioning(node);
            graph.expand(node);
          }
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
        graph.readUnlockAll();
      }
    }
  }
,"String_Node_Str").start();
}

Fixed version (ground truth):
public void expand(){
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        for (        ModelImpl metaModelImpl : models) {
          Node node=((NodeData)metaModelImpl.getObj()).getNode(graph.getView().getViewId());
          if (node != null && graph.getDescendantCount(node) > 0) {
            expandPositioning(node);
            graph.expand(node);
          }
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
        graph.readUnlockAll();
      }
    }
  }
,"String_Node_Str").start();
}
Program: 190224
Project: 190224
Buggy source:
public boolean canDelete(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  return selectedNodeModels.length >= 1;
}

Fixed version (ground truth):
public boolean canDelete(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  int nodesReallyPresent=0;
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (node != null) {
      nodesReallyPresent++;
    }
  }
  return nodesReallyPresent >= 1;
}
Program: 190225
Project: 190225
Buggy source:
public boolean canContract(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (graph.getParent(node) != null) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean canContract(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (node != null && graph.getParent(node) != null) {
      return true;
    }
  }
  return false;
}
Program: 190227
Project: 190227
Buggy source:
public void select(Workspace workspace){
  hideTable();
  enableTableControls();
  bannerPanel.setVisible(false);
  AttributeModel attributeModel=Lookup.getDefault().lookup(AttributeController.class).getModel();
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  refreshAll();
}

Fixed version (ground truth):
public void select(Workspace workspace){
  Lookup.getDefault().lookup(DataTablesController.class).setDataTablesEventListener(DataTableTopComponent.this);
  hideTable();
  enableTableControls();
  bannerPanel.setVisible(false);
  AttributeModel attributeModel=Lookup.getDefault().lookup(AttributeController.class).getModel();
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  refreshAll();
}
Program: 190229
Project: 190229
Buggy source:
public void unselectAll(){
  filterProperties[1].setValue(new ArrayList<Part>());
}

Fixed version (ground truth):
public void unselectAll(){
  getProperties()[1].setValue(new ArrayList<Part>());
}
Program: 190230
Project: 190230
Buggy source:
public void removePart(Part part){
  List<Part> newParts=new ArrayList<Part>(parts);
  if (newParts.remove(part)) {
    filterProperties[1].setValue(newParts);
  }
}

Fixed version (ground truth):
public void removePart(Part part){
  List<Part> newParts=new ArrayList<Part>(parts);
  if (newParts.remove(part)) {
    getProperties()[1].setValue(newParts);
  }
}
Program: 190231
Project: 190231
Buggy source:
public void selectAll(){
  filterProperties[1].setValue(Arrays.asList(partition.getParts()));
}

Fixed version (ground truth):
public void selectAll(){
  getProperties()[1].setValue(Arrays.asList(partition.getParts()));
}
Program: 190232
Project: 190232
Buggy source:
public void addPart(Part part){
  if (!parts.contains(part)) {
    List<Part> newParts=new ArrayList<Part>(parts.size() + 1);
    newParts.addAll(parts);
    newParts.add(part);
    filterProperties[1].setValue(newParts);
  }
}

Fixed version (ground truth):
public void addPart(Part part){
  if (!parts.contains(part)) {
    List<Part> newParts=new ArrayList<Part>(parts.size() + 1);
    newParts.addAll(parts);
    newParts.add(part);
    getProperties()[1].setValue(newParts);
  }
}
Program: 190233
Project: 190233
Buggy source:
/** 
 * @param graphModel
 */
public void execute(GraphModel graphModel,AttributeModel attributeModel){
  mIsCanceled=false;
  mAvgInDegree=mAvgOutDegree=0.0;
  AttributeTable nodeTable=attributeModel.getNodeTable();
  AttributeColumn inCol=nodeTable.getColumn(INDEGREE);
  AttributeColumn outCol=nodeTable.getColumn(OUTDEGREE);
  if (inCol == null) {
    inCol=nodeTable.addColumn(INDEGREE,"String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,0);
  }
  if (outCol == null) {
    outCol=nodeTable.addColumn(OUTDEGREE,"String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,0);
  }
  DirectedGraph graph=graphModel.getDirectedGraphVisible();
  int i=0;
  graph.readLock();
  this.mGraphRevision="String_Node_Str" + graph.getNodeVersion() + "String_Node_Str"+ graph.getEdgeVersion()+ "String_Node_Str";
  Progress.start(mProgress,graph.getNodeCount());
  for (  Node n : graph.getNodes()) {
    AttributeRow row=(AttributeRow)n.getNodeData().getAttributes();
    row.setValue(inCol,graph.getInDegree(n));
    row.setValue(outCol,graph.getOutDegree(n));
    mAvgInDegree+=graph.getInDegree(n);
    mAvgOutDegree+=graph.getOutDegree(n);
    if (mIsCanceled) {
      break;
    }
    i++;
    mProgress.progress(i);
  }
  mAvgDegree=mAvgInDegree + mAvgOutDegree;
  mAvgInDegree/=graph.getNodeCount();
  mAvgOutDegree/=graph.getNodeCount();
  mAvgDegree/=graph.getNodeCount();
  graph.readUnlockAll();
}

Fixed version (ground truth):
/** 
 * @param graphModel
 */
public void execute(GraphModel graphModel,AttributeModel attributeModel){
  mIsCanceled=false;
  mAvgInDegree=mAvgOutDegree=0.0;
  AttributeTable nodeTable=attributeModel.getNodeTable();
  AttributeColumn inCol=nodeTable.getColumn(INDEGREE);
  AttributeColumn outCol=nodeTable.getColumn(OUTDEGREE);
  if (inCol == null) {
    inCol=nodeTable.addColumn(INDEGREE,"String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,0);
  }
  if (outCol == null) {
    outCol=nodeTable.addColumn(OUTDEGREE,"String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,0);
  }
  DirectedGraph graph=graphModel.getDirectedGraphVisible();
  int i=0;
  graph.readLock();
  this.mGraphRevision="String_Node_Str" + graph.getNodeVersion() + "String_Node_Str"+ graph.getEdgeVersion()+ "String_Node_Str";
  Progress.start(mProgress,graph.getNodeCount());
  for (  Node n : graph.getNodes()) {
    AttributeRow row=(AttributeRow)n.getNodeData().getAttributes();
    row.setValue(inCol,graph.getInDegree(n));
    row.setValue(outCol,graph.getOutDegree(n));
    mAvgInDegree+=graph.getInDegree(n);
    mAvgOutDegree+=graph.getOutDegree(n);
    if (mIsCanceled) {
      break;
    }
    i++;
    Progress.progress(mProgress,i);
  }
  mAvgDegree=mAvgInDegree + mAvgOutDegree;
  mAvgInDegree/=graph.getNodeCount();
  mAvgOutDegree/=graph.getNodeCount();
  mAvgDegree/=graph.getNodeCount();
  graph.readUnlockAll();
}
Program: 190235
Project: 190235
Buggy source:
private SearchResult matchRegex(Object value,SearchOptions searchOptions,int rowIndex,int columnIndex){
  boolean found;
  String str=value != null ? value.toString() : "String_Node_Str";
  Matcher matcher=searchOptions.getRegexPattern().matcher(str);
  if (searchOptions.getRegionStart() >= str.length()) {
    return null;
  }
  if (searchOptions.isOnlyMatchWholeAttributeValue()) {
    found=matcher.matches();
  }
 else {
    matcher.region(searchOptions.getRegionStart(),str.length());
    found=matcher.find();
  }
  if (found) {
    searchOptions.setStartingRow(rowIndex);
    searchOptions.setStartingColumn(columnIndex);
    searchOptions.setRegionStart(matcher.end() + 1);
    return new SearchResult(searchOptions,null,null,rowIndex,columnIndex,matcher.start(),matcher.end());
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
private SearchResult matchRegex(Object value,SearchOptions searchOptions,int rowIndex,int columnIndex){
  boolean found;
  String str=value != null ? value.toString() : "String_Node_Str";
  Matcher matcher=searchOptions.getRegexPattern().matcher(str);
  if (searchOptions.getRegionStart() >= str.length()) {
    return null;
  }
  if (searchOptions.isOnlyMatchWholeAttributeValue()) {
    found=matcher.matches();
  }
 else {
    matcher.region(searchOptions.getRegionStart(),str.length());
    found=matcher.find();
  }
  if (found) {
    searchOptions.setStartingRow(rowIndex);
    searchOptions.setStartingColumn(columnIndex);
    searchOptions.setRegionStart(matcher.end());
    return new SearchResult(searchOptions,null,null,rowIndex,columnIndex,matcher.start(),matcher.end());
  }
 else {
    return null;
  }
}
Program: 190236
Project: 190236
Buggy source:
public void execute(){
  SearchReplaceUI ui=Lookup.getDefault().lookup(SearchReplaceUI.class);
  if (Lookup.getDefault().lookup(DataTablesController.class).isNodeTableMode()) {
    ui.setMode(SearchReplaceUI.Mode.NODES_TABLE);
  }
 else {
    ui.setMode(SearchReplaceUI.Mode.EDGES_TABLE);
  }
  DialogDescriptor dd=new DialogDescriptor(ui,getName());
  dd.setModal(false);
  dd.setOptions(new Object[]{NbBundle.getMessage(SearchReplace.class,"String_Node_Str")});
  DialogDisplayer.getDefault().notify(dd);
}

Fixed version (ground truth):
public void execute(){
  SearchReplaceUI ui=Lookup.getDefault().lookup(SearchReplaceUI.class);
  if (Lookup.getDefault().lookup(DataTablesController.class).isNodeTableMode()) {
    ui.setMode(SearchReplaceUI.Mode.NODES_TABLE);
  }
 else {
    ui.setMode(SearchReplaceUI.Mode.EDGES_TABLE);
  }
  DialogDescriptor dd=new DialogDescriptor(ui,getName());
  dd.setModal(true);
  dd.setOptions(new Object[]{NbBundle.getMessage(SearchReplace.class,"String_Node_Str")});
  DialogDisplayer.getDefault().notify(dd);
}
Program: 190237
Project: 190237
Buggy source:
public Object getValue(){
  if (!column.getOrigin().isDelegate())   return value;
 else {
    Object delegateIdValue=row.getDelegateIdValue();
    PropertiesColumn propertiesColumn=column.getOrigin().getPropertiesColumn();
    AttributeValueDelegateProvider attributeValueDelegateProvider=PropertyColumnToAttributeValueDelegateProviderMapper.getInstance().get(propertiesColumn);
    if (row.attributeTable.isEdgeTable())     return attributeValueDelegateProvider.getEdgeValue(column,delegateIdValue);
 else     if (row.attributeTable.isNodeTable())     return attributeValueDelegateProvider.getNodeValue(column,delegateIdValue);
 else     throw new AssertionError();
  }
}

Fixed version (ground truth):
public Object getValue(){
  if (!column.getOrigin().isDelegate()) {
    System.out.println("String_Node_Str" + column.getOrigin());
    System.out.println("String_Node_Str" + column.getOrigin().isDelegate());
    System.out.println();
    return value;
  }
 else {
    System.out.println("String_Node_Str");
    Object delegateIdValue=1L;
    PropertiesColumn propertiesColumn=column.getOrigin().getPropertiesColumn();
    AttributeValueDelegateProvider attributeValueDelegateProvider=PropertyColumnToAttributeValueDelegateProviderMapper.getInstance().get(propertiesColumn);
    return attributeValueDelegateProvider.getEdgeValue(column,delegateIdValue);
  }
}
Program: 190238
Project: 190238
Buggy source:
void setAttributeRow(AttributeRowImpl row){
  this.row=row;
}

Fixed version (ground truth):
void setAttributeRow(AttributeRowImpl row){
  System.out.println("String_Node_Str" + row);
  this.row=row;
}
Program: 190240
Project: 190240
Buggy source:
@Override public void run(){
  neo4jImporter.importLocal(neo4jDirectory);
}

Fixed version (ground truth):
@Override public void run(){
  neo4jExporter.exportLocal(neo4jDirectory);
}
Program: 190241
Project: 190241
Buggy source:
public void select(Workspace workspace){
  elementGroup.clearSelection();
  tableScrollPane.setViewportView(null);
  nodesButton.setEnabled(true);
  edgesButton.setEnabled(true);
  filterTextField.setEnabled(true);
  labelFilter.setEnabled(true);
  visibleGraphCheckbox.setEnabled(true);
  bannerPanel.setVisible(false);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
  refresh();
}

Fixed version (ground truth):
public void select(Workspace workspace){
  hideTable();
  enableControls();
  bannerPanel.setVisible(false);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
  refresh();
}
Program: 190242
Project: 190242
Buggy source:
private DataTableTopComponent(){
  dynamicFiltering=NbPreferences.forModule(DataTableTopComponent.class).getBoolean(DATA_LABORATORY_DYNAMIC_FILTERING,true);
  taskExecutor=new ThreadPoolExecutor(0,1,10L,TimeUnit.SECONDS,new LinkedBlockingDeque<Runnable>(20),new ThreadFactory(){
    public Thread newThread(    Runnable r){
      return new Thread(r,"String_Node_Str");
    }
  }
);
  initComponents();
  setName(NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"));
  setIcon(ImageUtilities.loadImage(ICON_PATH));
  Border b=(Border)UIManager.get("String_Node_Str");
  controlToolbar.setBorder(b);
  if (UIUtils.isAquaLookAndFeel()) {
    controlToolbar.setBackground(UIManager.getColor("String_Node_Str"));
  }
  initEvents();
  nodeTable=new NodeDataTable();
  edgeTable=new EdgeDataTable();
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  if (pc.getCurrentWorkspace() == null) {
    nodesButton.setEnabled(false);
    edgesButton.setEnabled(false);
    filterTextField.setEnabled(false);
    labelFilter.setEnabled(false);
    bannerPanel.setVisible(false);
    visibleGraphCheckbox.setEnabled(false);
  }
 else {
    refresh();
  }
  bannerPanel.setVisible(false);
}

Fixed version (ground truth):
private DataTableTopComponent(){
  dynamicFiltering=NbPreferences.forModule(DataTableTopComponent.class).getBoolean(DATA_LABORATORY_DYNAMIC_FILTERING,true);
  taskExecutor=new ThreadPoolExecutor(0,1,10L,TimeUnit.SECONDS,new LinkedBlockingDeque<Runnable>(20),new ThreadFactory(){
    public Thread newThread(    Runnable r){
      return new Thread(r,"String_Node_Str");
    }
  }
);
  initComponents();
  setName(NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"));
  setIcon(ImageUtilities.loadImage(ICON_PATH));
  Border b=(Border)UIManager.get("String_Node_Str");
  controlToolbar.setBorder(b);
  if (UIUtils.isAquaLookAndFeel()) {
    controlToolbar.setBackground(UIManager.getColor("String_Node_Str"));
  }
  initEvents();
  nodeTable=new NodeDataTable();
  edgeTable=new EdgeDataTable();
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  if (pc.getCurrentWorkspace() == null) {
    clear();
  }
 else {
    refresh();
  }
  bannerPanel.setVisible(false);
}
Program: 190243
Project: 190243
Buggy source:
private void clear(){
  tableScrollPane.setViewport(null);
}

Fixed version (ground truth):
private void clear(){
  elementGroup.clearSelection();
  nodesButton.setEnabled(false);
  edgesButton.setEnabled(false);
  filterTextField.setEnabled(false);
  labelFilter.setEnabled(false);
  bannerPanel.setVisible(false);
  visibleGraphCheckbox.setEnabled(false);
  hideTable();
}
Program: 190244
Project: 190244
Buggy source:
private void refresh(){
  bannerPanel.setVisible(false);
  if (classDisplayed.equals(ClassDisplayed.NODE)) {
    initNodesView();
  }
 else   if (classDisplayed.equals(ClassDisplayed.EDGE)) {
    initEdgesView();
  }
}

Fixed version (ground truth):
private void refresh(){
  bannerPanel.setVisible(false);
  if (classDisplayed.equals(ClassDisplayed.NODE)) {
    nodesButton.setSelected(true);
    initNodesView();
  }
 else   if (classDisplayed.equals(ClassDisplayed.EDGE)) {
    edgesButton.setSelected(true);
    initEdgesView();
  }
}
Program: 190246
Project: 190246
Buggy source:
public void disable(){
  elementGroup.clearSelection();
  nodesButton.setEnabled(false);
  edgesButton.setEnabled(false);
  filterTextField.setEnabled(false);
  labelFilter.setEnabled(false);
  bannerPanel.setVisible(false);
  visibleGraphCheckbox.setEnabled(false);
  clear();
}

Fixed version (ground truth):
public void disable(){
  clear();
}
Program: 190247
Project: 190247
Buggy source:
public void initialize(Workspace workspace){
  workspace.add(new DataTablesModel());
  refresh();
}

Fixed version (ground truth):
public void initialize(Workspace workspace){
  workspace.add(new DataTablesModel());
}
Program: 190248
Project: 190248
Buggy source:
public void select(Workspace workspace){
  elementGroup.clearSelection();
  tableScrollPane.setViewportView(null);
  nodesButton.setEnabled(true);
  edgesButton.setEnabled(true);
  filterTextField.setEnabled(true);
  labelFilter.setEnabled(true);
  visibleGraphCheckbox.setEnabled(true);
  bannerPanel.setVisible(false);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
}

Fixed version (ground truth):
public void select(Workspace workspace){
  elementGroup.clearSelection();
  tableScrollPane.setViewportView(null);
  nodesButton.setEnabled(true);
  edgesButton.setEnabled(true);
  filterTextField.setEnabled(true);
  labelFilter.setEnabled(true);
  visibleGraphCheckbox.setEnabled(true);
  bannerPanel.setVisible(false);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
  refresh();
}
Program: 190249
Project: 190249
Buggy source:
public void unselect(Workspace workspace){
  graphModel.removeGraphListener(DataTableTopComponent.this);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().removeAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().removeAttributeListener(DataTableTopComponent.this);
  graphModel=null;
  dataTablesModel=null;
}

Fixed version (ground truth):
public void unselect(Workspace workspace){
  graphModel.removeGraphListener(DataTableTopComponent.this);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().removeAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().removeAttributeListener(DataTableTopComponent.this);
  graphModel=null;
  dataTablesModel=null;
  clear();
}
Program: 190250
Project: 190250
Buggy source:
public void close(Workspace workspace){
}

Fixed version (ground truth):
public void close(Workspace workspace){
  clear();
}
Program: 190251
Project: 190251
Buggy source:
private DataTableTopComponent(){
  dynamicFiltering=NbPreferences.forModule(DataTableTopComponent.class).getBoolean(DATA_LABORATORY_DYNAMIC_FILTERING,true);
  taskExecutor=new ThreadPoolExecutor(0,1,10L,TimeUnit.SECONDS,new LinkedBlockingDeque<Runnable>(20),new ThreadFactory(){
    public Thread newThread(    Runnable r){
      return new Thread(r,"String_Node_Str");
    }
  }
);
  initComponents();
  setName(NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"));
  setIcon(ImageUtilities.loadImage(ICON_PATH));
  Border b=(Border)UIManager.get("String_Node_Str");
  controlToolbar.setBorder(b);
  if (UIUtils.isAquaLookAndFeel()) {
    controlToolbar.setBackground(UIManager.getColor("String_Node_Str"));
  }
  initEvents();
  nodeTable=new NodeDataTable();
  edgeTable=new EdgeDataTable();
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  if (pc.getCurrentWorkspace() == null) {
    nodesButton.setEnabled(false);
    edgesButton.setEnabled(false);
    filterTextField.setEnabled(false);
    labelFilter.setEnabled(false);
    bannerPanel.setVisible(false);
    visibleGraphCheckbox.setEnabled(false);
  }
  bannerPanel.setVisible(false);
}

Fixed version (ground truth):
private DataTableTopComponent(){
  dynamicFiltering=NbPreferences.forModule(DataTableTopComponent.class).getBoolean(DATA_LABORATORY_DYNAMIC_FILTERING,true);
  taskExecutor=new ThreadPoolExecutor(0,1,10L,TimeUnit.SECONDS,new LinkedBlockingDeque<Runnable>(20),new ThreadFactory(){
    public Thread newThread(    Runnable r){
      return new Thread(r,"String_Node_Str");
    }
  }
);
  initComponents();
  setName(NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"));
  setIcon(ImageUtilities.loadImage(ICON_PATH));
  Border b=(Border)UIManager.get("String_Node_Str");
  controlToolbar.setBorder(b);
  if (UIUtils.isAquaLookAndFeel()) {
    controlToolbar.setBackground(UIManager.getColor("String_Node_Str"));
  }
  initEvents();
  nodeTable=new NodeDataTable();
  edgeTable=new EdgeDataTable();
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  if (pc.getCurrentWorkspace() == null) {
    nodesButton.setEnabled(false);
    edgesButton.setEnabled(false);
    filterTextField.setEnabled(false);
    labelFilter.setEnabled(false);
    bannerPanel.setVisible(false);
    visibleGraphCheckbox.setEnabled(false);
  }
 else {
    refresh();
  }
  bannerPanel.setVisible(false);
}
Program: 190253
Project: 190253
Buggy source:
public void disable(){
  elementGroup.clearSelection();
  nodesButton.setEnabled(false);
  edgesButton.setEnabled(false);
  filterTextField.setEnabled(false);
  labelFilter.setEnabled(false);
  bannerPanel.setVisible(false);
  visibleGraphCheckbox.setEnabled(false);
}

Fixed version (ground truth):
public void disable(){
  elementGroup.clearSelection();
  nodesButton.setEnabled(false);
  edgesButton.setEnabled(false);
  filterTextField.setEnabled(false);
  labelFilter.setEnabled(false);
  bannerPanel.setVisible(false);
  visibleGraphCheckbox.setEnabled(false);
  clear();
}
Program: 190254
Project: 190254
Buggy source:
public void initialize(Workspace workspace){
  workspace.add(new DataTablesModel());
}

Fixed version (ground truth):
public void initialize(Workspace workspace){
  workspace.add(new DataTablesModel());
  refresh();
}
Program: 190255
Project: 190255
Buggy source:
private JMenuItem createMenuItemFromEdgesManipulator(final EdgesManipulator em){
  JMenuItem menuItem=new JMenuItem();
  menuItem.setText(em.getName());
  menuItem.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      em.execute();
    }
  }
);
  return menuItem;
}

Fixed version (ground truth):
private JMenuItem createMenuItemFromEdgesManipulator(final EdgesManipulator em){
  JMenuItem menuItem=new JMenuItem();
  menuItem.setText(em.getName());
  menuItem.setIcon(em.getIcon());
  menuItem.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      em.execute();
    }
  }
);
  return menuItem;
}
Program: 190256
Project: 190256
Buggy source:
private JMenuItem createMenuItemFromNodesManipulator(final NodesManipulator nm){
  JMenuItem menuItem=new JMenuItem();
  menuItem.setText(nm.getName());
  menuItem.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      nm.execute();
    }
  }
);
  return menuItem;
}

Fixed version (ground truth):
private JMenuItem createMenuItemFromNodesManipulator(final NodesManipulator nm){
  JMenuItem menuItem=new JMenuItem();
  menuItem.setText(nm.getName());
  menuItem.setIcon(nm.getIcon());
  menuItem.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      nm.execute();
    }
  }
);
  return menuItem;
}
Program: 190258
Project: 190258
Buggy source:
public void select(Workspace workspace){
  elementGroup.clearSelection();
  tableScrollPane.setViewportView(null);
  nodesButton.setEnabled(true);
  edgesButton.setEnabled(true);
  filterTextField.setEnabled(true);
  labelFilter.setEnabled(true);
  visibleGraphCheckbox.setEnabled(true);
  bannerPanel.setVisible(false);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
}

Fixed version (ground truth):
public void select(Workspace workspace){
  elementGroup.clearSelection();
  tableScrollPane.setViewportView(null);
  nodesButton.setEnabled(true);
  edgesButton.setEnabled(true);
  filterTextField.setEnabled(true);
  labelFilter.setEnabled(true);
  visibleGraphCheckbox.setEnabled(true);
  bannerPanel.setVisible(false);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
  refresh();
}
Program: 190259
Project: 190259
Buggy source:
public void unselect(Workspace workspace){
  graphModel.removeGraphListener(DataTableTopComponent.this);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().removeAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().removeAttributeListener(DataTableTopComponent.this);
  graphModel=null;
  dataTablesModel=null;
}

Fixed version (ground truth):
public void unselect(Workspace workspace){
  graphModel.removeGraphListener(DataTableTopComponent.this);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().removeAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().removeAttributeListener(DataTableTopComponent.this);
  graphModel=null;
  dataTablesModel=null;
  clear();
}
Program: 190260
Project: 190260
Buggy source:
private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt){
  bannerPanel.setVisible(false);
  if (classDisplayed.equals(ClassDisplayed.NODE)) {
    initNodesView();
  }
 else   if (classDisplayed.equals(ClassDisplayed.EDGE)) {
    initEdgesView();
  }
}

Fixed version (ground truth):
private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt){
  refresh();
}
Program: 190261
Project: 190261
Buggy source:
public void close(Workspace workspace){
}

Fixed version (ground truth):
public void close(Workspace workspace){
  clear();
}
Program: 190262
Project: 190262
Buggy source:
private DataTableTopComponent(){
  dynamicFiltering=NbPreferences.forModule(DataTableTopComponent.class).getBoolean(DATA_LABORATORY_DYNAMIC_FILTERING,true);
  taskExecutor=new ThreadPoolExecutor(0,1,10L,TimeUnit.SECONDS,new LinkedBlockingDeque<Runnable>(20),new ThreadFactory(){
    public Thread newThread(    Runnable r){
      return new Thread(r,"String_Node_Str");
    }
  }
);
  initComponents();
  setName(NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"));
  setIcon(ImageUtilities.loadImage(ICON_PATH));
  Border b=(Border)UIManager.get("String_Node_Str");
  controlToolbar.setBorder(b);
  if (UIUtils.isAquaLookAndFeel()) {
    controlToolbar.setBackground(UIManager.getColor("String_Node_Str"));
  }
  initEvents();
  nodeTable=new NodeDataTable();
  edgeTable=new EdgeDataTable();
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  if (pc.getCurrentWorkspace() == null) {
    nodesButton.setEnabled(false);
    edgesButton.setEnabled(false);
    filterTextField.setEnabled(false);
    labelFilter.setEnabled(false);
    bannerPanel.setVisible(false);
    visibleGraphCheckbox.setEnabled(false);
  }
  bannerPanel.setVisible(false);
}

Fixed version (ground truth):
private DataTableTopComponent(){
  dynamicFiltering=NbPreferences.forModule(DataTableTopComponent.class).getBoolean(DATA_LABORATORY_DYNAMIC_FILTERING,true);
  taskExecutor=new ThreadPoolExecutor(0,1,10L,TimeUnit.SECONDS,new LinkedBlockingDeque<Runnable>(20),new ThreadFactory(){
    public Thread newThread(    Runnable r){
      return new Thread(r,"String_Node_Str");
    }
  }
);
  initComponents();
  setName(NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"));
  setIcon(ImageUtilities.loadImage(ICON_PATH));
  Border b=(Border)UIManager.get("String_Node_Str");
  controlToolbar.setBorder(b);
  if (UIUtils.isAquaLookAndFeel()) {
    controlToolbar.setBackground(UIManager.getColor("String_Node_Str"));
  }
  initEvents();
  nodeTable=new NodeDataTable();
  edgeTable=new EdgeDataTable();
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  if (pc.getCurrentWorkspace() == null) {
    nodesButton.setEnabled(false);
    edgesButton.setEnabled(false);
    filterTextField.setEnabled(false);
    labelFilter.setEnabled(false);
    bannerPanel.setVisible(false);
    visibleGraphCheckbox.setEnabled(false);
  }
 else {
    refresh();
  }
  bannerPanel.setVisible(false);
}
Program: 190264
Project: 190264
Buggy source:
public void disable(){
  elementGroup.clearSelection();
  nodesButton.setEnabled(false);
  edgesButton.setEnabled(false);
  filterTextField.setEnabled(false);
  labelFilter.setEnabled(false);
  bannerPanel.setVisible(false);
  visibleGraphCheckbox.setEnabled(false);
}

Fixed version (ground truth):
public void disable(){
  elementGroup.clearSelection();
  nodesButton.setEnabled(false);
  edgesButton.setEnabled(false);
  filterTextField.setEnabled(false);
  labelFilter.setEnabled(false);
  bannerPanel.setVisible(false);
  visibleGraphCheckbox.setEnabled(false);
  clear();
}
Program: 190265
Project: 190265
Buggy source:
public void initialize(Workspace workspace){
  workspace.add(new DataTablesModel());
}

Fixed version (ground truth):
public void initialize(Workspace workspace){
  workspace.add(new DataTablesModel());
  refresh();
}
Program: 190267
Project: 190267
Buggy source:
@Override public void run(){
  neo4jImporter.importLocal(neo4jDirectory);
}

Fixed version (ground truth):
@Override public void run(){
  neo4jImporter.importRemote("String_Node_Str");
}
Program: 190268
Project: 190268
Buggy source:
public void refreshModel(StatisticsModel model){
  currentModel=model;
  if (model == null) {
    runButton.setText(RUN);
    runButton.setEnabled(false);
    busyLabel.setBusy(false);
    busyLabel.setVisible(false);
    reportButton.setEnabled(false);
    resultLabel.setText("String_Node_Str");
    currentStatistics=null;
    return;
  }
  runButton.setEnabled(true);
  if (model.isRunning(statisticsUI)) {
    runButton.setText(CANCEL);
    busyLabel.setVisible(true);
    busyLabel.setBusy(true);
    reportButton.setEnabled(false);
    resultLabel.setText("String_Node_Str");
  }
 else {
    runButton.setText(RUN);
    busyLabel.setBusy(false);
    busyLabel.setVisible(false);
    currentStatistics=null;
    refreshResult(model);
  }
}

Fixed version (ground truth):
public void refreshModel(StatisticsModel model){
  currentModel=model;
  if (model == null) {
    runButton.setText(RUN);
    runButton.setEnabled(false);
    busyLabel.setBusy(false);
    busyLabel.setVisible(false);
    reportButton.setEnabled(false);
    resultLabel.setText("String_Node_Str");
    currentStatistics=null;
    return;
  }
  runButton.setEnabled(true);
  if (model.isRunning(statisticsUI)) {
    runButton.setText(CANCEL);
    busyLabel.setVisible(true);
    busyLabel.setBusy(true);
    reportButton.setEnabled(false);
    resultLabel.setText("String_Node_Str");
    if (currentStatistics == null) {
      currentStatistics=currentModel.getStatistics(statisticsUI);
    }
  }
 else {
    runButton.setText(RUN);
    busyLabel.setBusy(false);
    busyLabel.setVisible(false);
    currentStatistics=null;
    refreshResult(model);
  }
}
Program: 190269
Project: 190269
Buggy source:
public void run(){
  pStatistics.execute(graphModel,attributeModel);
  for (  StatisticsUI s : uis) {
    model.setRunning(s,false);
  }
  model.addStatistics(pStatistics);
}

Fixed version (ground truth):
public void run(){
  pStatistics.execute(graphModel,attributeModel);
  for (  StatisticsUI s : uis) {
    model.setRunning(s,false);
  }
}
Program: 190270
Project: 190270
Buggy source:
/** 
 * @param statistics
 */
public void execute(final Statistics pStatistics,LongTaskListener listener){
  final GraphController graphController=Lookup.getDefault().lookup(GraphController.class);
  final GraphModel graphModel=graphController.getModel();
  final AttributeModel attributeModel=Lookup.getDefault().lookup(AttributeController.class).getModel();
  StatisticsBuilder builder=getBuilder(pStatistics.getClass());
  final StatisticsUI[] uis=getUI(pStatistics);
  for (  StatisticsUI s : uis) {
    s.setup(pStatistics);
    model.setRunning(s,true);
  }
  if (pStatistics instanceof LongTask) {
    LongTaskExecutor executor=new LongTaskExecutor(true,builder.getName(),10);
    if (listener != null) {
      executor.setLongTaskListener(listener);
    }
    executor.execute((LongTask)pStatistics,new Runnable(){
      public void run(){
        pStatistics.execute(graphModel,attributeModel);
        for (        StatisticsUI s : uis) {
          model.setRunning(s,false);
        }
        model.addStatistics(pStatistics);
      }
    }
,builder.getName(),null);
  }
 else {
    pStatistics.execute(graphModel,attributeModel);
    if (listener != null) {
      listener.taskFinished(null);
    }
    for (    StatisticsUI s : uis) {
      model.setRunning(s,false);
    }
    model.addStatistics(pStatistics);
  }
}

Fixed version (ground truth):
/** 
 * @param statistics
 */
public void execute(final Statistics pStatistics,LongTaskListener listener){
  final GraphController graphController=Lookup.getDefault().lookup(GraphController.class);
  final GraphModel graphModel=graphController.getModel();
  final AttributeModel attributeModel=Lookup.getDefault().lookup(AttributeController.class).getModel();
  StatisticsBuilder builder=getBuilder(pStatistics.getClass());
  final StatisticsUI[] uis=getUI(pStatistics);
  model.addStatistics(pStatistics);
  for (  StatisticsUI s : uis) {
    s.setup(pStatistics);
    model.setRunning(s,true);
  }
  if (pStatistics instanceof LongTask) {
    LongTaskExecutor executor=new LongTaskExecutor(true,builder.getName(),10);
    if (listener != null) {
      executor.setLongTaskListener(listener);
    }
    executor.execute((LongTask)pStatistics,new Runnable(){
      public void run(){
        pStatistics.execute(graphModel,attributeModel);
        for (        StatisticsUI s : uis) {
          model.setRunning(s,false);
        }
      }
    }
,builder.getName(),null);
  }
 else {
    pStatistics.execute(graphModel,attributeModel);
    if (listener != null) {
      listener.taskFinished(null);
    }
    for (    StatisticsUI s : uis) {
      model.setRunning(s,false);
    }
  }
}
Program: 190271
Project: 190271
Buggy source:
protected void setSelectedLayout(Layout selectedLayout){
  Layout oldValue=this.selectedLayout;
  this.selectedLayout=selectedLayout;
  if (oldValue != null) {
    saveProperties(oldValue);
  }
  if (selectedLayout != null) {
    loadProperties(selectedLayout);
  }
  firePropertyChangeEvent(SELECTED_LAYOUT,oldValue,selectedLayout);
}

Fixed version (ground truth):
protected void setSelectedLayout(Layout selectedLayout){
  Layout oldValue=this.selectedLayout;
  this.selectedLayout=selectedLayout;
  this.selectedBuilder=selectedLayout.getBuilder();
  if (oldValue != null) {
    saveProperties(oldValue);
  }
  if (selectedLayout != null) {
    loadProperties(selectedLayout);
  }
  firePropertyChangeEvent(SELECTED_LAYOUT,oldValue,selectedLayout);
}
Program: 190272
Project: 190272
Buggy source:
public void setRunning(boolean running){
  this.running=running;
}

Fixed version (ground truth):
public void setRunning(boolean running){
  this.running=running;
synchronized (this.lock) {
    lock.notify();
  }
}
Program: 190273
Project: 190273
Buggy source:
@Override public void run(){
  while (running) {
    AbstractQueryImpl q;
    while ((q=rootQuery.getAndSet(null)) == null) {
      try {
synchronized (this.lock) {
          lock.wait();
        }
      }
 catch (      InterruptedException ex) {
        Exceptions.printStackTrace(ex);
      }
    }
    Query modifiedQuery=null;
    for (Iterator<PropertyModifier> itr=modifiersMap.values().iterator(); itr.hasNext(); ) {
      PropertyModifier pm=itr.next();
      itr.remove();
      pm.callback.setValue(pm.value);
      modifiedQuery=pm.query;
    }
    if (modifiedQuery != null) {
      model.updateParameters(modifiedQuery);
    }
    ProgressTicket progressTicket=null;
    ProgressTicketProvider progressTicketProvider=Lookup.getDefault().lookup(ProgressTicketProvider.class);
    if (progressTicketProvider != null) {
      progressTicket=progressTicketProvider.createTicket("String_Node_Str",null);
      Progress.start(progressTicket);
    }
    if (filtering) {
      filter(q);
    }
 else {
      select(q);
    }
    Progress.finish(progressTicket);
  }
  Query q=null;
  for (Iterator<PropertyModifier> itr=modifiersMap.values().iterator(); itr.hasNext(); ) {
    PropertyModifier pm=itr.next();
    pm.callback.setValue(pm.value);
    q=pm.query;
  }
  modifiersMap.clear();
  if (q != null) {
    model.updateParameters(q);
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (running) {
    AbstractQueryImpl q;
    while ((q=rootQuery.getAndSet(null)) == null && running) {
      try {
synchronized (this.lock) {
          lock.wait();
        }
      }
 catch (      InterruptedException ex) {
        Exceptions.printStackTrace(ex);
      }
    }
    if (!running) {
      return;
    }
    Query modifiedQuery=null;
    for (Iterator<PropertyModifier> itr=modifiersMap.values().iterator(); itr.hasNext(); ) {
      PropertyModifier pm=itr.next();
      itr.remove();
      pm.callback.setValue(pm.value);
      modifiedQuery=pm.query;
    }
    if (modifiedQuery != null) {
      model.updateParameters(modifiedQuery);
    }
    ProgressTicket progressTicket=null;
    ProgressTicketProvider progressTicketProvider=Lookup.getDefault().lookup(ProgressTicketProvider.class);
    if (progressTicketProvider != null) {
      progressTicket=progressTicketProvider.createTicket("String_Node_Str",null);
      Progress.start(progressTicket);
    }
    if (filtering) {
      filter(q);
    }
 else {
      select(q);
    }
    Progress.finish(progressTicket);
  }
  Query q=null;
  for (Iterator<PropertyModifier> itr=modifiersMap.values().iterator(); itr.hasNext(); ) {
    PropertyModifier pm=itr.next();
    pm.callback.setValue(pm.value);
    q=pm.query;
  }
  modifiersMap.clear();
  if (q != null) {
    model.updateParameters(q);
  }
}
Program: 190274
Project: 190274
Buggy source:
public void addStatistics(Statistics statistics){
  statisticsList.add(statistics);
  fireChangeEvent();
}

Fixed version (ground truth):
public void addStatistics(Statistics statistics){
  if (!statisticsList.contains(statistics)) {
    statisticsList.add(statistics);
    fireChangeEvent();
  }
}
Program: 190275
Project: 190275
Buggy source:
/** 
 * @param graphModel
 */
public void execute(GraphModel graphModel,AttributeModel attributeModel){
  mIsCanceled=false;
  AttributeTable nodeTable=attributeModel.getNodeTable();
  AttributeColumn inCol=nodeTable.getColumn("String_Node_Str");
  AttributeColumn outCol=nodeTable.getColumn("String_Node_Str");
  if (inCol == null) {
    inCol=nodeTable.addColumn("String_Node_Str","String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,0);
  }
  if (outCol == null) {
    outCol=nodeTable.addColumn("String_Node_Str","String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,0);
  }
  DirectedGraph graph=graphModel.getDirectedGraphVisible();
  int i=0;
  graph.readLock();
  this.mGraphRevision="String_Node_Str" + graph.getNodeVersion() + "String_Node_Str"+ graph.getEdgeVersion()+ "String_Node_Str";
  Progress.start(mProgress,graph.getNodeCount());
  for (  Node n : graph.getNodes()) {
    AttributeRow row=(AttributeRow)n.getNodeData().getAttributes();
    row.setValue(inCol,graph.getInDegree(n));
    row.setValue(outCol,graph.getOutDegree(n));
    mAvgInDegree+=graph.getInDegree(n);
    mAvgOutDegree+=graph.getOutDegree(n);
    if (mIsCanceled) {
      break;
    }
    i++;
    mProgress.progress(i);
  }
  mAvgDegree+=mAvgInDegree + mAvgOutDegree;
  mAvgInDegree/=graph.getNodeCount();
  mAvgOutDegree/=graph.getNodeCount();
  mAvgDegree/=graph.getNodeCount();
  graph.readUnlockAll();
}

Fixed version (ground truth):
/** 
 * @param graphModel
 */
public void execute(GraphModel graphModel,AttributeModel attributeModel){
  mIsCanceled=false;
  mAvgInDegree=mAvgOutDegree=0.0;
  AttributeTable nodeTable=attributeModel.getNodeTable();
  AttributeColumn inCol=nodeTable.getColumn("String_Node_Str");
  AttributeColumn outCol=nodeTable.getColumn("String_Node_Str");
  if (inCol == null) {
    inCol=nodeTable.addColumn("String_Node_Str","String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,0);
  }
  if (outCol == null) {
    outCol=nodeTable.addColumn("String_Node_Str","String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,0);
  }
  DirectedGraph graph=graphModel.getDirectedGraphVisible();
  int i=0;
  graph.readLock();
  this.mGraphRevision="String_Node_Str" + graph.getNodeVersion() + "String_Node_Str"+ graph.getEdgeVersion()+ "String_Node_Str";
  Progress.start(mProgress,graph.getNodeCount());
  for (  Node n : graph.getNodes()) {
    AttributeRow row=(AttributeRow)n.getNodeData().getAttributes();
    row.setValue(inCol,graph.getInDegree(n));
    row.setValue(outCol,graph.getOutDegree(n));
    mAvgInDegree+=graph.getInDegree(n);
    mAvgOutDegree+=graph.getOutDegree(n);
    if (mIsCanceled) {
      break;
    }
    i++;
    mProgress.progress(i);
  }
  mAvgDegree=mAvgInDegree + mAvgOutDegree;
  mAvgInDegree/=graph.getNodeCount();
  mAvgOutDegree/=graph.getNodeCount();
  mAvgDegree/=graph.getNodeCount();
  graph.readUnlockAll();
}