nus-yam/ex-repair huggingface dataset:
Program: 167183
Project: 167183
Buggy source:
@Override public boolean thisOrChildrenFocused(){
  boolean ret=this.isFocusOwner() || openingFile;
  ret=ret || (scrLexicon != null && scrLexicon.thisOrChildrenFocused());
  ret=ret || (scrGrammar != null && scrGrammar.thisOrChildrenFocused());
  ret=ret || (scrLogos != null && scrLogos.thisOrChildrenFocused());
  ret=ret || (scrThes != null && scrThes.thisOrChildrenFocused());
  return ret;
}

Fixed version (ground truth):
@Override public boolean thisOrChildrenFocused(){
  boolean ret=this.isFocusOwner() || holdFront;
  ret=ret || (scrLexicon != null && scrLexicon.thisOrChildrenFocused());
  ret=ret || (scrGrammar != null && scrGrammar.thisOrChildrenFocused());
  ret=ret || (scrLogos != null && scrLogos.thisOrChildrenFocused());
  ret=ret || (scrThes != null && scrThes.thisOrChildrenFocused());
  return ret;
}
Program: 167184
Project: 167184
Buggy source:
/** 
 * opens dictionary file
 */
public void open(){
  boolean localOpening=openingFile;
  openingFile=true;
  if (!saveOrCancelTest()) {
    return;
  }
  JFileChooser chooser=new JFileChooser();
  chooser.setDialogTitle("String_Node_Str");
  FileNameExtensionFilter filter=new FileNameExtensionFilter("String_Node_Str","String_Node_Str","String_Node_Str");
  chooser.setFileFilter(filter);
  String fileName;
  chooser.setCurrentDirectory(new File("String_Node_Str"));
  if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
    fileName=chooser.getSelectedFile().getAbsolutePath();
  }
 else {
    return;
  }
  openingFile=localOpening;
  core=new DictCore();
  core.setRootWindow(this);
  setFile(fileName);
  pushRecentFile(fileName);
  populateRecentOpened();
}

Fixed version (ground truth):
/** 
 * opens dictionary file
 */
public void open(){
  if (!saveOrCancelTest()) {
    return;
  }
  JFileChooser chooser=new JFileChooser();
  chooser.setDialogTitle("String_Node_Str");
  FileNameExtensionFilter filter=new FileNameExtensionFilter("String_Node_Str","String_Node_Str","String_Node_Str");
  chooser.setFileFilter(filter);
  String fileName;
  chooser.setCurrentDirectory(new File("String_Node_Str"));
  holdFront=true;
  if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
    fileName=chooser.getSelectedFile().getAbsolutePath();
  }
 else {
    return;
  }
  holdFront=false;
  core=new DictCore();
  core.setRootWindow(this);
  setFile(fileName);
  pushRecentFile(fileName);
  populateRecentOpened();
}
Program: 167185
Project: 167185
Buggy source:
/** 
 * Checks whether PolyGlot has focus, and sets main menu to always on top ONLY if so
 */
public void checkProgramFocus(){
  boolean top=rootWindow.thisOrChildrenFocused();
  rootWindow.setAlwaysOnTop(top);
  if (!top) {
    rootWindow.toBack();
  }
}

Fixed version (ground truth):
/** 
 * Checks whether PolyGlot has focus, and sets main menu to always on top ONLY if so
 */
public void checkProgramFocus(){
}
Program: 167186
Project: 167186
Buggy source:
/** 
 * Creates new form scrExcelImport
 * @param _core feed this the dictCore from the main program
 */
public ScrExcelImport(DictCore _core){
  setupKeyStrokes();
  initComponents();
  setModal(true);
  this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  core=_core;
}

Fixed version (ground truth):
/** 
 * Creates new form scrExcelImport
 * @param _core feed this the dictCore from the main program
 */
public ScrExcelImport(DictCore _core){
  core=_core;
  setupKeyStrokes();
  initComponents();
  setModal(true);
  this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
Program: 167187
Project: 167187
Buggy source:
/** 
 * Populates recently opened files menu
 */
private void populateRecentOpened(){
  mnuRecents.removeAll();
  for (  final String curFile : lastFiles) {
    Path p=Paths.get(curFile);
    String fileName=p.getFileName().toString();
    JMenuItem lastFile=new JMenuItem();
    lastFile.setText(fileName);
    lastFile.setToolTipText(curFile);
    lastFile.addActionListener(new java.awt.event.ActionListener(){
      @Override public void actionPerformed(      java.awt.event.ActionEvent evt){
        setFile(curFile);
      }
    }
);
    mnuRecents.add(lastFile);
  }
}

Fixed version (ground truth):
/** 
 * Populates recently opened files menu
 */
private void populateRecentOpened(){
  mnuRecents.removeAll();
  for (  final String curFile : lastFiles) {
    Path p=Paths.get(curFile);
    String fileName=p.getFileName().toString();
    JMenuItem lastFile=new JMenuItem();
    lastFile.setText(fileName);
    lastFile.setToolTipText(curFile);
    lastFile.addActionListener(new java.awt.event.ActionListener(){
      @Override public void actionPerformed(      java.awt.event.ActionEvent evt){
        if (!saveOrCancelTest()) {
          return;
        }
        setFile(curFile);
      }
    }
);
    mnuRecents.add(lastFile);
  }
}
Program: 167189
Project: 167189
Buggy source:
/** 
 * Saves current values to argument word. Default values will not be saved.
 * @param saveWord word to save current values to
 */
private void saveValuesTo(ConWord saveWord){
  if (txtConWord.getText().equals(defConValue)) {
    return;
  }
  saveWord.setValue(txtConWord.getText());
  saveWord.setDefinition(txtDefinition.getText().equals(defDefValue) ? "String_Node_Str" : txtDefinition.getText());
  GenderNode curGend=(GenderNode)cmbGender.getSelectedItem();
  saveWord.setGender(curGend.equals(defGenderValue) ? "String_Node_Str" : curGend.getValue());
  saveWord.setLocalWord(txtLocalWord.getText().equals(defLocalValue) ? "String_Node_Str" : txtLocalWord.getText());
  saveWord.setProcOverride(chkProcOverride.isSelected());
  saveWord.setPronunciation(txtProc.getText().equals(defProcValue) ? "String_Node_Str" : txtProc.getText());
  saveWord.setRulesOverride(chkRuleOverride.isSelected());
  TypeNode curType=(TypeNode)cmbType.getSelectedItem();
  saveWord.setWordType(curType.equals(defTypeValue) ? "String_Node_Str" : curType.getValue());
}

Fixed version (ground truth):
/** 
 * Saves current values to argument word. Default values will not be saved.
 * @param saveWord word to save current values to
 */
private void saveValuesTo(ConWord saveWord){
  if (txtConWord.getText().equals(defConValue)) {
    return;
  }
  saveWord.setValue(txtConWord.getText());
  saveWord.setDefinition(txtDefinition.getText().equals(defDefValue) ? "String_Node_Str" : txtDefinition.getText());
  GenderNode curGend=(GenderNode)cmbGender.getSelectedItem();
  if (curGend != null) {
    saveWord.setGender(curGend.equals(defGenderValue) ? "String_Node_Str" : curGend.getValue());
  }
  saveWord.setLocalWord(txtLocalWord.getText().equals(defLocalValue) ? "String_Node_Str" : txtLocalWord.getText());
  saveWord.setProcOverride(chkProcOverride.isSelected());
  saveWord.setPronunciation(txtProc.getText().equals(defProcValue) ? "String_Node_Str" : txtProc.getText());
  saveWord.setRulesOverride(chkRuleOverride.isSelected());
  TypeNode curType=(TypeNode)cmbType.getSelectedItem();
  if (curType != null) {
    saveWord.setWordType(curType.equals(defTypeValue) ? "String_Node_Str" : curType.getValue());
  }
}
Program: 167191
Project: 167191
Buggy source:
@Override public void repaint(){
  if (skipRepaint) {
    return;
  }
  try {
    if (parent != null) {
      core=parent.getCore();
    }
    if (core == null) {
      return;
    }
    PropertiesManager propMan=core.getPropertiesManager();
    skipRepaint=true;
    if (!curSetText) {
      if (propMan.isEnforceRTL()) {
        prefixRTL();
      }
 else {
        defixRTL();
      }
      Font testFont=propMan.getFontCon();
      if (!testFont.getFamily().equals(getFont().getFamily())) {
        setFont(testFont);
      }
    }
    skipRepaint=false;
  }
 catch (  Exception e) {
    InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),null);
    skipRepaint=false;
  }
  super.repaint();
}

Fixed version (ground truth):
@Override public void repaint(){
  if (skipRepaint) {
    return;
  }
  try {
    if (parent != null) {
      core=parent.getCore();
    }
    if (core == null) {
      return;
    }
    PropertiesManager propMan=core.getPropertiesManager();
    skipRepaint=true;
    if (!curSetText) {
      if (propMan.isEnforceRTL()) {
        prefixRTL();
      }
 else {
        defixRTL();
      }
      Font testFont=propMan.getFontCon();
      if (testFont != null && !testFont.getFamily().equals(getFont().getFamily())) {
        setFont(testFont);
      }
    }
    skipRepaint=false;
  }
 catch (  Exception e) {
    InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),null);
    skipRepaint=false;
  }
  super.repaint();
}
Program: 167192
Project: 167192
Buggy source:
/** 
 * Gets language's font
 * @return the fontCon
 */
public Font getFontCon(){
  return font == null ? new JTextField().getFont() : font.deriveFont(fontStyle,fontSize);
}

Fixed version (ground truth):
/** 
 * Gets language's font
 * @return the fontCon
 */
public Font getFontCon(){
  if (fontSize == 0) {
    fontSize=12;
  }
  return font == null ? new JTextField().getFont() : font.deriveFont(fontStyle,fontSize);
}
Program: 167193
Project: 167193
Buggy source:
/** 
 * Sets currently selected rule's regex equal to proper text box if not already equal
 */
private void setRuleRegex(){
  DeclensionGenRule rule=(DeclensionGenRule)lstRules.getSelectedValue();
  String ruleRegex=txtRuleRegex.getText().trim();
  if (!curPopulating && rule != null && !rule.getName().equals(ruleRegex)) {
    rule.setRegex(ruleRegex);
  }
}

Fixed version (ground truth):
/** 
 * Sets currently selected rule's regex equal to proper text box if not already equal
 */
private void setRuleRegex(){
  DeclensionGenRule rule=(DeclensionGenRule)lstRules.getSelectedValue();
  String ruleRegex=txtRuleRegex.getText().trim();
  if (!curPopulating && rule != null) {
    rule.setRegex(ruleRegex);
  }
}
Program: 167195
Project: 167195
Buggy source:
@Override public void pack(){
  setupKeyStrokes();
  super.pack();
  if (!skipCenter) {
    this.setLocationRelativeTo(null);
  }
}

Fixed version (ground truth):
@Override public void pack(){
  super.pack();
  if (!skipCenter) {
    this.setLocationRelativeTo(null);
  }
}
Program: 167196
Project: 167196
Buggy source:
@Override public void setVisible(boolean visible){
  setupKeyStrokes();
  if (!ignoreCenter) {
    this.setLocationRelativeTo(null);
  }
  super.setVisible(visible);
}

Fixed version (ground truth):
@Override public void setVisible(boolean visible){
  if (!ignoreCenter) {
    this.setLocationRelativeTo(null);
  }
  super.setVisible(visible);
}
Program: 167198
Project: 167198
Buggy source:
/** 
 * Creates new form scrSetupDeclGen
 * @param _core dictionary core
 * @param _typeId ID of type to pull rules for
 */
private ScrDeclensionGenSetup(DictCore _core,int _typeId){
  core=_core;
  typeId=_typeId;
  depRulesList=core.getDeclensionManager().getAllDepGenerationRules(_typeId);
  initComponents();
  setupObjectModels();
  setupListeners();
  setObjectProperties();
  populateCombinedDecl();
}

Fixed version (ground truth):
/** 
 * Creates new form scrSetupDeclGen
 * @param _core dictionary core
 * @param _typeId ID of type to pull rules for
 */
private ScrDeclensionGenSetup(DictCore _core,int _typeId){
  core=_core;
  typeId=_typeId;
  depRulesList=core.getDeclensionManager().getAllDepGenerationRules(_typeId);
  setupKeyStrokes();
  initComponents();
  setupObjectModels();
  setupListeners();
  setObjectProperties();
  populateCombinedDecl();
}
Program: 167199
Project: 167199
Buggy source:
/** 
 * Creates new form ScrDeclensionSetup
 * @param _core the dictionary core
 * @param _typeId ID of the type for which declensions are to be modified
 */
public ScrDeclensionSetup(DictCore _core,Integer _typeId){
  initComponents();
  try {
    core=_core;
    myType=_core.getTypes().getNodeById(_typeId);
    this.setTitle("String_Node_Str" + myType.getValue());
  }
 catch (  Exception e) {
    InfoBox.error("String_Node_Str","String_Node_Str" + _typeId + "String_Node_Str"+ e.getMessage(),this);
    this.dispose();
  }
  declListModel=new DefaultListModel();
  lstDeclensionList.setModel(declListModel);
  populateDeclensionList();
  setupListeners();
  setupDimTable();
}

Fixed version (ground truth):
/** 
 * Creates new form ScrDeclensionSetup
 * @param _core the dictionary core
 * @param _typeId ID of the type for which declensions are to be modified
 */
public ScrDeclensionSetup(DictCore _core,Integer _typeId){
  setupKeyStrokes();
  initComponents();
  try {
    core=_core;
    myType=_core.getTypes().getNodeById(_typeId);
    this.setTitle("String_Node_Str" + myType.getValue());
  }
 catch (  Exception e) {
    InfoBox.error("String_Node_Str","String_Node_Str" + _typeId + "String_Node_Str"+ e.getMessage(),this);
    this.dispose();
  }
  declListModel=new DefaultListModel();
  lstDeclensionList.setModel(declListModel);
  populateDeclensionList();
  setupListeners();
  setupDimTable();
}
Program: 167200
Project: 167200
Buggy source:
/** 
 * Creates new form scrDictInterface
 */
public ScrDictInterface(){
  if (System.getProperty("String_Node_Str").startsWith("String_Node_Str")) {
    InputMap im=(InputMap)UIManager.get("String_Node_Str");
    im.put(KeyStroke.getKeyStroke(KeyEvent.VK_C,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK),DefaultEditorKit.copyAction);
    im.put(KeyStroke.getKeyStroke(KeyEvent.VK_V,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK),DefaultEditorKit.pasteAction);
    im.put(KeyStroke.getKeyStroke(KeyEvent.VK_X,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK),DefaultEditorKit.cutAction);
    UIManager.put("String_Node_Str",im);
    im=(InputMap)UIManager.get("String_Node_Str");
    im.put(KeyStroke.getKeyStroke(KeyEvent.VK_C,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK),DefaultEditorKit.copyAction);
    im.put(KeyStroke.getKeyStroke(KeyEvent.VK_V,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK),DefaultEditorKit.pasteAction);
    im.put(KeyStroke.getKeyStroke(KeyEvent.VK_X,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK),DefaultEditorKit.cutAction);
    UIManager.put("String_Node_Str",im);
    im=(InputMap)UIManager.get("String_Node_Str");
    im.put(KeyStroke.getKeyStroke(KeyEvent.VK_C,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK),DefaultEditorKit.copyAction);
    im.put(KeyStroke.getKeyStroke(KeyEvent.VK_V,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK),DefaultEditorKit.pasteAction);
    im.put(KeyStroke.getKeyStroke(KeyEvent.VK_X,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK),DefaultEditorKit.cutAction);
    UIManager.put("String_Node_Str",im);
  }
  initComponents();
  dListModel=new DefaultListModel();
  lstDict.setModel(dListModel);
  tListModel=new DefaultListModel();
  lstTypesList.setModel(tListModel);
  gListModel=new DefaultListModel();
  lstGenderList.setModel(gListModel);
  newFile(true);
  setTitle(screenTitle + "String_Node_Str" + core.getVersion());
  setupListeners();
  setupProcTable();
  setupAccelerators();
  if (System.getProperty("String_Node_Str").startsWith("String_Node_Str")) {
    activateMacify();
  }
}

Fixed version (ground truth):
/** 
 * Creates new form scrDictInterface
 */
public ScrDictInterface(){
  this.setupKeyStrokes();
  initComponents();
  dListModel=new DefaultListModel();
  lstDict.setModel(dListModel);
  tListModel=new DefaultListModel();
  lstTypesList.setModel(tListModel);
  gListModel=new DefaultListModel();
  lstGenderList.setModel(gListModel);
  newFile(true);
  setTitle(screenTitle + "String_Node_Str" + core.getVersion());
  setupListeners();
  setupProcTable();
  setupAccelerators();
  if (System.getProperty("String_Node_Str").startsWith("String_Node_Str")) {
    activateMacify();
  }
}
Program: 167201
Project: 167201
Buggy source:
/** 
 * Creates new form scrExcelImport
 * @param _core feed this the dictCore from the main program
 */
public ScrExcelImport(DictCore _core){
  initComponents();
  this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  core=_core;
}

Fixed version (ground truth):
/** 
 * Creates new form scrExcelImport
 * @param _core feed this the dictCore from the main program
 */
public ScrExcelImport(DictCore _core){
  setupKeyStrokes();
  initComponents();
  this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  core=_core;
}
Program: 167202
Project: 167202
Buggy source:
/** 
 * Creates new form scrLangStats
 * @param _core DictCore to build report from
 */
public ScrLangStats(DictCore _core){
  initComponents();
  core=_core;
  jTextPane1.setContentType("String_Node_Str");
  jTextPane1.setText("String_Node_Str" + core.buildLanguageReport() + "String_Node_Str");
  jTextPane1.setCaretPosition(0);
  jScrollPane2.getVerticalScrollBar().setValue(0);
  jScrollPane2.getHorizontalScrollBar().setValue(0);
}

Fixed version (ground truth):
/** 
 * Creates new form scrLangStats
 * @param _core DictCore to build report from
 */
public ScrLangStats(DictCore _core){
  setupKeyStrokes();
  initComponents();
  core=_core;
  jTextPane1.setContentType("String_Node_Str");
  jTextPane1.setText("String_Node_Str" + core.buildLanguageReport() + "String_Node_Str");
  jTextPane1.setCaretPosition(0);
  jScrollPane2.getVerticalScrollBar().setValue(0);
  jScrollPane2.getHorizontalScrollBar().setValue(0);
}
Program: 167203
Project: 167203
Buggy source:
/** 
 * Opens logo window with particular logograph selected
 * @param _core
 * @param logoId
 */
public ScrLogoDetails(DictCore _core,int logoId){
  setNimbus();
  initComponents();
  core=_core;
  setupFonts();
  try {
    singleModeLogo=(LogoNode)core.getLogoCollection().getNodeById(logoId);
    List<LogoNode> list=new ArrayList();
    list.add(singleModeLogo);
    populateLogographs(list.iterator());
  }
 catch (  Exception e) {
    InfoBox.error("String_Node_Str","String_Node_Str" + e.getMessage(),this);
  }
  setSingleLogoMode(true);
  populateLogoProps();
  setupListeners();
  setTitle("String_Node_Str");
  mode=WindowMode.SINGLEVALUE;
}

Fixed version (ground truth):
/** 
 * Opens logo window with particular logograph selected
 * @param _core
 * @param logoId
 */
public ScrLogoDetails(DictCore _core,int logoId){
  setNimbus();
  setupKeyStrokes();
  initComponents();
  core=_core;
  setupFonts();
  try {
    singleModeLogo=(LogoNode)core.getLogoCollection().getNodeById(logoId);
    List<LogoNode> list=new ArrayList();
    list.add(singleModeLogo);
    populateLogographs(list.iterator());
  }
 catch (  Exception e) {
    InfoBox.error("String_Node_Str","String_Node_Str" + e.getMessage(),this);
  }
  setSingleLogoMode(true);
  populateLogoProps();
  setupListeners();
  setTitle("String_Node_Str");
  mode=WindowMode.SINGLEVALUE;
}
Program: 167204
Project: 167204
Buggy source:
/** 
 * opens window to show all logographs, or all radicals
 * @param _core dictionary core
 * @param showRadicalsOnly set true to limit to only radicals
 */
public ScrLogoQuickView(DictCore _core,boolean showRadicalsOnly){
  initComponents();
  core=_core;
  setupFonts();
  setupResize();
  btnAdd.setVisible(!showRadicalsOnly);
  btnDel.setVisible(!showRadicalsOnly);
  btnDetails.setVisible(!showRadicalsOnly);
  if (showRadicalsOnly) {
    populateLogos(core.getLogoCollection().getRadicals());
    this.setTitle("String_Node_Str");
  }
 else {
    populateLogos(core.getLogoCollection().getAllLogos());
  }
  mode=WindowMode.SELECTLIST;
}

Fixed version (ground truth):
/** 
 * opens window to show all logographs, or all radicals
 * @param _core dictionary core
 * @param showRadicalsOnly set true to limit to only radicals
 */
public ScrLogoQuickView(DictCore _core,boolean showRadicalsOnly){
  setupKeyStrokes();
  initComponents();
  core=_core;
  setupFonts();
  setupResize();
  btnAdd.setVisible(!showRadicalsOnly);
  btnDel.setVisible(!showRadicalsOnly);
  btnDetails.setVisible(!showRadicalsOnly);
  if (showRadicalsOnly) {
    populateLogos(core.getLogoCollection().getRadicals());
    this.setTitle("String_Node_Str");
  }
 else {
    populateLogos(core.getLogoCollection().getAllLogos());
  }
  mode=WindowMode.SELECTLIST;
}
Program: 167205
Project: 167205
Buggy source:
@Override public void run(){
  new ScrLogoQuickView(new DictCore(),false).setVisible(true);
}

Fixed version (ground truth):
@Override public void run(){
  logoFinder.setVisible(true);
}
Program: 167206
Project: 167206
Buggy source:
/** 
 * Creates new form scrQuickWordEntry
 * @param _core Dictionary core
 */
public ScrQuickWordEntry(DictCore _core){
  core=_core;
  initComponents();
  enterListener=new KeyListener(){
    @Override public void keyPressed(    KeyEvent e){
      if (e.getKeyCode() == KeyEvent.VK_ENTER && (!cmbGender.isPopupVisible()) && !cmbType.isPopupVisible()) {
        tryRecord();
      }
    }
    @Override public void keyReleased(    KeyEvent e){
    }
    @Override public void keyTyped(    KeyEvent e){
    }
  }
;
  txtConWord.setFont(core.getPropertiesManager().getFontCon());
  txtConWord.addKeyListener(enterListener);
  txtDefinition.addKeyListener(enterListener);
  txtLocalWord.addKeyListener(enterListener);
  txtProc.addKeyListener(enterListener);
  cmbGender.addKeyListener(enterListener);
  cmbType.addKeyListener(enterListener);
  txtConWord.setBackground(core.getRequiredColor());
  txtConWord.requestFocus();
  if (core.getPropertiesManager().isLocalMandatory()) {
    txtLocalWord.setBackground(core.getRequiredColor());
    chkLocal.setEnabled(false);
  }
  if (core.getPropertiesManager().isTypesMandatory()) {
    cmbType.setForeground(core.getRequiredColor());
    chkType.setEnabled(false);
  }
  populateTypes();
  populateGenders();
}

Fixed version (ground truth):
/** 
 * Creates new form scrQuickWordEntry
 * @param _core Dictionary core
 */
public ScrQuickWordEntry(DictCore _core){
  core=_core;
  setupKeyStrokes();
  initComponents();
  enterListener=new KeyListener(){
    @Override public void keyPressed(    KeyEvent e){
      if (e.getKeyCode() == KeyEvent.VK_ENTER && (!cmbGender.isPopupVisible()) && !cmbType.isPopupVisible()) {
        tryRecord();
      }
    }
    @Override public void keyReleased(    KeyEvent e){
    }
    @Override public void keyTyped(    KeyEvent e){
    }
  }
;
  txtConWord.setFont(core.getPropertiesManager().getFontCon());
  txtConWord.addKeyListener(enterListener);
  txtDefinition.addKeyListener(enterListener);
  txtLocalWord.addKeyListener(enterListener);
  txtProc.addKeyListener(enterListener);
  cmbGender.addKeyListener(enterListener);
  cmbType.addKeyListener(enterListener);
  txtConWord.setBackground(core.getRequiredColor());
  txtConWord.requestFocus();
  if (core.getPropertiesManager().isLocalMandatory()) {
    txtLocalWord.setBackground(core.getRequiredColor());
    chkLocal.setEnabled(false);
  }
  if (core.getPropertiesManager().isTypesMandatory()) {
    cmbType.setForeground(core.getRequiredColor());
    chkType.setEnabled(false);
  }
  populateTypes();
  populateGenders();
}
Program: 167207
Project: 167207
Buggy source:
/** 
 * Creates new form ScrThesaurus
 * @param _core dictionary core
 * @param _parent parent window
 */
public ScrThesaurus(DictCore _core,ScrDictInterface _parent){
  core=_core;
  parent=_parent;
  initComponents();
  ThesTreeNode root=new ThesTreeNode();
  root.setAsRootNode(core.getThesManager().getRoot());
  TreeModel newModel=new DefaultTreeModel(root);
  treThes.setModel(newModel);
  lstWords.setModel(new DefaultListModel());
  setupListeners();
  lstWords.setFont(core.getPropertiesManager().getFontCon());
}

Fixed version (ground truth):
/** 
 * Creates new form ScrThesaurus
 * @param _core dictionary core
 * @param _parent parent window
 */
public ScrThesaurus(DictCore _core,ScrDictInterface _parent){
  core=_core;
  parent=_parent;
  setupKeyStrokes();
  initComponents();
  ThesTreeNode root=new ThesTreeNode();
  root.setAsRootNode(core.getThesManager().getRoot());
  TreeModel newModel=new DefaultTreeModel(root);
  treThes.setModel(newModel);
  lstWords.setModel(new DefaultListModel());
  setupListeners();
  lstWords.setFont(core.getPropertiesManager().getFontCon());
}
Program: 167208
Project: 167208
Buggy source:
/** 
 * Creates new form ScrTranslationFreewrite
 * @param _core Dictionary Core
 * @param initialText initial text for translation
 */
public ScrTranslationFreewrite(DictCore _core,String initialText){
  initComponents();
  core=_core;
  jTextArea1.setFont(core.getPropertiesManager().getFontCon());
  jTextArea1.setText(initialText);
}

Fixed version (ground truth):
/** 
 * Creates new form ScrTranslationFreewrite
 * @param _core Dictionary Core
 * @param initialText initial text for translation
 */
public ScrTranslationFreewrite(DictCore _core,String initialText){
  setupKeyStrokes();
  initComponents();
  core=_core;
  jTextArea1.setFont(core.getPropertiesManager().getFontCon());
  jTextArea1.setText(initialText);
}
Program: 167209
Project: 167209
Buggy source:
/** 
 * Creates new form ScrTranslationWindow
 * @param _core Set dictionary core
 * @param _parent Set parent value for callbacks
 */
public ScrTranslationWindow(DictCore _core,ScrDictInterface _parent){
  core=_core;
  parent=_parent;
  initComponents();
  txtLocalText.setCaret(new HighlightCaret());
  setObjectFonts();
  matchListModel=new DefaultListModel();
  lstMatchList.setModel(matchListModel);
  setupListeners();
  setCurTranslating(false);
}

Fixed version (ground truth):
/** 
 * Creates new form ScrTranslationWindow
 * @param _core Set dictionary core
 * @param _parent Set parent value for callbacks
 */
public ScrTranslationWindow(DictCore _core,ScrDictInterface _parent){
  core=_core;
  parent=_parent;
  setupKeyStrokes();
  initComponents();
  txtLocalText.setCaret(new HighlightCaret());
  setObjectFonts();
  matchListModel=new DefaultListModel();
  lstMatchList.setModel(matchListModel);
  setupListeners();
  setCurTranslating(false);
}
Program: 167211
Project: 167211
Buggy source:
private void viewDeclensions(){
  Integer wordId=(Integer)scrToCoreMap.get(lstDict.getSelectedIndex());
  if (wordId == -1) {
    return;
  }
  try {
    ScrDeclensions.run(core,core.getWordById(wordId),(Integer)scrToCoreTypes.get(cmbTypeProp.getSelectedIndex()),core.getLangFont());
  }
 catch (  Exception ex) {
    InfoBox.error("String_Node_Str","String_Node_Str" + ex.getLocalizedMessage(),this);
  }
  saveModWord();
}

Fixed version (ground truth):
private void viewDeclensions(){
  Integer wordId=(Integer)scrToCoreMap.get(lstDict.getSelectedIndex());
  if (wordId == -1) {
    return;
  }
  try {
    ScrDeclensions.run(core,core.getWordById(wordId),(Integer)scrToCoreTypes.get(cmbTypeProp.getSelectedIndex()),core.getLangFont());
  }
 catch (  Exception ex) {
    InfoBox.error("String_Node_Str",ex.getLocalizedMessage(),this);
  }
  saveModWord();
}
Program: 167212
Project: 167212
Buggy source:
private void newFile(){
  if (!saveOrCancelTest()) {
    return;
  }
  core=new DictCore();
  curFileName="String_Node_Str";
  killAllChildren();
  populateDict();
  popWordProps();
  populateTypes();
  populateTypeProps();
  populateGenders();
  populateGenderProps();
  populateProcGuide();
  popLangProps();
}

Fixed version (ground truth):
private void newFile(){
  if (!saveOrCancelTest()) {
    return;
  }
  core=new DictCore();
  curFileName="String_Node_Str";
  killAllChildren();
  populateDict();
  popWordProps();
  populateTypes();
  populateTypeProps();
  populateGenders();
  populateGenderProps();
  populateProcGuide();
  popLangProps();
  setConFont(new JTextField().getFont());
}
Program: 167213
Project: 167213
Buggy source:
/** 
 * deletes currently selected node
 */
private void removeThesNode(){
  ThesTreeNode curNode=(ThesTreeNode)treThes.getLastSelectedPathComponent();
  if (curNode == null) {
    return;
  }
  ThesTreeNode parent=(ThesTreeNode)curNode.getParent();
  if (!curNode.isRoot()) {
    ((DefaultTreeModel)treThes.getModel()).removeNodeFromParent(curNode);
    curNode.removeFromParent();
  }
}

Fixed version (ground truth):
/** 
 * deletes currently selected node
 */
private void removeThesNode(){
  ThesTreeNode curNode=(ThesTreeNode)treThes.getLastSelectedPathComponent();
  int position=treThes.getLeadSelectionRow();
  if (position < 1 || curNode == null) {
    return;
  }
  if (!curNode.isRoot()) {
    ((DefaultTreeModel)treThes.getModel()).removeNodeFromParent(curNode);
    curNode.removeFromParent();
  }
  treThes.setSelectionRow(position - 1);
}
Program: 167214
Project: 167214
Buggy source:
public TableColumnEditor(Font _myFont){
  myFont=_myFont;
}

Fixed version (ground truth):
public TableColumnEditor(Font _myFont){
  myFont=_myFont;
  JTextField setupText=(JTextField)component;
  setupText.setBorder(BorderFactory.createEmptyBorder());
}
Program: 167215
Project: 167215
Buggy source:
/** 
 * updates words list for family
 */
private void updateWordsProp(){
  ThesTreeNode curNode=(ThesTreeNode)treThes.getLastSelectedPathComponent();
  DefaultListModel model=(DefaultListModel)lstWords.getModel();
  model.clear();
  Iterator<ConWord> wordIt;
  if (chkInclSubFam.isSelected()) {
    wordIt=curNode.getNode().getWordsIncludeSubs().iterator();
  }
 else {
    wordIt=curNode.getNode().getWords();
  }
  for (int i=0; wordIt.hasNext(); i++) {
    model.add(i,wordIt.next());
  }
}

Fixed version (ground truth):
/** 
 * updates words list for family
 */
private void updateWordsProp(){
  ThesTreeNode curNode=(ThesTreeNode)treThes.getLastSelectedPathComponent();
  DefaultListModel model=(DefaultListModel)lstWords.getModel();
  model.clear();
  if (curNode == null) {
    return;
  }
  Iterator<ConWord> wordIt;
  if (chkInclSubFam.isSelected()) {
    wordIt=curNode.getNode().getWordsIncludeSubs().iterator();
  }
 else {
    wordIt=curNode.getNode().getWords();
  }
  for (int i=0; wordIt.hasNext(); i++) {
    model.add(i,wordIt.next());
  }
}
Program: 167216
Project: 167216
Buggy source:
/** 
 * gets all words in immediate family
 * @return iterator of all words in immediate family
 */
public Iterator<ConWord> getWords(){
  Collections.sort(words);
  return words.iterator();
}

Fixed version (ground truth):
/** 
 * gets all words in immediate family
 * @return iterator of all words in immediate family
 */
public Iterator<ConWord> getWords(){
  manager.removeDeadWords(this,words);
  Collections.sort(words);
  return words.iterator();
}
Program: 167217
Project: 167217
Buggy source:
/** 
 * internally facing, recursive method for getting all words in this and subfamilies
 * @return list of (non duped) words in this and all subnodes
 */
private List<ConWord> getWordsIncludeSubsInternal(){
  List<ConWord> ret=new ArrayList(words);
  Iterator<ThesNode> subIt=subNodes.iterator();
  while (subIt.hasNext()) {
    ThesNode curNode=subIt.next();
    Iterator<ConWord> wordIt=curNode.getWordsIncludeSubsInternal().iterator();
    while (wordIt.hasNext()) {
      ConWord curWord=wordIt.next();
      if (!ret.contains(curWord)) {
        ret.add(curWord);
      }
    }
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * internally facing, recursive method for getting all words in this and subfamilies
 * @return list of (non duped) words in this and all subnodes
 */
private List<ConWord> getWordsIncludeSubsInternal(){
  manager.removeDeadWords(this,words);
  List<ConWord> ret=new ArrayList(words);
  Iterator<ThesNode> subIt=subNodes.iterator();
  while (subIt.hasNext()) {
    ThesNode curNode=subIt.next();
    Iterator<ConWord> wordIt=curNode.getWordsIncludeSubsInternal().iterator();
    while (wordIt.hasNext()) {
      ConWord curWord=wordIt.next();
      if (!ret.contains(curWord)) {
        ret.add(curWord);
      }
    }
  }
  return ret;
}
Program: 167218
Project: 167218
Buggy source:
/** 
 * sets parent and value of node
 * @param _parent parent of note (null if root)
 * @param _value node's string value
 */
public ThesNode(ThesNode _parent,String _value){
  parent=_parent;
  this.setValue(_value);
}

Fixed version (ground truth):
/** 
 * sets parent and value of node
 * @param _parent parent of note (null if root)
 * @param _value node's string value
 */
public ThesNode(ThesNode _parent,String _value,ThesaurusManager _manager){
  parent=_parent;
  this.setValue(_value);
  manager=_manager;
}
Program: 167219
Project: 167219
Buggy source:
/** 
 * Used when loading from save file and building thesaurus. Either creates new root or adds child/sets buffer to that.
 */
public void buildNewBuffer(){
  if (thesRoot == null) {
    thesRoot=new ThesNode(null);
    buffer=thesRoot;
  }
 else {
    ThesNode newBuffer=new ThesNode(buffer);
    buffer.addNode(newBuffer);
    buffer=newBuffer;
  }
}

Fixed version (ground truth):
/** 
 * Used when loading from save file and building thesaurus. Either creates new root or adds child/sets buffer to that.
 */
public void buildNewBuffer(){
  if (thesRoot == null) {
    thesRoot=new ThesNode(null,this);
    buffer=thesRoot;
  }
 else {
    ThesNode newBuffer=new ThesNode(buffer,this);
    buffer.addNode(newBuffer);
    buffer=newBuffer;
  }
}
Program: 167220
Project: 167220
Buggy source:
/** 
 * Gets root thesaurus node
 * @return 
 */
public ThesNode getRoot(){
  if (thesRoot == null) {
    thesRoot=new ThesNode(null,"String_Node_Str");
  }
  return thesRoot;
}

Fixed version (ground truth):
/** 
 * Gets root thesaurus node
 * @return 
 */
public ThesNode getRoot(){
  if (thesRoot == null) {
    thesRoot=new ThesNode(null,"String_Node_Str",this);
  }
  return thesRoot;
}
Program: 167221
Project: 167221
Buggy source:
/** 
 * sets menu accelerators and menu item text to reflect this
 */
private void setupAccelerators(){
  String OS=System.getProperty("String_Node_Str");
  if (OS.startsWith("String_Node_Str")) {
    mnuSave.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK));
    mnuNew.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK));
    mnuExit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK));
    mnuOpen.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK));
  }
 else {
    mnuSave.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.CTRL_DOWN_MASK));
    mnuNew.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.CTRL_DOWN_MASK));
    mnuExit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.CTRL_DOWN_MASK));
    mnuOpen.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.CTRL_DOWN_MASK));
  }
}

Fixed version (ground truth):
/** 
 * sets menu accelerators and menu item text to reflect this
 */
private void setupAccelerators(){
  String OS=System.getProperty("String_Node_Str");
  if (OS.startsWith("String_Node_Str")) {
    mnuSave.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK));
    mnuNew.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK));
    mnuExit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK));
    mnuOpen.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.META_DOWN_MASK));
  }
 else {
    mnuSave.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.CTRL_DOWN_MASK));
    mnuNew.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.CTRL_DOWN_MASK));
    mnuExit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.CTRL_DOWN_MASK));
    mnuOpen.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O,Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.CTRL_DOWN_MASK));
  }
}
Program: 167222
Project: 167222
Buggy source:
private void saveProcGuide(){
  if (curPopulating) {
    return;
  }
  boolean localPopulating=curPopulating;
  curPopulating=true;
  List<PronunciationNode> newPro=new ArrayList<PronunciationNode>();
  for (int i=0; i < tblProcGuide.getRowCount(); i++) {
    PronunciationNode newNode=new PronunciationNode();
    newNode.setValue((String)tblProcGuide.getCellEditor(i,0).getCellEditorValue());
    newNode.setPronunciation((String)tblProcGuide.getCellEditor(i,1).getCellEditorValue());
    newPro.add(newNode);
  }
  core.setPronunciations(newPro);
  curPopulating=localPopulating;
}

Fixed version (ground truth):
private void saveProcGuide(){
  if (curPopulating) {
    return;
  }
  boolean localPopulating=curPopulating;
  curPopulating=true;
  List<PronunciationNode> newPro=new ArrayList<PronunciationNode>();
  for (int i=0; i < tblProcGuide.getRowCount(); i++) {
    PronunciationNode newNode=new PronunciationNode();
    if (i == tblProcGuide.getSelectedRow()) {
      newNode.setValue((String)tblProcGuide.getCellEditor(i,0).getCellEditorValue());
      newNode.setPronunciation((String)tblProcGuide.getCellEditor(i,1).getCellEditorValue());
    }
 else {
      newNode.setValue((String)tblProcGuide.getModel().getValueAt(i,0));
      newNode.setPronunciation((String)tblProcGuide.getModel().getValueAt(i,1));
    }
    newPro.add(newNode);
  }
  core.setPronunciations(newPro);
  curPopulating=localPopulating;
}
Program: 167224
Project: 167224
Buggy source:
/** 
 * clears all filters set on lexicon
 */
private void clearLexFilter(){
  txtConWordFilter.setText("String_Node_Str");
  txtLocalWordFilter.setText("String_Node_Str");
  txtPronunciationFilter.setText("String_Node_Str");
  txtDefFilter.setText("String_Node_Str");
  cmbGenderFilter.setSelectedIndex(cmbGenderFilter.getModel().getSize() - 1);
  cmbTypeFilter.setSelectedIndex(cmbTypeFilter.getModel().getSize() - 1);
  filterDict();
}

Fixed version (ground truth):
/** 
 * clears all filters set on lexicon
 */
private void clearLexFilter(){
  clearLexFilterValues();
  filterDict();
}
Program: 167225
Project: 167225
Buggy source:
private void cmbTypeFilterActionPerformed(java.awt.event.ActionEvent evt){
  filterDict();
}

Fixed version (ground truth):
private void cmbTypeFilterActionPerformed(java.awt.event.ActionEvent evt){
  if (filterListenersActive)   filterDict();
}
Program: 167227
Project: 167227
Buggy source:
private void cmbGenderFilterActionPerformed(java.awt.event.ActionEvent evt){
  filterDict();
}

Fixed version (ground truth):
private void cmbGenderFilterActionPerformed(java.awt.event.ActionEvent evt){
  if (filterListenersActive)   filterDict();
}
Program: 167229
Project: 167229
Buggy source:
/** 
 * this is the recursive function that completes the work of its overridden method
 * @param doc the document this is to be inserted into
 * @param curNode node to build element for
 * @return an element containing all thesaurus data
 */
private Element writeToSaveXML(Document doc,ThesNode curNode){
  Element curElement=doc.createElement(XMLIDs.thesNodeXID);
  Element property=doc.createElement(XMLIDs.thesNameXID);
  property.appendChild(doc.createTextNode(curNode.getValue()));
  curElement.appendChild(property);
  property=doc.createElement(XMLIDs.thesNotesXID);
  property.appendChild(doc.createTextNode(curNode.getNotes()));
  curElement.appendChild(property);
  Iterator<ConWord> wordIt=curNode.getWords();
  while (wordIt.hasNext()) {
    ConWord curWord=wordIt.next();
    property=doc.createElement(XMLIDs.thesWordXID);
    property.appendChild(doc.createTextNode(curWord.getId().toString()));
    curElement.appendChild(property);
  }
  Iterator<ThesNode> thesIt=curNode.getNodes();
  while (thesIt.hasNext()) {
    ThesNode curChild=thesIt.next();
    curElement.appendChild(writeToSaveXML(doc,curChild));
  }
  return curElement;
}

Fixed version (ground truth):
/** 
 * this is the recursive function that completes the work of its overridden method
 * @param doc the document this is to be inserted into
 * @param curNode node to build element for
 * @return an element containing all thesaurus data
 */
private Element writeToSaveXML(Document doc,ThesNode curNode){
  Element curElement=doc.createElement(XMLIDs.thesNodeXID);
  if (curNode == null) {
    return curElement;
  }
  Element property=doc.createElement(XMLIDs.thesNameXID);
  property.appendChild(doc.createTextNode(curNode.getValue()));
  curElement.appendChild(property);
  property=doc.createElement(XMLIDs.thesNotesXID);
  property.appendChild(doc.createTextNode(curNode.getNotes()));
  curElement.appendChild(property);
  Iterator<ConWord> wordIt=curNode.getWords();
  while (wordIt.hasNext()) {
    ConWord curWord=wordIt.next();
    property=doc.createElement(XMLIDs.thesWordXID);
    property.appendChild(doc.createTextNode(curWord.getId().toString()));
    curElement.appendChild(property);
  }
  Iterator<ThesNode> thesIt=curNode.getNodes();
  while (thesIt.hasNext()) {
    ThesNode curChild=thesIt.next();
    curElement.appendChild(writeToSaveXML(doc,curChild));
  }
  return curElement;
}
Program: 167231
Project: 167231
Buggy source:
private void checkGenderLexEnabled(){
  if (core.getGenders().findGenderByName(txtGenderName.getText().trim()) != null) {
    setEnabledGenderLexicon(false);
    txtGendersErrorBox.setText("String_Node_Str");
  }
 else   if (txtGenderName.getText().trim().equals("String_Node_Str")) {
    setEnabledGenderLexicon(false);
    txtGendersErrorBox.setText("String_Node_Str");
  }
 else {
    setEnabledGenderLexicon(true);
    txtGendersErrorBox.setText("String_Node_Str");
  }
}

Fixed version (ground truth):
private void checkGenderLexEnabled(){
  GenderNode genNode=core.getGenders().findGenderByName(txtGenderName.getText().trim());
  if (genNode != null) {
    setEnabledGenderLexicon(false);
    txtGendersErrorBox.setText("String_Node_Str");
  }
 else   if (txtGenderName.getText().trim().equals("String_Node_Str")) {
    setEnabledGenderLexicon(false);
    txtGendersErrorBox.setText("String_Node_Str");
  }
 else {
    setEnabledGenderLexicon(true);
    txtGendersErrorBox.setText("String_Node_Str");
  }
}
Program: 167232
Project: 167232
Buggy source:
/** 
 * sets basic properties of form based on contents
 */
private void setFormProps(){
  textHeight=firstField.getHeight();
  pnlDeclensions.setSize(pnlDeclensions.getSize().width,numFields * textHeight);
  pnlDeclensions.setLayout(new GridLayout(0,2));
  this.setSize(this.getWidth() + 10,pnlDeclensions.getHeight() + 70);
  this.setResizable(false);
}

Fixed version (ground truth):
/** 
 * sets basic properties of form based on contents
 */
private void setFormProps(){
  textHeight=firstField.getHeight();
  pnlDeclensions.setSize(pnlDeclensions.getSize().width,numFields * textHeight);
  pnlDeclensions.setLayout(new GridLayout(0,2));
  this.setSize(this.getWidth() + 10,pnlDeclensions.getHeight() + 70);
}
Program: 167233
Project: 167233
Buggy source:
public static void strFormat(String path,String fileName,List<Event> events){
  long t1=System.currentTimeMillis();
  for (  Event event : events) {
    Calendar calendar=null;
    calendar=Calendar.getInstance();
    StringBuilder sb=new StringBuilder();
    sb.append(calendar.get(Calendar.YEAR)).append(calendar.get(Calendar.MONTH) + 1).append(calendar.get(Calendar.DAY_OF_MONTH));
    String dt=sb.toString();
    String hour=String.valueOf(calendar.get(Calendar.HOUR_OF_DAY));
    String realPath="String_Node_Str" + event.getHeaders().get("String_Node_Str") + "String_Node_Str"+ dt+ "String_Node_Str"+ hour;
    String realName=fileName;
  }
  System.out.println("String_Node_Str" + (System.currentTimeMillis() - t1));
}

Fixed version (ground truth):
public static void strFormat(String path,String fileName,List<Event> events){
  long t1=System.currentTimeMillis();
  boolean flag=true;
  for (  Event event : events) {
    Calendar calendar=null;
    calendar=Calendar.getInstance();
    StringBuilder sb=new StringBuilder();
    sb.append(calendar.get(Calendar.YEAR)).append(zeroFill(calendar.get(Calendar.MONTH) + 1)).append(zeroFill(calendar.get(Calendar.DAY_OF_MONTH)));
    String dt=sb.toString();
    String hour=zeroFill(calendar.get(Calendar.HOUR_OF_DAY));
    String realPath="String_Node_Str" + event.getHeaders().get("String_Node_Str") + "String_Node_Str"+ dt+ "String_Node_Str"+ hour;
    String realName=fileName;
    if (flag) {
      System.out.println(realPath + "String_Node_Str" + realName);
      flag=false;
    }
  }
  System.out.println("String_Node_Str" + (System.currentTimeMillis() - t1));
}
Program: 167234
Project: 167234
Buggy source:
public static void regFormat(String path,String fileName,List<Event> events){
  long t1=System.currentTimeMillis();
  for (  Event event : events) {
    String realPath=BucketPath.escapeString(path,event.getHeaders(),null,false,Calendar.SECOND,1,true);
    String realName=BucketPath.escapeString(fileName,event.getHeaders(),null,false,Calendar.SECOND,1,true);
  }
  System.out.println("String_Node_Str" + (System.currentTimeMillis() - t1));
}

Fixed version (ground truth):
public static void regFormat(String path,String fileName,List<Event> events){
  long t1=System.currentTimeMillis();
  boolean flag=true;
  for (  Event event : events) {
    String realPath=BucketPath.escapeString(path,event.getHeaders(),null,false,Calendar.SECOND,1,true);
    String realName=BucketPath.escapeString(fileName,event.getHeaders(),null,false,Calendar.SECOND,1,true);
    if (flag) {
      System.out.println(realPath + "String_Node_Str" + realName);
      flag=false;
    }
  }
  System.out.println("String_Node_Str" + (System.currentTimeMillis() - t1));
}
Program: 167236
Project: 167236
Buggy source:
/** 
 * flush the data
 * @throws IOException
 * @throws InterruptedException
 */
public synchronized void flush() throws IOException, InterruptedException {
  checkAndThrowInterruptedException();
  if (!isBatchComplete()) {
    doFlush();
    if (idleTimeout > 0) {
      if (idleFuture == null || idleFuture.cancel(false)) {
        Callable<Void> idleAction=new Callable<Void>(){
          public Void call() throws Exception {
            try {
              if (isOpen) {
                LOG.info("String_Node_Str",bucketPath);
                idleClosed=true;
                graceClose();
              }
              if (onIdleCallback != null)               onIdleCallback.run(onIdleCallbackPath);
            }
 catch (            Throwable t) {
              LOG.error("String_Node_Str",t);
            }
            return null;
          }
        }
;
        idleFuture=timedRollerPool.schedule(idleAction,idleTimeout,TimeUnit.SECONDS);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * flush the data
 * @throws IOException
 * @throws InterruptedException
 */
public synchronized void flush() throws IOException, InterruptedException {
  checkAndThrowInterruptedException();
  if (!isBatchComplete()) {
    doFlush();
    if (idleTimeout > 0) {
      if (idleFuture == null || idleFuture.cancel(false)) {
        Callable<Void> idleAction=new Callable<Void>(){
          public Void call() throws Exception {
            try {
              if (isOpen) {
                LOG.info("String_Node_Str",bucketPath);
                graceClose();
                idleClosed=true;
              }
              if (onIdleCallback != null)               LOG.info("String_Node_Str",onIdleCallbackPath);
              onIdleCallback.run(onIdleCallbackPath);
            }
 catch (            Throwable t) {
              LOG.error("String_Node_Str",t);
            }
            return null;
          }
        }
;
        idleFuture=timedRollerPool.schedule(idleAction,idleTimeout,TimeUnit.SECONDS);
      }
    }
  }
}