Program: 142747
Project: 142747
Buggy source:
public boolean execute(){
  attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  graphModel=workspace.getLookup().lookup(GraphModel.class);
  HierarchicalGraph graph=null;
  if (exportVisible) {
    graph=graphModel.getHierarchicalGraphVisible();
  }
 else {
    graph=graphModel.getHierarchicalGraph();
  }
  Progress.start(progress);
  graph.readLock();
  if (normalize) {
    calculateMinMax(graph);
  }
  int max=0;
  if (exportHierarchy) {
    for (    Node n : graph.getNodesTree()) {
      max++;
    }
    for (    Edge e : graph.getEdgesTree()) {
      max++;
    }
  }
 else {
    max=graph.getNodeCount();
    for (    Edge e : graph.getEdgesAndMetaEdges()) {
      max++;
    }
  }
  Progress.switchToDeterminate(progress,max);
  try {
    XMLOutputFactory outputFactory=XMLOutputFactory.newInstance();
    outputFactory.setProperty("String_Node_Str",Boolean.FALSE);
    XMLStreamWriter xmlWriter=outputFactory.createXMLStreamWriter(writer);
    xmlWriter=new IndentingXMLStreamWriter(xmlWriter);
    xmlWriter.writeStartDocument("String_Node_Str","String_Node_Str");
    xmlWriter.setPrefix("String_Node_Str",GEXF_NAMESPACE);
    xmlWriter.writeStartElement(GEXF_NAMESPACE,GEXF);
    xmlWriter.writeNamespace("String_Node_Str",GEXF_NAMESPACE);
    xmlWriter.writeAttribute(GEXF_VERSION,"String_Node_Str");
    if (exportColors || exportPosition || exportSize) {
      xmlWriter.writeNamespace(VIZ,VIZ_NAMESPACE);
    }
    xmlWriter.writeAttribute("String_Node_Str",GEXF_NAMESPACE_LOCATION);
    if (exportDynamic) {
      DynamicController dynamicController=Lookup.getDefault().lookup(DynamicController.class);
      DynamicModel dynamicModel=dynamicController != null ? dynamicController.getModel(workspace) : null;
      visibleInterval=dynamicModel == null ? null : exportVisible ? dynamicModel.getVisibleInterval() : new TimeInterval(Double.NEGATIVE_INFINITY,Double.POSITIVE_INFINITY);
    }
    writeMeta(xmlWriter);
    writeGraph(xmlWriter,graph);
    xmlWriter.writeEndElement();
    xmlWriter.writeEndDocument();
    xmlWriter.close();
  }
 catch (  Exception e) {
    if (e instanceof RuntimeException) {
      throw (RuntimeException)e;
    }
    throw new RuntimeException(e);
  }
  Progress.finish(progress);
  return !cancel;
}

Fixed version (ground truth):
public boolean execute(){
  attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  graphModel=workspace.getLookup().lookup(GraphModel.class);
  HierarchicalGraph graph=null;
  if (exportVisible) {
    graph=graphModel.getHierarchicalGraphVisible();
  }
 else {
    graph=graphModel.getHierarchicalGraph();
  }
  Progress.start(progress);
  graph.readLock();
  if (normalize) {
    calculateMinMax(graph);
  }
  int max=0;
  if (exportHierarchy) {
    for (    Node n : graph.getNodesTree()) {
      max++;
    }
    for (    Edge e : graph.getEdgesTree()) {
      max++;
    }
  }
 else {
    max=graph.getNodeCount();
    for (    Edge e : graph.getEdgesAndMetaEdges()) {
      max++;
    }
  }
  Progress.switchToDeterminate(progress,max);
  try {
    XMLOutputFactory outputFactory=XMLOutputFactory.newInstance();
    outputFactory.setProperty("String_Node_Str",Boolean.FALSE);
    XMLStreamWriter xmlWriter=outputFactory.createXMLStreamWriter(writer);
    xmlWriter=new IndentingXMLStreamWriter(xmlWriter);
    xmlWriter.writeStartDocument("String_Node_Str","String_Node_Str");
    xmlWriter.setPrefix("String_Node_Str",GEXF_NAMESPACE);
    xmlWriter.writeStartElement(GEXF_NAMESPACE,GEXF);
    xmlWriter.writeNamespace("String_Node_Str",GEXF_NAMESPACE);
    xmlWriter.writeAttribute(GEXF_VERSION,"String_Node_Str");
    if (exportColors || exportPosition || exportSize) {
      xmlWriter.writeNamespace(VIZ,VIZ_NAMESPACE);
    }
    xmlWriter.writeAttribute("String_Node_Str","String_Node_Str");
    xmlWriter.writeAttribute("String_Node_Str",GEXF_NAMESPACE_LOCATION);
    if (exportDynamic) {
      DynamicController dynamicController=Lookup.getDefault().lookup(DynamicController.class);
      DynamicModel dynamicModel=dynamicController != null ? dynamicController.getModel(workspace) : null;
      visibleInterval=dynamicModel == null ? null : exportVisible ? dynamicModel.getVisibleInterval() : new TimeInterval(Double.NEGATIVE_INFINITY,Double.POSITIVE_INFINITY);
    }
    writeMeta(xmlWriter);
    writeGraph(xmlWriter,graph);
    xmlWriter.writeEndElement();
    xmlWriter.writeEndDocument();
    xmlWriter.close();
  }
 catch (  Exception e) {
    if (e instanceof RuntimeException) {
      throw (RuntimeException)e;
    }
    throw new RuntimeException(e);
  }
  Progress.finish(progress);
  return !cancel;
}