nus-yam/ex-repair huggingface dataset:
Program: 117685
Project: 117685
Buggy source:
private void openFileChooser(){
  JFileChooser chooser=new JFileChooser();
  chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  chooser.setAcceptAllFileFilterUsed(false);
  chooser.setDialogTitle("String_Node_Str");
  if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
    saveFolder=chooser.getCurrentDirectory();
    saveFolderField.setText(saveFolder.getAbsolutePath());
  }
}

Fixed version (ground truth):
private void openFileChooser(){
  JFileChooser chooser=new JFileChooser();
  chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  chooser.setAcceptAllFileFilterUsed(false);
  chooser.setDialogTitle("String_Node_Str");
  if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
    saveFolder=chooser.getSelectedFile();
    saveFolderField.setText(saveFolder.getAbsolutePath());
  }
 else   if (saveFolder == null) {
    saveToggle.setSelected(false);
    saveButton.setEnabled(false);
  }
}
Program: 117686
Project: 117686
Buggy source:
/** 
 * Creates new form PingerPanel
 * @param tm
 */
public PingerPanel(TopicMap tm){
  this.tm=tm;
  isRunning=false;
  try {
    maybeTargetButton=new GetTopicButton();
    maybeSourceButton=new GetTopicButton();
  }
 catch (  Exception e) {
    return;
  }
  initComponents();
  InputVerifier verifier=new InputVerifier(){
    @Override public boolean verify(    JComponent input){
      JFormattedTextField tf=(JFormattedTextField)input;
      int v=Integer.parseInt(tf.getText());
      return v > 0;
    }
  }
;
  yearField.setInputVerifier(verifier);
  monthField.setInputVerifier(verifier);
  dayField.setInputVerifier(verifier);
  hoursField.setInputVerifier(verifier);
  minutesField.setInputVerifier(verifier);
  secondsField.setInputVerifier(verifier);
  delayField.setInputVerifier(verifier);
  toggleExpirationFieldEnabled();
}

Fixed version (ground truth):
/** 
 * Creates new form PingerPanel
 * @param tm
 */
public PingerPanel(TopicMap tm){
  this.tm=tm;
  isRunning=false;
  try {
    maybeTargetButton=new GetTopicButton();
    maybeSourceButton=new GetTopicButton();
  }
 catch (  Exception e) {
    return;
  }
  initComponents();
  InputVerifier verifier=new InputVerifier(){
    @Override public boolean verify(    JComponent input){
      JFormattedTextField tf=(JFormattedTextField)input;
      int v=Integer.parseInt(tf.getText());
      return v > 0;
    }
  }
;
  yearField.setInputVerifier(verifier);
  monthField.setInputVerifier(verifier);
  dayField.setInputVerifier(verifier);
  hoursField.setInputVerifier(verifier);
  minutesField.setInputVerifier(verifier);
  secondsField.setInputVerifier(verifier);
  delayField.setInputVerifier(verifier);
  toggleExpirationFieldEnabled();
  setSetupEnabled(isRunning);
}
Program: 117687
Project: 117687
Buggy source:
private void saveToggleActionPerformed(java.awt.event.ActionEvent evt){
  boolean selected=saveToggle.isSelected();
  saveFolderField.setEnabled(selected);
  saveButton.setEnabled(selected);
}

Fixed version (ground truth):
private void saveToggleActionPerformed(java.awt.event.ActionEvent evt){
  boolean selected=saveToggle.isSelected();
  saveFolderField.setEnabled(selected);
  saveButton.setEnabled(selected);
  if (selected && saveFolder == null)   openFileChooser();
}
Program: 117688
Project: 117688
Buggy source:
public void setDetailsText(String text){
  if (text == null)   text="String_Node_Str";
  if (!text.isEmpty()) {
    text=text.replace("String_Node_Str","String_Node_Str");
    text=text.replace("String_Node_Str","String_Node_Str");
    text=text.replace("String_Node_Str","String_Node_Str");
    text="String_Node_Str" + text + "String_Node_Str";
  }
  detailsLabel.setText(text);
  this.setSize(this.getPreferredSize());
}

Fixed version (ground truth):
public void setDetailsText(String text){
  if (text == null)   text="String_Node_Str";
  if (!text.isEmpty()) {
    text=text.replace("String_Node_Str","String_Node_Str");
    text=text.replace("String_Node_Str","String_Node_Str");
    text=text.replace("String_Node_Str","String_Node_Str");
    text="String_Node_Str" + text + "String_Node_Str";
  }
  detailsLabel.setText(text);
  this.setSize(this.getPreferredSize());
  this.repaint();
}
Program: 117689
Project: 117689
Buggy source:
@Override public boolean setFrom(ConnectorAnchor from){
  ConnectorAnchor oldFromAnchor=getFrom();
  DirectivePanel oldFrom=DirectivePanel.findDirectivePanel(oldFromAnchor.getComponent());
  directiveConnectionRemoved(oldFrom);
  boolean ret=super.setFrom(from);
  if (from == null) {
synchronized (paramAnchors) {
      paramAnchors.remove(info);
      updateParamAnchors();
    }
  }
  return ret;
}

Fixed version (ground truth):
@Override public boolean setFrom(ConnectorAnchor from){
  ConnectorAnchor oldFromAnchor=getFrom();
  DirectivePanel oldFrom=DirectivePanel.findDirectivePanel(oldFromAnchor.getComponent());
  directiveConnectionRemoved(oldFrom);
  boolean ret=super.setFrom(from);
  if (from == null) {
synchronized (paramAnchors) {
      paramAnchors.remove(info);
      updateParamAnchors();
      updateDetailsText();
    }
  }
  return ret;
}
Program: 117690
Project: 117690
Buggy source:
/** 
 * Sets directive parameters but does not connect connectors, or panel dimensions, only stores the parameters variable.
 * @param params 
 */
public void saveDirectiveParameters(DirectiveParameters params){
  this.directiveParameters=params;
  setDetailsText(buildDetailsText());
}

Fixed version (ground truth):
/** 
 * Sets directive parameters but does not connect connectors, or panel dimensions, only stores the parameters variable.
 * @param params 
 */
public void saveDirectiveParameters(DirectiveParameters params){
  this.directiveParameters=params;
  updateDetailsText();
}
Program: 117691
Project: 117691
Buggy source:
public ConnectorAnchor connectParamAnchor(ConnectorAnchor from,String ordering){
synchronized (paramAnchors) {
    final JPanel anchorComp=new JPanel();
    final ParamAnchorInfo info=new ParamAnchorInfo(null,anchorComp,ordering);
    ComponentConnectorAnchor anchor=new ComponentConnectorAnchor(anchorComp,ConnectorAnchor.Direction.DOWN,true,false){
      @Override public boolean setFrom(      ConnectorAnchor from){
        ConnectorAnchor oldFromAnchor=getFrom();
        DirectivePanel oldFrom=DirectivePanel.findDirectivePanel(oldFromAnchor.getComponent());
        directiveConnectionRemoved(oldFrom);
        boolean ret=super.setFrom(from);
        if (from == null) {
synchronized (paramAnchors) {
            paramAnchors.remove(info);
            updateParamAnchors();
          }
        }
        return ret;
      }
    }
;
    info.anchor=anchor;
    paramAnchors.add(info);
    from.setTo(anchor);
    updateParamAnchors();
    return anchor;
  }
}

Fixed version (ground truth):
public ConnectorAnchor connectParamAnchor(ConnectorAnchor from,String ordering){
synchronized (paramAnchors) {
    final JPanel anchorComp=new JPanel();
    final ParamAnchorInfo info=new ParamAnchorInfo(null,anchorComp,ordering);
    ComponentConnectorAnchor anchor=new ComponentConnectorAnchor(anchorComp,ConnectorAnchor.Direction.DOWN,true,false){
      @Override public boolean setFrom(      ConnectorAnchor from){
        ConnectorAnchor oldFromAnchor=getFrom();
        DirectivePanel oldFrom=DirectivePanel.findDirectivePanel(oldFromAnchor.getComponent());
        directiveConnectionRemoved(oldFrom);
        boolean ret=super.setFrom(from);
        if (from == null) {
synchronized (paramAnchors) {
            paramAnchors.remove(info);
            updateParamAnchors();
            updateDetailsText();
          }
        }
        return ret;
      }
    }
;
    info.anchor=anchor;
    paramAnchors.add(info);
    from.setTo(anchor);
    updateParamAnchors();
    getEditor().applyInspectorChanges();
    updateDetailsText();
    return anchor;
  }
}
Program: 117692
Project: 117692
Buggy source:
public void openStoredQuery(StoredQuery query){
  HashMap<String,DirectivePanel> directiveMap=new HashMap<>();
  for (  DirectiveParameters params : query.directiveParameters) {
    try {
      Class cls=Class.forName(params.cls);
      DirectivePanel panel=null;
      if (!Directive.class.isAssignableFrom(cls))       throw new ClassCastException("String_Node_Str");
      if (cls.equals(FinalResultDirective.class)) {
        panel=finalResultPanel;
      }
 else {
        DirectiveUIHints hints=DirectiveUIHints.getDirectiveUIHints(cls);
        panel=addDirective(hints);
      }
      directiveMap.put(params.id,panel);
    }
 catch (    ClassNotFoundException|ClassCastException e) {
      Wandora.getWandora().handleError(e);
    }
  }
  for (  DirectiveParameters params : query.directiveParameters) {
    params.resolveDirectiveValues(directiveMap);
  }
  for (  DirectiveParameters params : query.directiveParameters) {
    DirectivePanel panel=directiveMap.get(params.id);
    panel.setDirectiveParams(params);
  }
}

Fixed version (ground truth):
public void openStoredQuery(StoredQuery query){
  HashMap<String,DirectivePanel> directiveMap=new HashMap<>();
  for (  DirectiveParameters params : query.directiveParameters) {
    try {
      Class cls=Class.forName(params.cls);
      DirectivePanel panel=null;
      if (!Directive.class.isAssignableFrom(cls))       throw new ClassCastException("String_Node_Str");
      if (cls.equals(FinalResultDirective.class)) {
        panel=finalResultPanel;
      }
 else {
        DirectiveUIHints hints=DirectiveUIHints.getDirectiveUIHints(cls);
        panel=addDirective(hints);
      }
      directiveMap.put(params.id,panel);
    }
 catch (    ClassNotFoundException|ClassCastException e) {
      Wandora.getWandora().handleError(e);
    }
  }
  for (  DirectiveParameters params : query.directiveParameters) {
    params.resolveDirectiveValues(directiveMap);
  }
  for (  DirectiveParameters params : query.directiveParameters) {
    DirectivePanel panel=directiveMap.get(params.id);
    panel.setDirectiveParams(params);
  }
  updatePanelSize();
}
Program: 117693
Project: 117693
Buggy source:
public void panelMoved(DirectivePanel panel){
  Rectangle rect=panel.getBounds();
  if (rect.x < 0) {
    changePanelSize(queryGraphPanel.getWidth() - rect.x,queryGraphPanel.getHeight(),-rect.x,0);
    rect=panel.getBounds();
  }
  if (rect.y < 0) {
    changePanelSize(queryGraphPanel.getWidth(),queryGraphPanel.getHeight() - rect.y,0,-rect.y);
    rect=panel.getBounds();
  }
  int width=Math.max(rect.x + rect.width,queryGraphPanel.getWidth());
  int height=Math.max(rect.y + rect.height,queryGraphPanel.getHeight());
  if (width != this.getWidth() || height != this.getHeight()) {
    changePanelSize(width,height,0,0);
  }
  queryGraphPanel.invalidate();
  queryGraphPanel.repaint();
}

Fixed version (ground truth):
public void panelMoved(DirectivePanel panel){
  Rectangle rect=panel.getBounds();
  if (rect.x < 0) {
    changePanelSize(queryGraphPanel.getWidth() - rect.x,queryGraphPanel.getHeight(),-rect.x,0);
    rect=panel.getBounds();
  }
  if (rect.y < 0) {
    changePanelSize(queryGraphPanel.getWidth(),queryGraphPanel.getHeight() - rect.y,0,-rect.y);
    rect=panel.getBounds();
  }
  updatePanelSize();
  queryGraphPanel.invalidate();
  queryGraphPanel.repaint();
}
Program: 117694
Project: 117694
Buggy source:
@Override public boolean setFrom(ConnectorAnchor from){
  boolean ret=super.setFrom(from);
  if (from == null) {
synchronized (paramAnchors) {
      paramAnchors.remove(info);
      updateParamAnchors();
    }
  }
  return ret;
}

Fixed version (ground truth):
@Override public boolean setFrom(ConnectorAnchor from){
  ConnectorAnchor oldFromAnchor=getFrom();
  DirectivePanel oldFrom=DirectivePanel.findDirectivePanel(oldFromAnchor.getComponent());
  directiveConnectionRemoved(oldFrom);
  boolean ret=super.setFrom(from);
  if (from == null) {
synchronized (paramAnchors) {
      paramAnchors.remove(info);
      updateParamAnchors();
    }
  }
  return ret;
}
Program: 117695
Project: 117695
Buggy source:
public ConnectorAnchor connectParamAnchor(ConnectorAnchor from,String ordering){
synchronized (paramAnchors) {
    final JPanel anchorComp=new JPanel();
    final ParamAnchorInfo info=new ParamAnchorInfo(null,anchorComp,ordering);
    ComponentConnectorAnchor anchor=new ComponentConnectorAnchor(anchorComp,ConnectorAnchor.Direction.DOWN,true,false){
      @Override public boolean setFrom(      ConnectorAnchor from){
        boolean ret=super.setFrom(from);
        if (from == null) {
synchronized (paramAnchors) {
            paramAnchors.remove(info);
            updateParamAnchors();
          }
        }
        return ret;
      }
    }
;
    info.anchor=anchor;
    paramAnchors.add(info);
    from.setTo(anchor);
    updateParamAnchors();
    return anchor;
  }
}

Fixed version (ground truth):
public ConnectorAnchor connectParamAnchor(ConnectorAnchor from,String ordering){
synchronized (paramAnchors) {
    final JPanel anchorComp=new JPanel();
    final ParamAnchorInfo info=new ParamAnchorInfo(null,anchorComp,ordering);
    ComponentConnectorAnchor anchor=new ComponentConnectorAnchor(anchorComp,ConnectorAnchor.Direction.DOWN,true,false){
      @Override public boolean setFrom(      ConnectorAnchor from){
        ConnectorAnchor oldFromAnchor=getFrom();
        DirectivePanel oldFrom=DirectivePanel.findDirectivePanel(oldFromAnchor.getComponent());
        directiveConnectionRemoved(oldFrom);
        boolean ret=super.setFrom(from);
        if (from == null) {
synchronized (paramAnchors) {
            paramAnchors.remove(info);
            updateParamAnchors();
          }
        }
        return ret;
      }
    }
;
    info.anchor=anchor;
    paramAnchors.add(info);
    from.setTo(anchor);
    updateParamAnchors();
    return anchor;
  }
}
Program: 117696
Project: 117696
Buggy source:
/** 
 * Creates new form DirectiveParameterPanel
 */
public DirectiveParameterPanel(Parameter parameter,DirectivePanel panel){
  super(parameter,panel);
  initComponents();
  disconnectButton.setVisible(false);
  connectorAnchor=new ComponentConnectorAnchor(directiveAnchor,Direction.RIGHT,true,false);
  DnDTools.addDropTargetHandler(directiveAnchor,DnDTools.directiveHintsDataFlavor,new DnDTools.DropTargetCallback<DirectiveUIHints>(){
    @Override public boolean callback(    JComponent component,    DirectiveUIHints hints,    TransferHandler.TransferSupport support){
      if (directiveType != null && !directiveType.isAssignableFrom(hints.getClass()))       return false;
      DirectivePanel directivePanel=getDirectivePanel();
      QueryEditorComponent editor=directivePanel.getEditor();
      DirectivePanel panel=editor.addDirective(hints);
      Point point=support.getDropLocation().getDropPoint();
      Rectangle rect=directivePanel.getBounds();
      panel.setBounds(rect.x + rect.width + 10,rect.y,panel.getWidth(),panel.getHeight());
      connectValue(panel);
      return true;
    }
  }
);
  DnDTools.addDropTargetHandler(directiveAnchor,DnDTools.directivePanelDataFlavor,new DnDTools.DropTargetCallback<DirectivePanel>(){
    @Override public boolean callback(    JComponent component,    DirectivePanel o,    TransferHandler.TransferSupport support){
      DirectivePanel directivePanel=getDirectivePanel();
      if (o == directivePanel)       return false;
      connectValue(o);
      return true;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Creates new form DirectiveParameterPanel
 */
public DirectiveParameterPanel(Parameter parameter,DirectivePanel panel){
  super(parameter,panel);
  initComponents();
  disconnectButton.setVisible(false);
  DnDTools.addDropTargetHandler(directiveAnchor,DnDTools.directiveHintsDataFlavor,new DnDTools.DropTargetCallback<DirectiveUIHints>(){
    @Override public boolean callback(    JComponent component,    DirectiveUIHints hints,    TransferHandler.TransferSupport support){
      if (directiveType != null && !directiveType.isAssignableFrom(hints.getClass()))       return false;
      DirectivePanel directivePanel=getDirectivePanel();
      QueryEditorComponent editor=directivePanel.getEditor();
      DirectivePanel panel=editor.addDirective(hints);
      Point point=support.getDropLocation().getDropPoint();
      Rectangle rect=directivePanel.getBounds();
      panel.setBounds(rect.x + rect.width + 10,rect.y,panel.getWidth(),panel.getHeight());
      connectValue(panel);
      return true;
    }
  }
);
  DnDTools.addDropTargetHandler(directiveAnchor,DnDTools.directivePanelDataFlavor,new DnDTools.DropTargetCallback<DirectivePanel>(){
    @Override public boolean callback(    JComponent component,    DirectivePanel o,    TransferHandler.TransferSupport support){
      DirectivePanel directivePanel=getDirectivePanel();
      if (o == directivePanel)       return false;
      connectValue(o);
      return true;
    }
  }
);
}
Program: 117697
Project: 117697
Buggy source:
public String buildScript(){
  applyInspectorChanges();
  DirectivePanel p=getRootPanel();
  if (p == null)   return null;
 else   return p.buildScript();
}

Fixed version (ground truth):
public String buildScript(){
  applyInspectorChanges();
  DirectivePanel p=getRootPanel();
  if (p == null)   return null;
 else   return "String_Node_Str" + p.buildScript();
}
Program: 117698
Project: 117698
Buggy source:
public static String debugStringInner(Directive directive,String indent){
  StringBuffer sb=new StringBuffer("String_Node_Str");
  sb.append("String_Node_Str" + indent);
  sb.append(directive.debugString(indent + "String_Node_Str"));
  sb.append("String_Node_Str" + indent);
  return sb.toString();
}

Fixed version (ground truth):
public static String debugStringInner(Directive directive,String indent){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append("String_Node_Str" + indent);
  if (directive == null)   sb.append("String_Node_Str");
 else   sb.append(directive.debugString(indent + "String_Node_Str"));
  sb.append("String_Node_Str" + indent);
  return sb.toString();
}
Program: 117699
Project: 117699
Buggy source:
/** 
 * Creates new form SearchTopicsFrame
 */
public SearchTopicsFrame(){
  Wandora wandora=Wandora.getWandora();
  setAlwaysOnTop(false);
  setTitle("String_Node_Str");
  initComponents();
  searchPanels=new SearchTopicPanel();
  searchPanels.setUseResultScrollPanes(true);
  searchPanels.init();
  containerPanel.add(searchPanels.getGui(),BorderLayout.CENTER);
  setSize(850,600);
  if (wandora != null) {
    setIconImages(wandora.wandoraIcons);
    wandora.centerWindow(this);
  }
}

Fixed version (ground truth):
/** 
 * Creates new form SearchTopicsFrame
 */
public SearchTopicsFrame(){
  super(Wandora.getWandora(),false);
  Wandora wandora=Wandora.getWandora();
  setAlwaysOnTop(false);
  setTitle("String_Node_Str");
  initComponents();
  searchPanels=new SearchTopicPanel();
  searchPanels.setUseResultScrollPanes(true);
  searchPanels.init();
  containerPanel.add(searchPanels.getGui(),BorderLayout.CENTER);
  setSize(850,600);
  if (wandora != null) {
    setIconImages(wandora.wandoraIcons);
    wandora.centerWindow(this);
  }
}
Program: 117700
Project: 117700
Buggy source:
protected JSONObject getRequestJSON(HttpServletRequest request) throws IOException {
  BufferedReader in=new BufferedReader(new InputStreamReader(request.getInputStream(),"String_Node_Str"));
  StringBuilder sb=new StringBuilder();
  String str;
  while ((str=in.readLine()) != null) {
    sb.append(str);
  }
  in.close();
  if (str != null && str.length() > 0) {
    try {
      JSONObject requestJSON=new JSONObject(sb.toString());
      return requestJSON;
    }
 catch (    JSONException ex) {
      ex.printStackTrace();
    }
  }
  return null;
}

Fixed version (ground truth):
protected JSONObject getRequestJSON(HttpServletRequest request) throws IOException {
  BufferedReader in=new BufferedReader(new InputStreamReader(request.getInputStream(),"String_Node_Str"));
  StringBuilder sb=new StringBuilder();
  String str;
  while ((str=in.readLine()) != null) {
    sb.append(str);
  }
  in.close();
  if (sb.length() > 0) {
    try {
      JSONObject requestJSON=new JSONObject(sb.toString());
      return requestJSON;
    }
 catch (    JSONException ex) {
      ex.printStackTrace();
    }
  }
  return null;
}
Program: 117703
Project: 117703
Buggy source:
@Override public synchronized void setValue(Object o){
  for (  Row row : rows) {
    row.panel.disconnect();
  }
  parametersPanel.removeAll();
  rows.clear();
  Object[] a=(Object[])o;
  for (  Object ao : a) {
    addParameter();
    Row row=rows.get(rows.size() - 1);
    row.panel.setValue(ao);
  }
}

Fixed version (ground truth):
@Override public synchronized void setValue(Object o){
  for (  Row row : rows) {
    row.panel.disconnect();
  }
  parametersPanel.removeAll();
  rows.clear();
  if (o != null) {
    Object[] a=(Object[])o;
    for (    Object ao : a) {
      addParameter();
      Row row=rows.get(rows.size() - 1);
      row.panel.setValue(ao);
    }
  }
}
Program: 117704
Project: 117704
Buggy source:
public static Addon[] getStandardAddonHints(Addon[] extras){
  ArrayList<Addon> addons=new ArrayList<Addon>();
  addons.add(new Addon("String_Node_Str",new Parameter[]{new Parameter(String.class,false,"String_Node_Str")},"String_Node_Str"));
  addons.add(new Addon("String_Node_Str",new Parameter[]{new Parameter(String.class,false,"String_Node_Str"),new Parameter(String.class,false,"String_Node_Str")},"String_Node_Str"));
  addons.add(new Addon("String_Node_Str",new Parameter[]{new Parameter(String.class,true,"String_Node_Str")},"String_Node_Str"));
  addons.add(new Addon("String_Node_Str",new Parameter[]{new Parameter(String.class,false,"String_Node_Str")},"String_Node_Str"));
  addons.add(new Addon("String_Node_Str",new Parameter[]{new Parameter(Directive.class,false,"String_Node_Str")},"String_Node_Str"));
  addons.add(new Addon("String_Node_Str",new Parameter[]{new Parameter(TopicOperand.class,false,"String_Node_Str"),new Parameter(String.class,false,"String_Node_Str"),new Parameter(TopicOperand.class,false,"String_Node_Str")},"String_Node_Str"));
  if (extras != null && extras.length > 0) {
    for (int i=0; i < extras.length; i++) {
      addons.add(extras[i]);
    }
  }
  return addons.toArray(new Addon[addons.size()]);
}

Fixed version (ground truth):
public static Addon[] getStandardAddonHints(Addon[] extras){
  ArrayList<Addon> addons=new ArrayList<Addon>();
  addons.add(new Addon("String_Node_Str",new Parameter[]{new Parameter(String.class,false,"String_Node_Str")},"String_Node_Str"));
  addons.add(new Addon("String_Node_Str",new Parameter[]{new Parameter(String.class,false,"String_Node_Str"),new Parameter(String.class,false,"String_Node_Str")},"String_Node_Str"));
  addons.add(new Addon("String_Node_Str",new Parameter[]{new Parameter(String.class,true,"String_Node_Str")},"String_Node_Str"));
  addons.add(new Addon("String_Node_Str",new Parameter[]{new Parameter(String.class,false,"String_Node_Str")},"String_Node_Str"));
  addons.add(new Addon("String_Node_Str",new Parameter[]{new Parameter(Directive.class,false,"String_Node_Str")},"String_Node_Str"));
  addons.add(new Addon("String_Node_Str",new Parameter[]{new Parameter(Operand.class,false,"String_Node_Str"),new Parameter(String.class,false,"String_Node_Str"),new Parameter(Operand.class,false,"String_Node_Str")},"String_Node_Str"));
  addons.add(new Addon("String_Node_Str",new Parameter[]{new Parameter(TopicOperand.class,false,"String_Node_Str"),new Parameter(String.class,false,"String_Node_Str"),new Parameter(TopicOperand.class,false,"String_Node_Str")},"String_Node_Str"));
  if (extras != null && extras.length > 0) {
    for (int i=0; i < extras.length; i++) {
      addons.add(extras[i]);
    }
  }
  return addons.toArray(new Addon[addons.size()]);
}
Program: 117705
Project: 117705
Buggy source:
@Override public DirectiveUIHints getUIHints(){
  DirectiveUIHints ret=new DirectiveUIHints(Regex.class,new DirectiveUIHints.Constructor[]{new DirectiveUIHints.Constructor(new DirectiveUIHints.Parameter[]{new DirectiveUIHints.Parameter(String.class,false,"String_Node_Str")},"String_Node_Str")},Directive.getStandardAddonHints(),"String_Node_Str","String_Node_Str");
  return ret;
}

Fixed version (ground truth):
@Override public DirectiveUIHints getUIHints(){
  DirectiveUIHints ret=new DirectiveUIHints(Regex.class,new DirectiveUIHints.Constructor[]{new DirectiveUIHints.Constructor(new DirectiveUIHints.Parameter[]{new DirectiveUIHints.Parameter(String.class,false,"String_Node_Str")},"String_Node_Str"),new DirectiveUIHints.Constructor(new DirectiveUIHints.Parameter[]{new DirectiveUIHints.Parameter(String.class,false,"String_Node_Str"),new DirectiveUIHints.Parameter(Integer.class,false,"String_Node_Str")},"String_Node_Str"),new DirectiveUIHints.Constructor(new DirectiveUIHints.Parameter[]{new DirectiveUIHints.Parameter(String.class,false,"String_Node_Str"),new DirectiveUIHints.Parameter(String.class,false,"String_Node_Str")},"String_Node_Str"),new DirectiveUIHints.Constructor(new DirectiveUIHints.Parameter[]{new DirectiveUIHints.Parameter(Operand.class,false,"String_Node_Str"),new DirectiveUIHints.Parameter(Operand.class,false,"String_Node_Str"),new DirectiveUIHints.Parameter(Integer.class,false,"String_Node_Str")},"String_Node_Str")},Directive.getStandardAddonHints(),"String_Node_Str","String_Node_Str");
  return ret;
}
Program: 117707
Project: 117707
Buggy source:
public void save(String name){
  QueryEditorComponent graph=findGraph();
  StoredQuery query=graph.getStoredQuery();
  if (query == null)   return;
  query.name=name;
synchronized (storedQueries) {
    boolean saved=false;
    for (int i=0; i < storedQueries.size(); i++) {
      StoredQuery q=storedQueries.get(i);
      if (q.name != null && q.name.equals(name)) {
        saved=true;
        storedQueries.set(i,query);
        break;
      }
    }
    if (!saved) {
      storedQueries.add(query);
      DefaultListModel model=(DefaultListModel)queryList.getModel();
      model.addElement(query);
    }
  }
  writeQueries(Wandora.getWandora().getOptions());
}

Fixed version (ground truth):
public void save(String name){
  QueryEditorComponent graph=findGraph();
  StoredQuery query=graph.getStoredQuery();
  if (query == null)   return;
  query.name=name;
synchronized (storedQueries) {
    boolean saved=false;
    for (int i=0; i < storedQueries.size(); i++) {
      StoredQuery q=storedQueries.get(i);
      if (q.name != null && q.name.equals(name)) {
        saved=true;
        storedQueries.set(i,query);
        break;
      }
    }
    if (!saved) {
      storedQueries.add(query);
      DefaultListModel model=(DefaultListModel)queryList.getModel();
      model.addElement(query);
    }
  }
  writeQueries(Wandora.getWandora().getOptions());
  readQueries(Wandora.getWandora().getOptions());
}
Program: 117710
Project: 117710
Buggy source:
protected void parseThing(JSONObject thing,TopicMap tm,HashMap<String,Topic> thingTypes){
  progress=(progress + 1) % 100;
  getDefaultLogger().setProgress(progress);
  if (forceStop()) {
    return;
  }
  try {
    if (thing.has("String_Node_Str")) {
      Object error=thing.get("String_Node_Str");
      throw new JSONException("String_Node_Str" + statusToPhrase((int)error) + "String_Node_Str");
    }
    JSONObject data=thing.getJSONObject("String_Node_Str");
    String kind=thing.getString("String_Node_Str");
switch (kind) {
case THING_TYPE_COMMENT:
      parseComment(thing,thingTypes,tm);
    break;
case THING_TYPE_LINK:
  parseLink(thing,thingTypes,tm);
break;
case THING_TYPE_ACCOUNT:
parseAccount(thing,thingTypes,tm);
break;
case THING_TYPE_SUBREDDIT:
parseSubreddit(thing,thingTypes,tm);
break;
}
if (data.has("String_Node_Str")) {
JSONArray children=data.getJSONArray("String_Node_Str");
for (int i=0; i < children.length(); i++) {
try {
JSONObject child=children.getJSONObject(i);
if (child.getString("String_Node_Str").equals(THING_TYPE_MORE)) {
parseMore(data,child,tm,thingTypes);
}
 else {
parseThing(child,tm,thingTypes);
}
}
 catch (JSONException jse) {
}
}
}
}
 catch (JSONException jse) {
log("String_Node_Str" + jse.getMessage());
try {
log("String_Node_Str");
log(thing.toString(2));
}
 catch (JSONException jsee) {
log("String_Node_Str");
}
}
catch (TopicMapException tme) {
log(tme.getMessage());
}
}

Fixed version (ground truth):
protected void parseThing(JSONObject thing,TopicMap tm,HashMap<String,Topic> thingTypes){
  progress=(progress + 1) % 100;
  getDefaultLogger().setProgress(progress);
  if (forceStop()) {
    return;
  }
  try {
    if (thing.has("String_Node_Str")) {
      Object error=thing.get("String_Node_Str");
      throw new JSONException("String_Node_Str" + statusToPhrase((int)error) + "String_Node_Str");
    }
    JSONObject data=thing.getJSONObject("String_Node_Str");
    String kind=thing.getString("String_Node_Str");
switch (kind) {
case THING_TYPE_COMMENT:
      parseComment(thing,thingTypes,tm);
    break;
case THING_TYPE_LINK:
  parseLink(thing,thingTypes,tm);
break;
case THING_TYPE_ACCOUNT:
parseAccount(thing,thingTypes,tm);
break;
case THING_TYPE_SUBREDDIT:
parseSubreddit(thing,thingTypes,tm);
break;
}
if (data.has("String_Node_Str")) {
JSONArray children=data.getJSONArray("String_Node_Str");
for (int i=0; i < children.length(); i++) {
JSONObject child;
try {
child=children.getJSONObject(i);
}
 catch (JSONException jse) {
continue;
}
parseThing(child,tm,thingTypes);
}
}
}
 catch (JSONException jse) {
log("String_Node_Str" + jse.getMessage());
try {
log("String_Node_Str");
log(thing.toString(2));
}
 catch (JSONException jsee) {
log("String_Node_Str");
}
jse.printStackTrace();
}
catch (TopicMapException tme) {
log(tme.getMessage());
}
}
Program: 117711
Project: 117711
Buggy source:
private Topic parseSubreddit(JSONObject subreddit,HashMap<String,Topic> thingTypes,TopicMap tm) throws JSONException, TopicMapException {
  if (forceStop()) {
    return null;
  }
  JSONObject subredditData=subreddit.getJSONObject("String_Node_Str");
  String kind=subreddit.getString("String_Node_Str");
  String id=subredditData.getString("String_Node_Str");
  String disp=subredditData.getString("String_Node_Str");
  log("String_Node_Str" + disp);
  Topic subredditTopic=getOrCreateTopic(tm,SI_ROOT + id);
  subredditTopic.setDisplayName("String_Node_Str",disp);
  subredditTopic.setBaseName(disp + "String_Node_Str" + id+ "String_Node_Str");
  addSubredditOccurrenceData(tm,subredditData,subredditTopic);
  subredditTopic.addType(thingTypes.get(kind));
  if (CRAWL_SETTINGS.get("String_Node_Str")) {
    ParseCallback<JsonNode> callback=new ParseCallback<JsonNode>(tm,thingTypes){
      @Override public void run(      HttpResponse<JsonNode> response){
        try {
          JSONObject respObj=response.getBody().getObject();
          parseThing(respObj,tm,thingTypes);
        }
 catch (        Exception e) {
          log(e.getMessage());
        }
      }
    }
;
    requester.doRequest(Unirest.get(apiRoot + "String_Node_Str" + disp+ "String_Node_Str"),callback);
  }
  return subredditTopic;
}

Fixed version (ground truth):
private Topic parseSubreddit(JSONObject subreddit,HashMap<String,Topic> thingTypes,TopicMap tm) throws JSONException, TopicMapException {
  if (forceStop()) {
    return null;
  }
  JSONObject subredditData=subreddit.getJSONObject("String_Node_Str");
  String kind=subreddit.getString("String_Node_Str");
  String id=subredditData.getString("String_Node_Str");
  String disp=subredditData.getString("String_Node_Str");
  log("String_Node_Str" + disp);
  Topic subredditTopic=getOrCreateTopic(tm,SI_ROOT + id);
  subredditTopic.setDisplayName("String_Node_Str",disp);
  subredditTopic.setBaseName(disp + "String_Node_Str" + id+ "String_Node_Str");
  addSubredditOccurrenceData(tm,subredditData,subredditTopic);
  subredditTopic.addType(thingTypes.get(kind));
  if (CRAWL_SETTINGS.get("String_Node_Str")) {
    ParseCallback<JsonNode> callback=new ParseCallback<JsonNode>(tm,thingTypes){
      @Override public void run(      HttpResponse<JsonNode> response){
        try {
          JSONObject respObj=response.getBody().getObject();
          parseThing(respObj,tm,thingTypes);
        }
 catch (        Exception e) {
          log(e.getMessage());
        }
      }
      @Override protected void error(      Exception e,      String body){
        log(e.getMessage());
        if (body != null) {
          log("String_Node_Str");
          log(body);
        }
      }
    }
;
    requester.doRequest(Unirest.get(apiRoot + "String_Node_Str" + disp+ "String_Node_Str"),callback);
  }
  return subredditTopic;
}
Program: 117714
Project: 117714
Buggy source:
private void threadPopulationCallback(HttpResponse<JsonNode> response){
  DefaultListModel model=new DefaultListModel();
  try {
    JSONObject resJson=response.getBody().getObject();
    if (resJson.has("String_Node_Str")) {
      Object error=resJson.get("String_Node_Str");
      throw new JSONException("String_Node_Str" + statusToPhrase((int)error));
    }
    threadResults=resJson.getJSONObject("String_Node_Str").getJSONArray("String_Node_Str");
    JSONObject r;
    model=new DefaultListModel();
    for (int i=0; i < threadResults.length(); i++) {
      r=threadResults.getJSONObject(i).getJSONObject("String_Node_Str");
      StringBuilder titleBuilder=new StringBuilder();
      titleBuilder.append("String_Node_Str").append(r.getString("String_Node_Str")).append("String_Node_Str").append(r.getString("String_Node_Str")).append("String_Node_Str").append(r.getString("String_Node_Str"));
      model.add(i,titleBuilder.toString());
    }
  }
 catch (  Exception e) {
    model.add(0,e.getMessage());
  }
 finally {
    threadResList.setModel(model);
    threadSearchSubmit.setText("String_Node_Str");
    threadSearchSubmit.setEnabled(true);
  }
}

Fixed version (ground truth):
private void threadPopulationCallback(HttpResponse<JsonNode> response){
  DefaultListModel model=new DefaultListModel();
  try {
    JSONObject resJson=response.getBody().getObject();
    if (resJson.has("String_Node_Str")) {
      Object error=resJson.get("String_Node_Str");
      throw new JSONException("String_Node_Str" + statusToPhrase((int)error));
    }
    threadResults=resJson.getJSONObject("String_Node_Str").getJSONArray("String_Node_Str");
    JSONObject r;
    model=new DefaultListModel();
    for (int i=0; i < threadResults.length(); i++) {
      r=threadResults.getJSONObject(i).getJSONObject("String_Node_Str");
      StringBuilder titleBuilder=new StringBuilder();
      titleBuilder.append("String_Node_Str").append(r.getString("String_Node_Str")).append("String_Node_Str").append(r.getString("String_Node_Str")).append("String_Node_Str").append(r.getInt("String_Node_Str"));
      model.add(i,titleBuilder.toString());
    }
  }
 catch (  Exception e) {
    model.add(0,e.getMessage());
  }
 finally {
    threadResList.setModel(model);
    threadSearchSubmit.setText("String_Node_Str");
    threadSearchSubmit.setEnabled(true);
  }
}
Program: 117715
Project: 117715
Buggy source:
private void populateThreadSearch(){
  threadSearchSubmit.setText("String_Node_Str");
  threadSearchSubmit.setEnabled(false);
  String q=threadSearchField.getText();
  ParseCallback<JsonNode> callback=new ParseCallback<JsonNode>(){
    @Override public void run(    HttpResponse<JsonNode> response){
      threadPopulationCallback(response);
    }
  }
;
  AbstractRedditExtractor.getSubmissions(q,callback);
}

Fixed version (ground truth):
private void populateThreadSearch(){
  threadSearchSubmit.setText("String_Node_Str");
  threadSearchSubmit.setEnabled(false);
  String q=threadSearchField.getText();
  ParseCallback<JsonNode> callback=new ParseCallback<JsonNode>(){
    @Override public void run(    HttpResponse<JsonNode> response){
      threadPopulationCallback(response);
    }
    @Override protected void error(    Exception e,    String body){
      DefaultListModel model=new DefaultListModel();
      model.add(0,e.getMessage());
      threadResList.setModel(model);
      threadSearchSubmit.setText("String_Node_Str");
      threadSearchSubmit.setEnabled(true);
    }
  }
;
  AbstractRedditExtractor.getSubmissions(q,callback);
}
Program: 117716
Project: 117716
Buggy source:
private void populateSubredditSearch(){
  subredditSearchSubmit.setText("String_Node_Str");
  subredditSearchSubmit.setEnabled(false);
  String q=subredditSearchField.getText();
  ParseCallback<JsonNode> callback=new ParseCallback<JsonNode>(){
    @Override public void run(    HttpResponse<JsonNode> response){
      subredditPopulationCallback(response);
    }
  }
;
  AbstractRedditExtractor.getSubreddits(q,callback);
}

Fixed version (ground truth):
private void populateSubredditSearch(){
  subredditSearchSubmit.setText("String_Node_Str");
  subredditSearchSubmit.setEnabled(false);
  String q=subredditSearchField.getText();
  ParseCallback<JsonNode> callback=new ParseCallback<JsonNode>(){
    @Override public void run(    HttpResponse<JsonNode> response){
      subredditPopulationCallback(response);
    }
    @Override protected void error(    Exception e,    String body){
      DefaultListModel model=new DefaultListModel();
      model.add(0,e.getMessage());
      subredditResList.setModel(model);
      subredditSearchSubmit.setText("String_Node_Str");
      subredditSearchSubmit.setEnabled(true);
    }
  }
;
  AbstractRedditExtractor.getSubreddits(q,callback);
}
Program: 117717
Project: 117717
Buggy source:
@Override public boolean _extractTopicsFrom(String str,TopicMap tm) throws Exception {
  log("String_Node_Str" + str);
  ParseCallback<JsonNode> callback=new ParseCallback<JsonNode>(){
    @Override public void run(    HttpResponse<JsonNode> response){
      try {
        parse(response);
      }
 catch (      JSONException|TopicMapException e) {
        log(e.getMessage());
      }
    }
  }
;
  requester.doRequest(Unirest.get(str),callback);
  boolean shouldQuit=false;
  while (!shouldQuit) {
    Thread.sleep(1000);
    shouldQuit=forceStop() || !requester.hasJobs();
  }
  requester.cancel();
  return true;
}

Fixed version (ground truth):
@Override public boolean _extractTopicsFrom(String str,TopicMap tm) throws Exception {
  ParseCallback<JsonNode> callback=new ParseCallback<JsonNode>(){
    @Override public void run(    HttpResponse<JsonNode> response){
      try {
        parse(response);
      }
 catch (      JSONException|TopicMapException e) {
        log(e.getMessage());
      }
    }
    @Override protected void error(    Exception e,    String body){
      log(e.getMessage());
      if (body != null) {
        log("String_Node_Str");
        log(body);
      }
    }
  }
;
  requester.doRequest(Unirest.get(str),callback);
  boolean shouldQuit=false;
  while (!shouldQuit) {
    Thread.sleep(2000);
    shouldQuit=forceStop() || !requester.hasJobs();
  }
  requester.cancel();
  return true;
}
Program: 117718
Project: 117718
Buggy source:
@Override public boolean setFrom(ConnectorAnchor from){
  boolean ret=super.setFrom(from);
  if (from == null) {
    parameterDirectiveAnchors.remove(anchorComp);
    layout.setColumns(paramsConnectors.size() - 1);
synchronized (paramsConnectors) {
      paramsConnectors.remove(this);
    }
  }
  return ret;
}

Fixed version (ground truth):
@Override public boolean setFrom(ConnectorAnchor from){
  boolean ret=super.setFrom(from);
  if (from == null) {
synchronized (paramAnchors) {
      paramAnchors.remove(info);
      updateParamAnchors();
    }
  }
  return ret;
}
Program: 117719
Project: 117719
Buggy source:
public ConnectorAnchor connectParamAnchor(ConnectorAnchor from){
synchronized (paramsConnectors) {
    final JPanel anchorComp=new JPanel();
    final GridLayout layout=(GridLayout)parameterDirectiveAnchors.getLayout();
    layout.setColumns(paramsConnectors.size() + 1);
    parameterDirectiveAnchors.add(anchorComp);
    parameterDirectiveAnchors.revalidate();
    ComponentConnectorAnchor anchor=new ComponentConnectorAnchor(anchorComp,ConnectorAnchor.Direction.DOWN,true,false){
      @Override public boolean setFrom(      ConnectorAnchor from){
        boolean ret=super.setFrom(from);
        if (from == null) {
          parameterDirectiveAnchors.remove(anchorComp);
          layout.setColumns(paramsConnectors.size() - 1);
synchronized (paramsConnectors) {
            paramsConnectors.remove(this);
          }
        }
        return ret;
      }
    }
;
    paramsConnectors.add(anchor);
    from.setTo(anchor);
    return anchor;
  }
}

Fixed version (ground truth):
public ConnectorAnchor connectParamAnchor(ConnectorAnchor from,String ordering){
synchronized (paramAnchors) {
    final JPanel anchorComp=new JPanel();
    final ParamAnchorInfo info=new ParamAnchorInfo(null,anchorComp,ordering);
    ComponentConnectorAnchor anchor=new ComponentConnectorAnchor(anchorComp,ConnectorAnchor.Direction.DOWN,true,false){
      @Override public boolean setFrom(      ConnectorAnchor from){
        boolean ret=super.setFrom(from);
        if (from == null) {
synchronized (paramAnchors) {
            paramAnchors.remove(info);
            updateParamAnchors();
          }
        }
        return ret;
      }
    }
;
    info.anchor=anchor;
    paramAnchors.add(info);
    from.setTo(anchor);
    updateParamAnchors();
    return anchor;
  }
}
Program: 117720
Project: 117720
Buggy source:
public void connectValue(DirectivePanel p){
  if (p == null) {
    if (fromAnchor != null)     fromAnchor.setTo(null);
    disconnectButton.setVisible(false);
    directiveAnchor.setVisible(true);
    fromPanel=null;
    fromAnchor=null;
    return;
  }
  fromAnchor=p.getFromConnectorAnchor();
  fromPanel=p;
  getDirectivePanel().connectParamAnchor(fromAnchor);
  disconnectButton.setVisible(true);
  directiveAnchor.setVisible(false);
}

Fixed version (ground truth):
public void connectValue(DirectivePanel p){
  if (p == null) {
    if (fromAnchor != null)     fromAnchor.setTo(null);
    disconnectButton.setVisible(false);
    directiveAnchor.setVisible(true);
    fromPanel=null;
    fromAnchor=null;
    return;
  }
  fromAnchor=p.getFromConnectorAnchor();
  fromPanel=p;
  getDirectivePanel().connectParamAnchor(fromAnchor,this.orderingHint);
  disconnectButton.setVisible(true);
  directiveAnchor.setVisible(false);
}
Program: 117721
Project: 117721
Buggy source:
public synchronized void addParameter(){
  final AbstractTypePanel paramPanel;
  try {
    Constructor c=typeCls.getConstructor(Parameter.class,DirectivePanel.class);
    paramPanel=(AbstractTypePanel)c.newInstance(this.parameter,this.directivePanel);
  }
 catch (  IllegalAccessException|InstantiationException|NoSuchMethodException|IllegalArgumentException|InvocationTargetException|SecurityException e) {
    Wandora.getWandora().handleError(e);
    return;
  }
  GridBagConstraints gbc=new GridBagConstraints();
  gbc.gridx=0;
  gbc.gridy=rows.size();
  JButton removeButton=new JButton();
  removeButton.setText("String_Node_Str");
  removeButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      removeParameter(paramPanel);
    }
  }
);
  parametersPanel.add(removeButton,gbc);
  gbc.gridx=1;
  gbc.weightx=1.0;
  gbc.fill=GridBagConstraints.HORIZONTAL;
  paramPanel.setLabel("String_Node_Str");
  parametersPanel.add(paramPanel,gbc);
  this.revalidate();
  parametersPanel.repaint();
  rows.add(new Row(paramPanel,removeButton));
}

Fixed version (ground truth):
public synchronized void addParameter(){
  final AbstractTypePanel paramPanel;
  try {
    Constructor c=typeCls.getConstructor(Parameter.class,DirectivePanel.class);
    paramPanel=(AbstractTypePanel)c.newInstance(this.parameter,this.directivePanel);
  }
 catch (  IllegalAccessException|InstantiationException|NoSuchMethodException|IllegalArgumentException|InvocationTargetException|SecurityException e) {
    Wandora.getWandora().handleError(e);
    return;
  }
  GridBagConstraints gbc=new GridBagConstraints();
  gbc.gridx=0;
  gbc.gridy=rows.size();
  JButton removeButton=new JButton();
  removeButton.setText("String_Node_Str");
  removeButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      removeParameter(paramPanel);
    }
  }
);
  parametersPanel.add(removeButton,gbc);
  gbc.gridx=1;
  gbc.weightx=1.0;
  gbc.fill=GridBagConstraints.HORIZONTAL;
  paramPanel.setLabel("String_Node_Str");
  parametersPanel.add(paramPanel,gbc);
  if (this.orderingHint != null) {
    paramPanel.setOrderingHint(orderingHint + rows.size());
  }
  this.revalidate();
  parametersPanel.repaint();
  rows.add(new Row(paramPanel,removeButton));
}
Program: 117722
Project: 117722
Buggy source:
protected boolean operandTypeChanged(){
  if (parameterPanel != null)   parameterPanel.disconnect();
  parameterPanel=null;
  Object o=operandTypeComboBox.getSelectedItem();
  if (o == null) {
    operandPanel.removeAll();
    this.revalidate();
    operandPanel.repaint();
    return true;
  }
  String type=o.toString();
  if (type.equalsIgnoreCase("String_Node_Str")) {
    operandPanel.removeAll();
    StringParameterPanel p=new StringParameterPanel(parameter,this.directivePanel);
    p.setLabel("String_Node_Str");
    operandPanel.add(p);
    this.revalidate();
    operandPanel.repaint();
    parameterPanel=p;
    return true;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    operandPanel.removeAll();
    DirectiveParameterPanel p=new DirectiveParameterPanel(parameter,this.directivePanel);
    p.setLabel("String_Node_Str");
    operandPanel.add(p);
    this.revalidate();
    operandPanel.repaint();
    parameterPanel=p;
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
protected boolean operandTypeChanged(){
  if (parameterPanel != null)   parameterPanel.disconnect();
  parameterPanel=null;
  Object o=operandTypeComboBox.getSelectedItem();
  if (o == null) {
    operandPanel.removeAll();
    this.revalidate();
    operandPanel.repaint();
    return true;
  }
  String type=o.toString();
  if (type.equalsIgnoreCase("String_Node_Str")) {
    operandPanel.removeAll();
    StringParameterPanel p=new StringParameterPanel(parameter,this.directivePanel);
    p.setLabel("String_Node_Str");
    p.setOrderingHint(this.orderingHint);
    operandPanel.add(p);
    this.revalidate();
    operandPanel.repaint();
    parameterPanel=p;
    return true;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    operandPanel.removeAll();
    DirectiveParameterPanel p=new DirectiveParameterPanel(parameter,this.directivePanel);
    p.setLabel("String_Node_Str");
    p.setOrderingHint(this.orderingHint);
    operandPanel.add(p);
    this.revalidate();
    operandPanel.repaint();
    parameterPanel=p;
    return true;
  }
 else   return false;
}
Program: 117723
Project: 117723
Buggy source:
@Override protected boolean operandTypeChanged(){
  if (super.operandTypeChanged())   return true;
  Object o=operandTypeComboBox.getSelectedItem();
  if (o == null)   return false;
  String type=o.toString();
  if (type.equalsIgnoreCase("String_Node_Str")) {
    operandPanel.removeAll();
    TopicParameterPanel p=new TopicParameterPanel(parameter,this.directivePanel);
    p.setLabel("String_Node_Str");
    operandPanel.add(p);
    this.revalidate();
    operandPanel.repaint();
    parameterPanel=p;
    return true;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    operandPanel.removeAll();
    StringParameterPanel p=new StringParameterPanel(parameter,this.directivePanel);
    p.setLabel("String_Node_Str");
    operandPanel.add(p);
    this.revalidate();
    operandPanel.repaint();
    parameterPanel=p;
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
@Override protected boolean operandTypeChanged(){
  if (super.operandTypeChanged())   return true;
  Object o=operandTypeComboBox.getSelectedItem();
  if (o == null)   return false;
  String type=o.toString();
  if (type.equalsIgnoreCase("String_Node_Str")) {
    operandPanel.removeAll();
    TopicParameterPanel p=new TopicParameterPanel(parameter,this.directivePanel);
    p.setLabel("String_Node_Str");
    p.setOrderingHint(this.orderingHint);
    operandPanel.add(p);
    this.revalidate();
    operandPanel.repaint();
    parameterPanel=p;
    return true;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    operandPanel.removeAll();
    StringParameterPanel p=new StringParameterPanel(parameter,this.directivePanel);
    p.setLabel("String_Node_Str");
    p.setOrderingHint(this.orderingHint);
    operandPanel.add(p);
    this.revalidate();
    operandPanel.repaint();
    parameterPanel=p;
    return true;
  }
 else   return false;
}