nus-yam/ex-repair huggingface dataset:
Program: 142840
Project: 142840
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  for (  Perspective g : perspectives) {
    if (g != perspective) {
      TopComponentGroup tpg=WindowManager.getDefault().findTopComponentGroup(g.getName());
      tpg.close();
    }
  }
  TopComponentGroup tpg=WindowManager.getDefault().findTopComponentGroup(perspective.getName());
  tpg.open();
  Perspective closingPerspective=getPerspective(selectedPerspective);
  for (  PerspectiveMember member : members) {
    if (member.close(closingPerspective)) {
      if (member instanceof TopComponent) {
        ((TopComponent)member).close();
      }
    }
  }
  for (  PerspectiveMember member : members) {
    if (member.open(perspective)) {
      if (member instanceof TopComponent) {
        ((TopComponent)member).open();
      }
    }
  }
  selectedPerspective=perspective.getName();
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  for (  Perspective g : perspectives) {
    if (g != perspective) {
      TopComponentGroup tpg=WindowManager.getDefault().findTopComponentGroup(g.getName());
      tpg.close();
    }
  }
  TopComponentGroup tpg=WindowManager.getDefault().findTopComponentGroup(perspective.getName());
  tpg.open();
  PerspectiveMember[] members=Lookup.getDefault().lookupAll(PerspectiveMember.class).toArray(new PerspectiveMember[0]);
  Perspective closingPerspective=getPerspective(selectedPerspective);
  for (  PerspectiveMember member : members) {
    if (member.close(closingPerspective)) {
      if (member instanceof TopComponent) {
        boolean closed=((TopComponent)member).close();
        System.out.println("String_Node_Str" + member + "String_Node_Str"+ closed);
      }
    }
  }
  for (  PerspectiveMember member : members) {
    if (member.open(perspective)) {
      if (member instanceof TopComponent && !((TopComponent)member).isOpened()) {
        ((TopComponent)member).open();
        System.out.println("String_Node_Str" + member);
      }
    }
  }
  selectedPerspective=perspective.getName();
}
Program: 142845
Project: 142845
Buggy source:
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);
}

Fixed version (ground truth):
protected void setSelectedLayout(Layout selectedLayout){
  Layout oldValue=this.selectedLayout;
  this.selectedLayout=selectedLayout;
  this.selectedBuilder=selectedLayout != null ? selectedLayout.getBuilder() : null;
  if (oldValue != null) {
    saveProperties(oldValue);
  }
  if (selectedLayout != null) {
    loadProperties(selectedLayout);
  }
  firePropertyChangeEvent(SELECTED_LAYOUT,oldValue,selectedLayout);
}
Program: 142846
Project: 142846
Buggy source:
public void deleteWorkspace(Workspace workspace){
  fireWorkspaceEvent(EventType.CLOSE,workspace);
  WorkspaceInformation wi=workspace.getLookup().lookup(WorkspaceInformation.class);
  WorkspaceProviderImpl workspaceProvider=wi.getProject().getLookup().lookup(WorkspaceProviderImpl.class);
  if (getCurrentWorkspace() == workspace) {
    Workspace toSelectWorkspace=workspaceProvider.getPrecedingWorkspace(workspace);
    if (toSelectWorkspace == null) {
      closeCurrentProject();
      return;
    }
 else {
      openWorkspace(toSelectWorkspace);
    }
  }
  workspaceProvider.removeWorkspace(workspace);
}

Fixed version (ground truth):
public void deleteWorkspace(Workspace workspace){
  WorkspaceInformation wi=workspace.getLookup().lookup(WorkspaceInformation.class);
  WorkspaceProviderImpl workspaceProvider=wi.getProject().getLookup().lookup(WorkspaceProviderImpl.class);
  workspaceProvider.removeWorkspace(workspace);
  fireWorkspaceEvent(EventType.CLOSE,workspace);
  if (getCurrentWorkspace() == workspace) {
    Workspace toSelectWorkspace=workspaceProvider.getPrecedingWorkspace(workspace);
    if (toSelectWorkspace == null) {
      closeCurrentProject();
      return;
    }
 else {
      openWorkspace(toSelectWorkspace);
    }
  }
}
Program: 142847
Project: 142847
Buggy source:
public void close(Workspace workspace){
}

Fixed version (ground truth):
public void close(Workspace workspace){
  panel.refreshList();
}
Program: 142848
Project: 142848
Buggy source:
public boolean init(Graph graph){
  visibleInterval=dynamicModel.getVisibleInterval();
  min=Double.NEGATIVE_INFINITY;
  max=Double.POSITIVE_INFINITY;
  return true;
}

Fixed version (ground truth):
public boolean init(Graph graph){
  visibleInterval=dynamicModel.getVisibleInterval();
  min=Double.POSITIVE_INFINITY;
  max=Double.NEGATIVE_INFINITY;
  return true;
}
Program: 142849
Project: 142849
Buggy source:
public void finish(){
  timelineController.setMin(min);
  timelineController.setMax(max);
}

Fixed version (ground truth):
public void finish(){
  if (!Double.isInfinite(min)) {
    timelineController.setMin(min);
  }
  if (!Double.isInfinite(max)) {
    timelineController.setMax(max);
  }
}
Program: 142850
Project: 142850
Buggy source:
public boolean evaluate(Graph graph,Edge edge){
  if (edgeColumn != null) {
    Object obj=edge.getEdgeData().getAttributes().getValue(edgeColumn.getIndex());
    if (obj != null) {
      TimeInterval timeInterval=(TimeInterval)obj;
      min=Math.min(min,timeInterval.getLow());
      max=Math.max(max,timeInterval.getHigh());
      return timeInterval.isInRange(visibleInterval.getLow(),visibleInterval.getHigh());
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean evaluate(Graph graph,Edge edge){
  if (edgeColumn != null) {
    Object obj=edge.getEdgeData().getAttributes().getValue(edgeColumn.getIndex());
    if (obj != null) {
      TimeInterval timeInterval=(TimeInterval)obj;
      min=Math.min(min,Double.isInfinite(timeInterval.getLow()) ? min : timeInterval.getLow());
      max=Math.max(max,Double.isInfinite(timeInterval.getHigh()) ? max : timeInterval.getHigh());
      return timeInterval.isInRange(visibleInterval.getLow(),visibleInterval.getHigh());
    }
  }
  return true;
}
Program: 142851
Project: 142851
Buggy source:
public boolean cancel(){
  return true;
}

Fixed version (ground truth):
public boolean cancel(){
  cancel=true;
  return true;
}
Program: 142852
Project: 142852
Buggy source:
public void readWorkspaceChildren(Workspace workspace,Element workspaceE) throws Exception {
  NodeList children=workspaceE.getChildNodes();
  for (int i=0; i < children.getLength(); i++) {
    Node child=children.item(i);
    if (child.getNodeType() == Node.ELEMENT_NODE) {
      Element childE=(Element)child;
      WorkspacePersistenceProvider pp=providers.get(childE.getTagName());
      if (pp != null) {
        try {
          pp.readXML(childE,workspace);
        }
 catch (        UnsupportedOperationException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
public void readWorkspaceChildren(Workspace workspace,Element workspaceE) throws Exception {
  NodeList children=workspaceE.getChildNodes();
  for (int i=0; i < children.getLength() && !cancel; i++) {
    Node child=children.item(i);
    if (child.getNodeType() == Node.ELEMENT_NODE) {
      Element childE=(Element)child;
      WorkspacePersistenceProvider pp=providers.get(childE.getTagName());
      if (pp != null) {
        try {
          pp.readXML(childE,workspace);
        }
 catch (        UnsupportedOperationException e) {
        }
      }
    }
  }
}
Program: 142853
Project: 142853
Buggy source:
public void readProject(XPath xpath,Element projectE) throws Exception {
  ProjectInformationImpl info=project.getLookup().lookup(ProjectInformationImpl.class);
  WorkspaceProviderImpl workspaces=project.getLookup().lookup(WorkspaceProviderImpl.class);
  info.setName(projectE.getAttribute("String_Node_Str"));
  XPathExpression exp=xpath.compile("String_Node_Str");
  NodeList workSpaceList=(NodeList)exp.evaluate(projectE,XPathConstants.NODESET);
  for (int i=0; i < workSpaceList.getLength(); i++) {
    Element workspaceE=(Element)workSpaceList.item(i);
    Workspace workspace=readWorkspace(xpath,workspaceE);
    if (workspace.getLookup().lookup(WorkspaceInformationImpl.class).isOpen()) {
      workspaces.setCurrentWorkspace(workspace);
    }
  }
}

Fixed version (ground truth):
public void readProject(XPath xpath,Element projectE) throws Exception {
  ProjectInformationImpl info=project.getLookup().lookup(ProjectInformationImpl.class);
  WorkspaceProviderImpl workspaces=project.getLookup().lookup(WorkspaceProviderImpl.class);
  info.setName(projectE.getAttribute("String_Node_Str"));
  XPathExpression exp=xpath.compile("String_Node_Str");
  NodeList workSpaceList=(NodeList)exp.evaluate(projectE,XPathConstants.NODESET);
  for (int i=0; i < workSpaceList.getLength() && !cancel; i++) {
    Element workspaceE=(Element)workSpaceList.item(i);
    Workspace workspace=readWorkspace(xpath,workspaceE);
    if (workspace.getLookup().lookup(WorkspaceInformationImpl.class).isOpen()) {
      workspaces.setCurrentWorkspace(workspace);
    }
  }
}
Program: 142854
Project: 142854
Buggy source:
public boolean cancel(){
  cancel=true;
  gephiReader.cancel();
  return true;
}

Fixed version (ground truth):
public boolean cancel(){
  cancel=true;
  if (gephiReader != null) {
    gephiReader.cancel();
  }
  return true;
}
Program: 142855
Project: 142855
Buggy source:
public void run(){
  try {
    Progress.start(progressTicket);
    Progress.setDisplayName(progressTicket,NbBundle.getMessage(SaveTask.class,"String_Node_Str"));
    FileObject fileObject=FileUtil.toFileObject(file);
    if (FileUtil.isArchiveFile(fileObject)) {
      fileObject=FileUtil.getArchiveRoot(fileObject).getChildren()[0];
    }
    DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
    DocumentBuilder builder=factory.newDocumentBuilder();
    Document doc=builder.parse(fileObject.getInputStream());
    Project project=new ProjectImpl();
    project.getLookup().lookup(ProjectInformationImpl.class).setFile(file);
    String version=doc.getDocumentElement().getAttribute("String_Node_Str");
    if (version == null || version.isEmpty() || Double.parseDouble(version) != 0.7) {
      throw new GephiFormatException("String_Node_Str");
    }
    gephiReader=new GephiReader();
    project=gephiReader.readAll(doc.getDocumentElement(),project);
    if (!cancel) {
      ProjectControllerImpl pc=Lookup.getDefault().lookup(ProjectControllerImpl.class);
      pc.openProject(project);
    }
    Progress.finish(progressTicket);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    if (ex instanceof GephiFormatException) {
      throw (GephiFormatException)ex;
    }
    throw new GephiFormatException(GephiReader.class,ex);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    Progress.start(progressTicket);
    Progress.setDisplayName(progressTicket,NbBundle.getMessage(SaveTask.class,"String_Node_Str"));
    FileObject fileObject=FileUtil.toFileObject(file);
    if (FileUtil.isArchiveFile(fileObject)) {
      fileObject=FileUtil.getArchiveRoot(fileObject).getChildren()[0];
    }
    DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
    DocumentBuilder builder=factory.newDocumentBuilder();
    Document doc=builder.parse(fileObject.getInputStream());
    if (!cancel) {
      Project project=new ProjectImpl();
      project.getLookup().lookup(ProjectInformationImpl.class).setFile(file);
      String version=doc.getDocumentElement().getAttribute("String_Node_Str");
      if (version == null || version.isEmpty() || Double.parseDouble(version) != 0.7) {
        throw new GephiFormatException("String_Node_Str");
      }
      gephiReader=new GephiReader();
      project=gephiReader.readAll(doc.getDocumentElement(),project);
      if (!cancel) {
        ProjectControllerImpl pc=Lookup.getDefault().lookup(ProjectControllerImpl.class);
        pc.openProject(project);
      }
    }
    Progress.finish(progressTicket);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    if (ex instanceof GephiFormatException) {
      throw (GephiFormatException)ex;
    }
    throw new GephiFormatException(GephiReader.class,ex);
  }
}
Program: 142857
Project: 142857
Buggy source:
@Override public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  NumberList numberList=(NumberList)value;
  if (numberList == null) {
    return super.getTableCellRendererComponent(table,"String_Node_Str",isSelected,hasFocus,row,column);
  }
 else   if (numberList.size() < 2) {
    return super.getTableCellRendererComponent(table,numberList.toString(),isSelected,hasFocus,row,column);
  }
  ArrayList<Number> numbers=new ArrayList<Number>();
  Number n;
  for (int i=0; i < numberList.size(); i++) {
    n=(Number)numberList.getItem(i);
    if (n != null) {
      numbers.add(n);
    }
  }
  JLabel label=new JLabel();
  Color background;
  if (isSelected) {
    background=SELECTED_BACKGROUND;
  }
 else {
    background=UNSELECTED_BACKGROUND;
  }
  final SizeParams size=new SizeParams(table.getColumnModel().getColumn(column).getWidth(),table.getRowHeight(row) - 1,1);
  final BufferedImage i=LineGraph.createGraph(numbers.toArray(new Number[0]),size,Color.BLUE,background);
  label.setIcon(new ImageIcon(i));
  label.setToolTipText(numberList.toString());
  return label;
}

Fixed version (ground truth):
@Override public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  NumberList numberList=(NumberList)value;
  if (numberList == null) {
    return super.getTableCellRendererComponent(table,"String_Node_Str",isSelected,hasFocus,row,column);
  }
 else   if (numberList.size() < 2) {
    return super.getTableCellRendererComponent(table,numberList.toString(),isSelected,hasFocus,row,column);
  }
  JLabel label=new JLabel();
  ArrayList<Number> numbers=new ArrayList<Number>();
  Number n;
  for (int i=0; i < numberList.size(); i++) {
    n=(Number)numberList.getItem(i);
    if (n != null) {
      numbers.add(n);
    }
  }
  Color background;
  if (isSelected) {
    background=SELECTED_BACKGROUND;
  }
 else {
    background=UNSELECTED_BACKGROUND;
  }
  final SizeParams size=new SizeParams(table.getColumnModel().getColumn(column).getWidth(),table.getRowHeight(row) - 1,1);
  final BufferedImage i=LineGraph.createGraph(numbers.toArray(new Number[0]),size,Color.BLUE,background);
  label.setIcon(new ImageIcon(i));
  label.setToolTipText(numberList.toString());
  return label;
}
Program: 142858
Project: 142858
Buggy source:
/** 
 * Creates and edge between source and target node (if does not already exist), directed or undirected. This will not create a self-loop.
 * @param source Source node
 * @param target Target node
 * @param directed Indicates if the edge has to be directed
 * @return True if the edge was created succesfully, false otherwise
 */
boolean createEdge(Node source,Node target,boolean directed);

Fixed version (ground truth):
/** 
 * Creates and edge between source and target node (if does not already exist), directed or undirected. If a edge with the given id already exists, no edge will be created. This will not create a self-loop.
 * @param source Source node
 * @param target Target node
 * @param directed Indicates if the edge has to be directed
 * @return New edge if the edge was created succesfully, null otherwise
 */
Edge createEdge(String id,Node source,Node target,boolean directed);
Program: 142859
Project: 142859
Buggy source:
public Node createNode(String label,String id){
  Graph graph=getGraph();
  if (graph.getNode(id) == null) {
    Node newNode=buildNode(label,id);
    graph.addNode(newNode);
    return newNode;
  }
 else   return null;
}

Fixed version (ground truth):
public Node createNode(String label,String id){
  Graph graph=getGraph();
  if (graph.getNode(id) == null) {
    Node newNode=buildNode(label,id);
    graph.addNode(newNode);
    return newNode;
  }
 else {
    return null;
  }
}
Program: 142860
Project: 142860
Buggy source:
public boolean createEdge(Node source,Node target,boolean directed){
  if (isNodeInGraph(source) && isNodeInGraph(target)) {
    if (source != target) {
      if (directed) {
        return getDirectedGraph().addEdge(source,target);
      }
 else {
        return getUndirectedGraph().addEdge(source,target);
      }
    }
 else {
      return false;
    }
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public Edge createEdge(String id,Node source,Node target,boolean directed){
  Edge newEdge;
  if (getGraph().getEdge(id) == null) {
    if (source != target) {
      if (directed) {
        newEdge=buildEdge(id,source,target,true);
        if (getDirectedGraph().addEdge(newEdge)) {
          return newEdge;
        }
 else {
          return null;
        }
      }
 else {
        newEdge=buildEdge(id,source,target,false);
        if (getUndirectedGraph().addEdge(newEdge)) {
          return newEdge;
        }
 else {
          return null;
        }
      }
    }
 else {
      return null;
    }
  }
 else {
    return null;
  }
}
Program: 142861
Project: 142861
Buggy source:
private Node buildNode(String label,String id){
  Node newNode=Lookup.getDefault().lookup(GraphController.class).getModel().factory().newNode(id);
  newNode.getNodeData().setLabel(label);
  return newNode;
}

Fixed version (ground truth):
private Node buildNode(String label,String id){
  Node newNode=Lookup.getDefault().lookup(GraphController.class).getModel().factory().newNode(id);
  getGraph().setId(newNode,id);
  newNode.getNodeData().setLabel(label);
  return newNode;
}
Program: 142862
Project: 142862
Buggy source:
/** 
 * Does export the preview graph as an SVG image.
 * @param file         the output SVG file
 * @param supportSize  the support size of the exported image
 * @throws Exception
 */
private void exportData(GraphSheet graphSheet) throws Exception {
  SupportSize supportSize=new SupportSize(210,297,LengthUnit.MILLIMETER);
  Progress.start(progress);
  Graph graph=graphSheet.getGraph();
  int max=0;
  if (graph.showNodes()) {
    max+=graph.countNodes();
  }
  if (graph.showEdges()) {
    max+=graph.countUnidirectionalEdges() + graph.countBidirectionalEdges();
    if (graph.showSelfLoops()) {
      max+=graph.countSelfLoops();
    }
  }
  Progress.switchToDeterminate(progress,max);
  buildDOM(graphSheet,supportSize);
  SVGTranscoder t=new SVGTranscoder();
  t.addTranscodingHint(SVGTranscoder.KEY_XML_DECLARATION,new String("String_Node_Str"));
  TranscoderInput input=new TranscoderInput(doc);
  try {
    TranscoderOutput output=new TranscoderOutput(writer);
    t.transcode(input,output);
  }
  finally {
    writer.close();
  }
  Progress.finish(progress);
}

Fixed version (ground truth):
/** 
 * Does export the preview graph as an SVG image.
 * @param file         the output SVG file
 * @param supportSize  the support size of the exported image
 * @throws Exception
 */
private void exportData(GraphSheet graphSheet) throws Exception {
  SupportSize supportSize=new SupportSize(210,297,LengthUnit.MILLIMETER);
  Progress.start(progress);
  Graph graph=graphSheet.getGraph();
  int max=0;
  if (graph.showNodes()) {
    max+=graph.countNodes();
  }
  if (graph.showEdges()) {
    max+=graph.countUnidirectionalEdges() + graph.countBidirectionalEdges();
    if (graph.showSelfLoops()) {
      max+=graph.countSelfLoops();
    }
  }
  Progress.switchToDeterminate(progress,max);
  buildDOM(graphSheet,supportSize);
  SVGTranscoder t=new SVGTranscoder();
  t.addTranscodingHint(SVGTranscoder.KEY_XML_DECLARATION,new String("String_Node_Str"));
  TranscoderInput input=new TranscoderInput(doc);
  try {
    TranscoderOutput output=new TranscoderOutput(new OutputStreamWriter(new WriterOutputStream(writer),Charset.forName("String_Node_Str")));
    t.transcode(input,output);
  }
  finally {
    writer.close();
  }
  Progress.finish(progress);
}
Program: 142864
Project: 142864
Buggy source:
public synchronized void removeColumn(AttributeColumn column){
  columns.remove((AttributeColumnImpl)column);
  columnsMap.remove(column.getId());
  if (column.getTitle() != null && !column.getTitle().equals(column.getId())) {
    columnsMap.remove(column.getTitle());
  }
  columnsSet.remove(column);
  fireAttributeEvent(new AttributeEventImpl(AttributeEvent.EventType.REMOVE_COLUMN,this,column));
  version++;
}

Fixed version (ground truth):
public synchronized void removeColumn(AttributeColumn column){
  int index=columns.indexOf(column);
  if (index == -1) {
    return;
  }
  AttributeColumnImpl c;
  for (index=index + 1; index < columns.size(); index++) {
    c=columns.get(index);
    c.index--;
  }
  columns.remove((AttributeColumnImpl)column);
  columnsMap.remove(column.getId());
  if (column.getTitle() != null && !column.getTitle().equals(column.getId())) {
    columnsMap.remove(column.getTitle());
  }
  columnsSet.remove(column);
  fireAttributeEvent(new AttributeEventImpl(AttributeEvent.EventType.REMOVE_COLUMN,this,column));
  version++;
}
Program: 142865
Project: 142865
Buggy source:
/** 
 * @return
 */
public String getReport(){
  String report=new String("String_Node_Str" + "String_Node_Str" + mGraphRevision + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ mAvgInDegree+ "String_Node_Str"+ mAvgOutDegree+ "String_Node_Str");
  return report;
}

Fixed version (ground truth):
/** 
 * @return
 */
public String getReport(){
  String report=new String("String_Node_Str" + "String_Node_Str" + mGraphRevision + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ mAvgDegree+ "String_Node_Str"+ mAvgInDegree+ "String_Node_Str"+ mAvgOutDegree+ "String_Node_Str");
  return report;
}
Program: 142867
Project: 142867
Buggy source:
protected void createPropertiesColumn(){
  PropertiesColumn[] columnsForNodeTable={PropertiesColumn.NODE_ID,PropertiesColumn.NODE_LABEL};
  PropertiesColumn[] columnsForEdgeTable={PropertiesColumn.EDGE_ID,PropertiesColumn.EDGE_LABEL};
  for (  PropertiesColumn columnForNodeTable : columnsForNodeTable)   nodeTable.addPropertiesColumn(columnForNodeTable);
  for (  PropertiesColumn columnForEdgeTable : columnsForEdgeTable)   edgeTable.addPropertiesColumn(columnForEdgeTable);
}

Fixed version (ground truth):
protected void createPropertiesColumn(){
  PropertiesColumn[] columnsForNodeTable={PropertiesColumn.NODE_ID,PropertiesColumn.NODE_LABEL};
  PropertiesColumn[] columnsForEdgeTable={PropertiesColumn.EDGE_ID,PropertiesColumn.EDGE_LABEL,PropertiesColumn.EDGE_WEIGHT};
  for (  PropertiesColumn columnForNodeTable : columnsForNodeTable)   nodeTable.addPropertiesColumn(columnForNodeTable);
  for (  PropertiesColumn columnForEdgeTable : columnsForEdgeTable)   edgeTable.addPropertiesColumn(columnForEdgeTable);
}
Program: 142868
Project: 142868
Buggy source:
public AbstractEdge(AbstractEdge edge,AbstractNode source,AbstractNode target){
  this.source=source;
  this.target=target;
  this.ID=edge.ID;
  this.edgeData=edge.edgeData;
  this.weight=edge.weight;
}

Fixed version (ground truth):
public AbstractEdge(AbstractEdge edge,AbstractNode source,AbstractNode target){
  this.source=source;
  this.target=target;
  this.ID=edge.ID;
  this.edgeData=edge.edgeData;
}
Program: 142869
Project: 142869
Buggy source:
public float getWeight(){
  return weight;
}

Fixed version (ground truth):
public float getWeight(){
  return edgeData.getWeight();
}
Program: 142870
Project: 142870
Buggy source:
public void setWeight(float weight){
  this.weight=weight;
}

Fixed version (ground truth):
public void setWeight(float weight){
  edgeData.setWeight(weight);
}
Program: 142871
Project: 142871
Buggy source:
public void pushEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.weight;
  float metaWeight=metaEdge.getWeight();
  float edgeCount=metaEdge.getCount();
  float div=1f;
  if (source == metaEdge.getSource() || source == metaEdge.getTarget() || target == metaEdge.getTarget() || target == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  edgeWeight/=div;
  metaWeight=(metaWeight * edgeCount + edgeWeight) / (edgeCount + 1);
  if (metaWeight > weightLimit) {
    metaWeight=weightLimit;
  }
  metaEdge.setWeight(metaWeight);
}

Fixed version (ground truth):
public void pushEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.getWeight();
  float metaWeight=metaEdge.getWeight();
  float edgeCount=metaEdge.getCount();
  float div=1f;
  if (source == metaEdge.getSource() || source == metaEdge.getTarget() || target == metaEdge.getTarget() || target == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  edgeWeight/=div;
  metaWeight=(metaWeight * edgeCount + edgeWeight) / (edgeCount + 1);
  if (metaWeight > weightLimit) {
    metaWeight=weightLimit;
  }
  metaEdge.setWeight(metaWeight);
}
Program: 142872
Project: 142872
Buggy source:
public void pullEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.weight;
  float metaWeight=metaEdge.getWeight();
  float edgeCount=metaEdge.getCount();
  float div=1f;
  if (source == metaEdge.getSource() || source == metaEdge.getTarget() || target == metaEdge.getTarget() || target == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  edgeWeight/=div;
  metaWeight=(metaWeight * edgeCount - edgeWeight) / (edgeCount - 1);
  if (metaWeight < weightMinimum) {
    metaWeight=weightMinimum;
  }
  metaEdge.setWeight(metaWeight);
}

Fixed version (ground truth):
public void pullEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.getWeight();
  float metaWeight=metaEdge.getWeight();
  float edgeCount=metaEdge.getCount();
  float div=1f;
  if (source == metaEdge.getSource() || source == metaEdge.getTarget() || target == metaEdge.getTarget() || target == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  edgeWeight/=div;
  metaWeight=(metaWeight * edgeCount - edgeWeight) / (edgeCount - 1);
  if (metaWeight < weightMinimum) {
    metaWeight=weightMinimum;
  }
  metaEdge.setWeight(metaWeight);
}
Program: 142873
Project: 142873
Buggy source:
public MetaEdgeImpl(int ID,AbstractNode source,AbstractNode target){
  super(ID,source,target);
  this.weight=0f;
}

Fixed version (ground truth):
public MetaEdgeImpl(int ID,AbstractNode source,AbstractNode target){
  super(ID,source,target);
  setWeight(0f);
}
Program: 142874
Project: 142874
Buggy source:
public void pushEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.weight;
  float metaWeight=metaEdge.getWeight();
  float div=1f;
  if (edge.getSource() == metaEdge.getSource() || edge.getSource() == metaEdge.getTarget() || edge.getTarget() == metaEdge.getTarget() || edge.getTarget() == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  metaWeight+=edgeWeight / div;
  if (metaWeight > weightLimit) {
    metaWeight=weightLimit;
  }
  metaEdge.setWeight(metaWeight);
}

Fixed version (ground truth):
public void pushEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.getWeight();
  float metaWeight=metaEdge.getWeight();
  float div=1f;
  if (edge.getSource() == metaEdge.getSource() || edge.getSource() == metaEdge.getTarget() || edge.getTarget() == metaEdge.getTarget() || edge.getTarget() == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  metaWeight+=edgeWeight / div;
  if (metaWeight > weightLimit) {
    metaWeight=weightLimit;
  }
  metaEdge.setWeight(metaWeight);
}
Program: 142875
Project: 142875
Buggy source:
public void pullEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.weight;
  float metaWeight=metaEdge.getWeight();
  float div=1f;
  if (source == metaEdge.getSource() || source == metaEdge.getTarget() || target == metaEdge.getTarget() || target == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  metaWeight-=edgeWeight / div;
  if (metaWeight < weightMinimum) {
    metaWeight=weightMinimum;
  }
  metaEdge.setWeight(metaWeight);
}

Fixed version (ground truth):
public void pullEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.getWeight();
  float metaWeight=metaEdge.getWeight();
  float div=1f;
  if (source == metaEdge.getSource() || source == metaEdge.getTarget() || target == metaEdge.getTarget() || target == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  metaWeight-=edgeWeight / div;
  if (metaWeight < weightMinimum) {
    metaWeight=weightMinimum;
  }
  metaEdge.setWeight(metaWeight);
}
Program: 142876
Project: 142876
Buggy source:
private AbstractNode[] deleteNode(AbstractNode node){
  AbstractNode[] descendants=new AbstractNode[node.size + 1];
  int i=0;
  for (DescendantAndSelfIterator itr=new DescendantAndSelfIterator(treeStructure,node,Tautology.instance); itr.hasNext(); ) {
    AbstractNode descendant=itr.next();
    descendants[i]=descendant;
    if (descendant.isEnabled()) {
      edgeProcessor.clearMetaEdges(descendant);
      view.decNodesEnabled(1);
    }
    edgeProcessor.clearEdges(descendant);
    if (node.countInViews() == 1) {
      dhns.getGraphStructure().removeFromDictionnary(descendant);
    }
    i++;
  }
  treeStructure.deleteDescendantAndSelf(node);
  return descendants;
}

Fixed version (ground truth):
private AbstractNode[] deleteNode(AbstractNode node){
  AbstractNode[] descendants=new AbstractNode[node.size + 1];
  int i=0;
  for (DescendantAndSelfIterator itr=new DescendantAndSelfIterator(treeStructure,node,Tautology.instance); itr.hasNext(); ) {
    AbstractNode descendant=itr.next();
    descendants[i]=descendant;
    if (descendant.isEnabled()) {
      edgeProcessor.clearMetaEdges(descendant);
      view.decNodesEnabled(1);
    }
    AbstractEdge[] deletedEdges=edgeProcessor.clearEdges(descendant);
    if (deletedEdges != null) {
      for (int j=0; j < deletedEdges.length; j++) {
        dhns.getGraphStructure().removeFromDictionnary(deletedEdges[j]);
        dhns.getEventManager().fireEvent(new EdgeEvent(EventType.REMOVE_EDGES,deletedEdges[j],view));
      }
    }
    if (node.countInViews() == 1) {
      dhns.getGraphStructure().removeFromDictionnary(descendant);
    }
    i++;
  }
  treeStructure.deleteDescendantAndSelf(node);
  return descendants;
}
Program: 142879
Project: 142879
Buggy source:
public void contract(){
  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 {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          Node nodeParent=graph.getParent(node);
          if (nodeParent != null) {
            parents.add(nodeParent);
          }
        }
        for (        Node parent : parents) {
          GroupData gd=(GroupData)parent.getNodeData();
          if (gd.getHullModel() != null) {
            ConvexHull hull=((ConvexHullModel)gd.getHullModel()).getObj();
            contractPositioning(hull);
          }
          graph.retract(parent);
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
        graph.readUnlockAll();
      }
    }
  }
,"String_Node_Str").start();
}

Fixed version (ground truth):
public void contract(){
  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 {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          if (node != null) {
            Node nodeParent=graph.getParent(node);
            if (nodeParent != null) {
              parents.add(nodeParent);
            }
          }
        }
        for (        Node parent : parents) {
          GroupData gd=(GroupData)parent.getNodeData();
          if (gd.getHullModel() != null) {
            ConvexHull hull=((ConvexHullModel)gd.getHullModel()).getObj();
            contractPositioning(hull);
          }
          graph.retract(parent);
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
        graph.readUnlockAll();
      }
    }
  }
,"String_Node_Str").start();
}
Program: 142880
Project: 142880
Buggy source:
public void ungroup(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          if (graph.getDescendantCount(node) > 0) {
            parents.add(node);
          }
 else           if (graph.getParent(node) != null) {
            parents.add(graph.getParent(node));
          }
        }
        for (        Node parent : parents) {
          graph.ungroupNodes(parent);
        }
      }
 catch (      Exception e) {
        graph.readUnlockAll();
        NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
        DialogDisplayer.getDefault().notifyLater(nd);
      }
    }
  }
,"String_Node_Str").start();
}

Fixed version (ground truth):
public void ungroup(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          if (node != null && graph.getDescendantCount(node) > 0) {
            parents.add(node);
          }
 else           if (node != null && graph.getParent(node) != null) {
            parents.add(graph.getParent(node));
          }
        }
        for (        Node parent : parents) {
          graph.ungroupNodes(parent);
        }
      }
 catch (      Exception e) {
        graph.readUnlockAll();
        NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
        DialogDisplayer.getDefault().notifyLater(nd);
      }
    }
  }
,"String_Node_Str").start();
}
Program: 142881
Project: 142881
Buggy source:
public void run(){
  try {
    Set<Node> parents=new HashSet<Node>();
    for (    ModelImpl metaModelImpl : models) {
      NodeData nodeData=(NodeData)metaModelImpl.getObj();
      Node node=nodeData.getNode(graph.getView().getViewId());
      if (graph.getDescendantCount(node) > 0) {
        parents.add(node);
      }
 else       if (graph.getParent(node) != null) {
        parents.add(graph.getParent(node));
      }
    }
    for (    Node parent : parents) {
      graph.ungroupNodes(parent);
    }
  }
 catch (  Exception e) {
    graph.readUnlockAll();
    NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
    DialogDisplayer.getDefault().notifyLater(nd);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    Set<Node> parents=new HashSet<Node>();
    for (    ModelImpl metaModelImpl : models) {
      NodeData nodeData=(NodeData)metaModelImpl.getObj();
      Node node=nodeData.getNode(graph.getView().getViewId());
      if (node != null && graph.getDescendantCount(node) > 0) {
        parents.add(node);
      }
 else       if (node != null && graph.getParent(node) != null) {
        parents.add(graph.getParent(node));
      }
    }
    for (    Node parent : parents) {
      graph.ungroupNodes(parent);
    }
  }
 catch (  Exception e) {
    graph.readUnlockAll();
    NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
    DialogDisplayer.getDefault().notifyLater(nd);
  }
}
Program: 142882
Project: 142882
Buggy source:
public boolean canGroup(){
  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 canGroup(){
  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: 142883
Project: 142883
Buggy source:
public void delete(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    graph.removeNode(nodeData.getRootNode());
  }
}

Fixed version (ground truth):
public void delete(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl model : selectedNodeModels) {
    NodeData nodeData=(NodeData)model.getObj();
    Node node=nodeData.getRootNode();
    if (node != null) {
      graph.removeNode(node);
    }
  }
}
Program: 142884
Project: 142884
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: 142885
Project: 142885
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: 142886
Project: 142886
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: 142887
Project: 142887
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: 142889
Project: 142889
Buggy source:
public void setValue(FilterProperty property,Object value,Callback callback){
  if (model != null) {
    Query query=model.getQuery(property.getFilter());
    if (query == null) {
      callback.setValue(value);
      return;
    }
    AbstractQueryImpl rootQuery=((AbstractQueryImpl)query).getRoot();
    FilterThread filterThread=null;
    if ((filterThread=model.getFilterThread()) != null && model.getCurrentQuery() == rootQuery) {
      filterThread.addModifier(new PropertyModifier(query,property,value,callback));
      filterThread.setRootQuery(rootQuery);
    }
 else {
      callback.setValue(value);
      model.updateParameters(query);
    }
  }
}

Fixed version (ground truth):
public void setValue(FilterProperty property,Object value,Callback callback){
  if (model != null) {
    Query query=model.getQuery(property.getFilter());
    if (query == null) {
      callback.setValue(value);
      return;
    }
    AbstractQueryImpl rootQuery=((AbstractQueryImpl)query).getRoot();
    FilterThread filterThread=null;
    if ((filterThread=model.getFilterThread()) != null && model.getCurrentQuery() == rootQuery) {
      filterThread.addModifier(new PropertyModifier(query,property,value,callback));
      filterThread.setRootQuery(rootQuery);
    }
 else {
      callback.setValue(value);
      model.updateParameters(query);
    }
  }
 else {
    callback.setValue(value);
  }
}
Program: 142890
Project: 142890
Buggy source:
private Query readQuery(Element queryE){
  String builderClassName=queryE.getAttribute("String_Node_Str");
  FilterBuilder builder=null;
  for (  FilterBuilder fb : filterLibraryImpl.getLookup().lookupAll(FilterBuilder.class)) {
    if (fb.getClass().getName().equals(builderClassName)) {
      builder=fb;
    }
  }
  if (builder != null) {
    Filter filter=builder.getFilter();
    FilterController fc=Lookup.getDefault().lookup(FilterController.class);
    Query query=fc.createQuery(filter);
    NodeList paramList=queryE.getElementsByTagName("String_Node_Str");
    for (int i=0; i < paramList.getLength(); i++) {
      Node n=paramList.item(i);
      if (n.getNodeType() == Node.ELEMENT_NODE) {
        Element paramE=(Element)n;
        int index=Integer.parseInt(paramE.getAttribute("String_Node_Str"));
        FilterProperty property=query.getFilter().getProperties()[index];
        try {
          PropertyEditor editor=property.getPropertyEditor();
          if (editor == null) {
            editor=PropertyEditorManager.findEditor(property.getValueType());
          }
          if (editor != null) {
            String textValue=paramE.getTextContent();
            editor.setAsText(textValue);
            property.setValue(editor.getValue());
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
    return query;
  }
  return null;
}

Fixed version (ground truth):
private Query readQuery(Element queryE){
  String builderClassName=queryE.getAttribute("String_Node_Str");
  FilterBuilder builder=null;
  for (  FilterBuilder fb : filterLibraryImpl.getLookup().lookupAll(FilterBuilder.class)) {
    if (fb.getClass().getName().equals(builderClassName)) {
      builder=fb;
    }
  }
  if (builder != null) {
    Filter filter=builder.getFilter();
    FilterController fc=Lookup.getDefault().lookup(FilterController.class);
    Query query=fc.createQuery(filter);
    NodeList paramList=queryE.getElementsByTagName("String_Node_Str");
    for (int i=0; i < paramList.getLength(); i++) {
      Node n=paramList.item(i);
      if (n.getNodeType() == Node.ELEMENT_NODE) {
        Element paramE=(Element)n;
        int index=Integer.parseInt(paramE.getAttribute("String_Node_Str"));
        FilterProperty property=query.getFilter().getProperties()[index];
        try {
          PropertyEditor editor=property.getPropertyEditor();
          if (editor == null) {
            editor=PropertyEditorManager.findEditor(property.getValueType());
          }
          if (editor != null) {
            String textValue=paramE.getTextContent();
            editor.setAsText(textValue);
            property.setValue(editor.getValue());
            updateParameters(query);
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
    return query;
  }
  return null;
}