nus-yam/ex-repair huggingface dataset:
Program: 167139
Project: 167139
Buggy source:
/** 
 * Generates the webapp according to the <tt>mode</tt> attribute.
 * @param pAmpFile the target AMP file
 * @throws IOException
 * @throws ArchiverException
 * @throws ManifestException
 * @throws DependencyResolutionRequiredException
 */
protected void performPackaging(File pAmpFile) throws IOException, ArchiverException, ManifestException, DependencyResolutionRequiredException, MojoExecutionException, MojoFailureException {
  getLog().info("String_Node_Str" + this.getAmpName() + "String_Node_Str");
  this.buildExplodedAmp(this.getAmpDirectory());
  MavenArchiver vArchiver=new MavenArchiver();
  vArchiver.setArchiver(this.getAmpArchiver());
  vArchiver.setOutputFile(pAmpFile);
  this.getAmpArchiver().addDirectory(this.getAmpDirectory(),this.getIncludes(),this.getExcludes());
  vArchiver.createArchive(this.getProject(),archive);
  String vClassifier=this.getClassifier();
  if (vClassifier != null) {
    this.getProjectHelper().attachArtifact(this.getProject(),"String_Node_Str",vClassifier,pAmpFile);
  }
 else {
    Artifact vArtifact=this.getProject().getArtifact();
    if (this.isPrimaryArtifact()) {
      vArtifact.setFile(pAmpFile);
    }
 else     if (vArtifact.getFile() == null || vArtifact.getFile().isDirectory()) {
      vArtifact.setFile(pAmpFile);
    }
  }
}

Fixed version (ground truth):
/** 
 * Generates the webapp according to the <tt>mode</tt> attribute.
 * @param pAmpFile the target AMP file
 * @throws IOException
 * @throws ArchiverException
 * @throws ManifestException
 * @throws DependencyResolutionRequiredException
 */
protected void performPackaging(File pAmpFile) throws IOException, ArchiverException, ManifestException, DependencyResolutionRequiredException, MojoExecutionException, MojoFailureException {
  getLog().info("String_Node_Str" + this.getAmpName() + "String_Node_Str");
  this.buildExplodedAmp(this.getAmpDirectory());
  MavenArchiver vArchiver=new MavenArchiver();
  vArchiver.setArchiver(this.getAmpArchiver());
  vArchiver.setOutputFile(pAmpFile);
  this.getAmpArchiver().addDirectory(this.getAmpDirectory(),null,null);
  vArchiver.createArchive(this.getProject(),archive);
  String vClassifier=this.getClassifier();
  if (vClassifier != null) {
    this.getProjectHelper().attachArtifact(this.getProject(),"String_Node_Str",vClassifier,pAmpFile);
  }
 else {
    Artifact vArtifact=this.getProject().getArtifact();
    if (this.isPrimaryArtifact()) {
      vArtifact.setFile(pAmpFile);
    }
 else     if (vArtifact.getFile() == null || vArtifact.getFile().isDirectory()) {
      vArtifact.setFile(pAmpFile);
    }
  }
}
Program: 167140
Project: 167140
Buggy source:
/** 
 * Handles the webapp sources.
 * @param context the packaging context
 * @throws MojoExecutionException if the sources could not be copied
 */
protected void handeAmpConfigDirectory(AmpPackagingContext context) throws MojoExecutionException {
  if (!context.getAmpConfigDirectory().exists()) {
    context.getLog().debug("String_Node_Str");
  }
 else {
    if (!context.getAmpConfigDirectory().getAbsolutePath().equals(context.getAmpDirectory().getPath())) {
      final PathSet sources=getFilesToIncludes(context.getAmpConfigDirectory(),new String[0],new String[]{"String_Node_Str"});
      try {
        context.getLog().info("String_Node_Str" + CONFIG_PATH);
        copyFiles(id,context,context.getAmpConfigDirectory(),sources,CONFIG_PATH);
      }
 catch (      IOException e) {
        throw new MojoExecutionException("String_Node_Str" + context.getAmpDirectory().getAbsolutePath() + "String_Node_Str",e);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Handles the webapp sources.
 * @param context the packaging context
 * @throws MojoExecutionException if the sources could not be copied
 */
protected void handeAmpConfigDirectory(AmpPackagingContext context) throws MojoExecutionException {
  if (!context.getAmpConfigDirectory().exists()) {
    context.getLog().debug("String_Node_Str");
  }
 else {
    if (!context.getAmpConfigDirectory().getAbsolutePath().equals(context.getAmpDirectory().getPath())) {
      final PathSet sources=getFilesToIncludes(context.getAmpConfigDirectory(),new String[0],new String[]{"String_Node_Str","String_Node_Str"});
      try {
        context.getLog().info("String_Node_Str" + CONFIG_PATH);
        copyFiles(id,context,context.getAmpConfigDirectory(),sources,CONFIG_PATH);
      }
 catch (      IOException e) {
        throw new MojoExecutionException("String_Node_Str" + context.getAmpDirectory().getAbsolutePath() + "String_Node_Str",e);
      }
    }
  }
}
Program: 167141
Project: 167141
Buggy source:
public void performPackaging(AmpPackagingContext context) throws MojoExecutionException, MojoFailureException {
  context.getLog().info("String_Node_Str");
  File metainfDir=new File(context.getAmpDirectory(),META_INF_PATH);
  metainfDir.mkdirs();
  handleArtifacts(context);
  handleWebResources(context);
  handleClassesDirectory(context);
  handeAmpConfigDirectory(context);
  handeWebAppSourceDirectory(context);
  handleDeploymentDescriptors(context);
}

Fixed version (ground truth):
public void performPackaging(AmpPackagingContext context) throws MojoExecutionException, MojoFailureException {
  context.getLog().info("String_Node_Str");
  File metainfDir=new File(context.getAmpDirectory(),META_INF_PATH);
  metainfDir.mkdirs();
  handleArtifacts(context);
  handleWebResources(context);
  handleClassesDirectory(context);
  handeAmpConfigDirectory(context);
  handeWebAppSourceDirectory(context);
  synthesiseFileMappings(context);
  handleDeploymentDescriptors(context);
}
Program: 167142
Project: 167142
Buggy source:
private String getAmpMapping(String name){
  if (name.startsWith("String_Node_Str") && !name.startsWith("String_Node_Str")) {
    return name.substring(4);
  }
  for (  Map.Entry<String,String> mapElelement : ampMapping.entrySet()) {
    if (name.startsWith(mapElelement.getKey())) {
      String relativePath="String_Node_Str";
      if ((name.startsWith("String_Node_Str"))) {
        relativePath=name.substring(7);
      }
 else       relativePath=FileUtils.removePath(name);
      return mapElelement.getValue() + relativePath;
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private String getAmpMapping(String name){
  if (name.startsWith("String_Node_Str") && !name.startsWith("String_Node_Str")) {
    return name.substring(4);
  }
  for (  Map.Entry<String,String> mapElelement : ampMapping.entrySet()) {
    if (name.startsWith(mapElelement.getKey())) {
      String relativePath="String_Node_Str";
      if ((name.startsWith("String_Node_Str"))) {
        relativePath=name.substring(7);
      }
 else       if ((name.startsWith("String_Node_Str"))) {
        relativePath=name.substring(4);
      }
 else       relativePath=FileUtils.removePath(name);
      return mapElelement.getValue() + relativePath;
    }
  }
  return "String_Node_Str";
}
Program: 167143
Project: 167143
Buggy source:
private static int encodePushDataOperation(final int opcode,final byte[] bytes,final byte[] partBytes,int pointer){
switch (opcode) {
case 76:
    bytes[pointer=pointer + 1]=(byte)partBytes.length;
default :
  System.arraycopy(partBytes,0,bytes,pointer,partBytes.length);
return pointer + partBytes.length;
}
}

Fixed version (ground truth):
private static int encodePushDataOperation(final int opcode,final byte[] bytes,final byte[] partBytes,int pointer){
switch (opcode) {
case 76:
    bytes[pointer]=(byte)partBytes.length;
  pointer++;
default :
System.arraycopy(partBytes,0,bytes,pointer,partBytes.length);
return pointer + partBytes.length;
}
}
Program: 167147
Project: 167147
Buggy source:
/** 
 * Init for PDialogs
 * @param _core dictionary core
 * @param _overideFont whether to override font (default to no)
 * @param _defText default text that will display in grey if otherwise empty
 */
public PTextField(DictCore _core,boolean _overideFont,String _defText){
  DefaultBoundedRangeModel pVis=(DefaultBoundedRangeModel)this.getHorizontalVisibility();
  for (  ChangeListener chlist : pVis.getChangeListeners()) {
    pVis.removeChangeListener(chlist);
  }
  pVis.addChangeListener(new PScrollRepainter());
  core=_core;
  overrideFont=_overideFont;
  defText=_defText;
  setupListeners();
  setText(defText);
  setForeground(Color.lightGray);
  setupRightClickMenu();
  if (!overrideFont) {
    setFont(core.getPropertiesManager().getFontCon());
  }
 else {
    setFont(core.getPropertiesManager().getCharisUnicodeFont());
  }
}

Fixed version (ground truth):
/** 
 * Init for PDialogs
 * @param _core dictionary core
 * @param _overideFont whether to override font (default to no)
 * @param _defText default text that will display in grey if otherwise empty
 */
public PTextField(DictCore _core,boolean _overideFont,String _defText){
  DefaultBoundedRangeModel pVis=(DefaultBoundedRangeModel)this.getHorizontalVisibility();
  for (  ChangeListener chlist : pVis.getChangeListeners()) {
    pVis.removeChangeListener(chlist);
  }
  pVis.addChangeListener(new PScrollRepainter());
  core=_core;
  overrideFont=_overideFont;
  defText=_defText;
  setupListeners();
  setForeground(Color.lightGray);
  setupRightClickMenu();
  if (!overrideFont) {
    setFont(core.getPropertiesManager().getFontCon());
  }
 else {
    setFont(core.getPropertiesManager().getCharisUnicodeFont());
  }
  setText(defText);
}
Program: 167148
Project: 167148
Buggy source:
/** 
 * Gives user option to save file, returns continue/don't continue
 * @return true to signal continue, false to signal stop
 */
private boolean saveOrCancelTest(){
  if (core != null && core.getWordCollection().getWordNodes().isEmpty()) {
    Integer saveFirst=localYesNoCancel("String_Node_Str","String_Node_Str");
    if (saveFirst == JOptionPane.YES_OPTION) {
      boolean saved=saveFile();
      if (!saved) {
        return false;
      }
    }
 else     if (saveFirst == JOptionPane.CANCEL_OPTION) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Gives user option to save file, returns continue/don't continue
 * @return true to signal continue, false to signal stop
 */
private boolean saveOrCancelTest(){
  if (core != null && !core.getWordCollection().getWordNodes().isEmpty()) {
    Integer saveFirst=localYesNoCancel("String_Node_Str","String_Node_Str");
    if (saveFirst == JOptionPane.YES_OPTION) {
      boolean saved=saveFile();
      if (!saved) {
        return false;
      }
    }
 else     if (saveFirst == JOptionPane.CANCEL_OPTION) {
      return false;
    }
  }
  return true;
}
Program: 167149
Project: 167149
Buggy source:
private void setupListeners(){
  FocusListener listener=new FocusListener(){
    @Override public void focusGained(    FocusEvent e){
      if (isDefaultText()) {
        setText("String_Node_Str");
        setForeground(Color.black);
      }
    }
    @Override public void focusLost(    FocusEvent e){
      if (getNakedText().equals("String_Node_Str")) {
        setText(defText);
        setForeground(Color.lightGray);
      }
    }
  }
;
  this.addFocusListener(listener);
}

Fixed version (ground truth):
private void setupListeners(){
  FocusListener listener=new FocusListener(){
    @Override public void focusGained(    FocusEvent e){
      if (isDefaultText()) {
        setText("String_Node_Str");
        setForeground(Color.black);
      }
    }
    @Override public void focusLost(    FocusEvent e){
      if (isEmpty()) {
        setText(defText);
        setForeground(Color.lightGray);
      }
    }
  }
;
  this.addFocusListener(listener);
}
Program: 167150
Project: 167150
Buggy source:
@Override public void focusLost(FocusEvent e){
  if (getNakedText().equals("String_Node_Str")) {
    setText(defText);
    setForeground(Color.lightGray);
  }
}

Fixed version (ground truth):
@Override public void focusLost(FocusEvent e){
  if (isEmpty()) {
    setText(defText);
    setForeground(Color.lightGray);
  }
}
Program: 167151
Project: 167151
Buggy source:
private void addImage(ImageNode image) throws Exception {
  final String placeHold="String_Node_Str";
  if (isDefaultText()) {
    super.setText("String_Node_Str");
  }
  ClipboardHandler test=new ClipboardHandler();
  test.cacheClipboard();
  test.setClipboardContents(placeHold);
  paste();
  String newText=getRawHTML();
  setText(newText.replace(placeHold,"String_Node_Str" + image.getImagePath() + "String_Node_Str"));
  test.restoreClipboard();
}

Fixed version (ground truth):
private void addImage(ImageNode image) throws Exception {
  final String placeHold="String_Node_Str";
  if (isDefaultText()) {
    super.setText("String_Node_Str");
  }
  ClipboardHandler test=new ClipboardHandler();
  test.cacheClipboard();
  test.setClipboardContents(placeHold);
  super.paste();
  String newText=getRawHTML();
  setText(newText.replaceAll(placeHold,"String_Node_Str" + image.getImagePath() + "String_Node_Str"));
  test.restoreClipboard();
}
Program: 167152
Project: 167152
Buggy source:
/** 
 * Tests whether the current text value is the default value
 * @return
 */
public boolean isDefaultText(){
  String curText=getNakedText().replaceAll(PGTUtil.RTLMarker,"String_Node_Str").replaceAll(PGTUtil.LTRMarker,"String_Node_Str");
  return curText.equals("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Tests whether the current text value is the default value
 * @return
 */
public boolean isDefaultText(){
  String body=super.getText();
  body=body.substring(0,body.indexOf("String_Node_Str"));
  body=body.substring(body.indexOf("String_Node_Str") + 6,body.length());
  return body.trim().equals(defText);
}
Program: 167153
Project: 167153
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 (((PTextField)txtConWord).isDefaultText()) {
    return;
  }
  saveWord.setValue(txtConWord.getText());
  saveWord.setDefinition(txtDefinition.getText());
  saveWord.setLocalWord(((PTextField)txtLocalWord).isDefaultText() ? "String_Node_Str" : txtLocalWord.getText());
  saveWord.setProcOverride(chkProcOverride.isSelected());
  saveWord.setPronunciation(((PTextField)txtProc).isDefaultText() ? "String_Node_Str" : txtProc.getText());
  saveWord.setRulesOverride(chkRuleOverride.isSelected());
  Object curType=cmbType.getSelectedItem();
  if (curType != null) {
    saveWord.setWordTypeId((curType.equals(defTypeValue) || curType.equals(newTypeValue)) ? 0 : ((TypeNode)curType).getId());
  }
}

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 (((PTextField)txtConWord).isDefaultText() || saveWord == null) {
    return;
  }
  saveWord.setValue(txtConWord.getText());
  saveWord.setDefinition(txtDefinition.getText());
  saveWord.setLocalWord(((PTextField)txtLocalWord).isDefaultText() ? "String_Node_Str" : txtLocalWord.getText());
  saveWord.setProcOverride(chkProcOverride.isSelected());
  saveWord.setPronunciation(((PTextField)txtProc).isDefaultText() ? "String_Node_Str" : txtProc.getText());
  saveWord.setRulesOverride(chkRuleOverride.isSelected());
  Object curType=cmbType.getSelectedItem();
  if (curType != null) {
    saveWord.setWordTypeId((curType.equals(defTypeValue) || curType.equals(newTypeValue)) ? 0 : ((TypeNode)curType).getId());
  }
}
Program: 167154
Project: 167154
Buggy source:
/** 
 * Sets up all component listeners
 */
private void setupListeners(){
  KeyListener enterListener=new KeyListener(){
    @Override public void keyPressed(    KeyEvent e){
      if (e.getKeyCode() == KeyEvent.VK_ENTER && !cmbType.isPopupVisible()) {
        for (        JComboBox curBox : classComboMap.values()) {
          if (curBox.isPopupVisible()) {
            return;
          }
        }
        tryRecord();
      }
    }
    @Override public void keyReleased(    KeyEvent e){
    }
    @Override public void keyTyped(    KeyEvent e){
    }
  }
;
  txtConWord.setFont(core.getPropertiesManager().getFontCon());
  txtConWord.addKeyListener(enterListener);
  txtConWord.getDocument().addDocumentListener(new DocumentListener(){
    @Override public void changedUpdate(    DocumentEvent e){
      setProc();
    }
    @Override public void removeUpdate(    DocumentEvent e){
      setProc();
    }
    @Override public void insertUpdate(    DocumentEvent e){
      setProc();
    }
  }
);
  txtLocalWord.addKeyListener(enterListener);
  txtProc.addKeyListener(enterListener);
}

Fixed version (ground truth):
/** 
 * Sets up all component listeners
 */
private void setupListeners(){
  KeyListener enterListener=new KeyListener(){
    @Override public void keyPressed(    KeyEvent e){
      if (e.getKeyCode() == KeyEvent.VK_ENTER && !cmbType.isPopupVisible()) {
        for (        JComboBox curBox : classComboMap.values()) {
          if (curBox.isPopupVisible()) {
            return;
          }
        }
        tryRecord();
      }
    }
    @Override public void keyReleased(    KeyEvent e){
    }
    @Override public void keyTyped(    KeyEvent e){
    }
  }
;
  txtConWord.setFont(core.getPropertiesManager().getFontCon());
  txtConWord.addKeyListener(enterListener);
  txtConWord.getDocument().addDocumentListener(new DocumentListener(){
    @Override public void changedUpdate(    DocumentEvent e){
      setProc();
    }
    @Override public void removeUpdate(    DocumentEvent e){
      setProc();
    }
    @Override public void insertUpdate(    DocumentEvent e){
      setProc();
    }
  }
);
  txtLocalWord.addKeyListener(enterListener);
  txtProc.addKeyListener(enterListener);
  cmbType.addKeyListener(enterListener);
}
Program: 167155
Project: 167155
Buggy source:
/** 
 * Populates all grammar chapters and sections that match search value
 */
private void populateFromSearch(){
  savePropsToNode((DefaultMutableTreeNode)treChapList.getLastSelectedPathComponent());
  if (txtSearch.getText().isEmpty() || ((PTextField)txtSearch).isDefaultText()) {
    populateSections();
    return;
  }
  List<GrammarChapNode> chapters=core.getGrammarManager().getChapters();
  Iterator<GrammarChapNode> chapIt=chapters.iterator();
  DefaultMutableTreeNode rootNode=new DefaultMutableTreeNode("String_Node_Str");
  DefaultTreeModel treeModel=new DefaultTreeModel(rootNode);
  treChapList.setModel(treeModel);
  while (chapIt.hasNext()) {
    GrammarChapNode curChap=chapIt.next();
    if (!chapMatchSrc(curChap,txtSearch.getText())) {
      continue;
    }
    rootNode.add(curChap);
  }
  treeModel.reload(rootNode);
  treChapList.setLargeModel(true);
}

Fixed version (ground truth):
/** 
 * Populates all grammar chapters and sections that match search value
 */
private void populateFromSearch(){
}
Program: 167156
Project: 167156
Buggy source:
/** 
 * Exports language to presentable PDF
 * @param _core dictionary core
 * @param _targetFile target path to write
 * @throws IOException
 */
public PExportToPDF(DictCore _core,String _targetFile) throws IOException {
  core=_core;
  targetFile=_targetFile;
  conFontFile=core.getPropertiesManager().getCachedFont();
  unicodeFontFile=new IOHandler().getUnicodeFontByteArray();
  unicodeFont=PdfFontFactory.createFont(unicodeFontFile,PdfEncodings.IDENTITY_H,true);
  unicodeFont.setSubset(true);
  if (conFontFile == null) {
    conFont=unicodeFont;
  }
 else {
    conFont=PdfFontFactory.createFont(conFontFile,PdfEncodings.IDENTITY_H,true);
  }
  conFontSize=core.getPropertiesManager().getFontSize();
  glossKey=getGlossKey();
}

Fixed version (ground truth):
/** 
 * Exports language to presentable PDF
 * @param _core dictionary core
 * @param _targetFile target path to write
 * @throws IOException
 */
public PExportToPDF(DictCore _core,String _targetFile) throws IOException {
  core=_core;
  targetFile=_targetFile;
  conFontFile=core.getPropertiesManager().getCachedFont();
  unicodeFontFile=new IOHandler().getUnicodeFontByteArray();
  unicodeFont=PdfFontFactory.createFont(unicodeFontFile,PdfEncodings.IDENTITY_H,true);
  unicodeFont.setSubset(true);
  if (conFontFile == null) {
    try {
      conFontFile=IOHandler.getFontFileArray(core.getPropertiesManager().getFontCon());
    }
 catch (    Exception ex) {
      InfoBox.warning("String_Node_Str","String_Node_Str",null);
    }
  }
  if (conFontFile == null) {
    conFont=unicodeFont;
  }
 else {
    conFont=PdfFontFactory.createFont(conFontFile,PdfEncodings.IDENTITY_H,true);
  }
  conFontSize=core.getPropertiesManager().getFontSize();
  glossKey=getGlossKey();
}
Program: 167157
Project: 167157
Buggy source:
/** 
 * Creates new form ScrIPARefChart
 * @param _core
 */
public ScrIPARefChart(DictCore _core){
  core=_core;
  initComponents();
  handler=new IPAHandler(this);
}

Fixed version (ground truth):
/** 
 * Creates new form ScrIPARefChart
 * @param _core
 */
public ScrIPARefChart(DictCore _core){
  core=_core;
  initComponents();
  handler=new IPAHandler(this);
  this.setupKeyStrokes();
}
Program: 167158
Project: 167158
Buggy source:
/** 
 * Exports language to presentable PDF
 * @param _core dictionary core
 * @param _targetFile target path to write
 * @throws IOException
 */
public PExportToPDF(DictCore _core,String _targetFile) throws IOException {
  core=_core;
  targetFile=_targetFile;
  conFontFile=core.getPropertiesManager().getCachedFont();
  unicodeFontFile=new IOHandler().getUnicodeFontByteArray();
  if (conFontFile == null) {
    conFont=PdfFontFactory.createFont(FontConstants.HELVETICA_BOLD);
  }
 else {
    conFont=PdfFontFactory.createFont(conFontFile,PdfEncodings.IDENTITY_H,true);
  }
  unicodeFont=PdfFontFactory.createFont(unicodeFontFile,PdfEncodings.IDENTITY_H,true);
  unicodeFont.setSubset(true);
  conFontSize=core.getPropertiesManager().getFontSize();
  glossKey=getGlossKey();
}

Fixed version (ground truth):
/** 
 * Exports language to presentable PDF
 * @param _core dictionary core
 * @param _targetFile target path to write
 * @throws IOException
 */
public PExportToPDF(DictCore _core,String _targetFile) throws IOException {
  core=_core;
  targetFile=_targetFile;
  conFontFile=core.getPropertiesManager().getCachedFont();
  unicodeFontFile=new IOHandler().getUnicodeFontByteArray();
  unicodeFont=PdfFontFactory.createFont(unicodeFontFile,PdfEncodings.IDENTITY_H,true);
  unicodeFont.setSubset(true);
  if (conFontFile == null) {
    conFont=unicodeFont;
  }
 else {
    conFont=PdfFontFactory.createFont(conFontFile,PdfEncodings.IDENTITY_H,true);
  }
  conFontSize=core.getPropertiesManager().getFontSize();
  glossKey=getGlossKey();
}
Program: 167161
Project: 167161
Buggy source:
/** 
 * creates blank type, selects value for editing
 */
private void addType(){
  TypeNode curType=(TypeNode)lstTypes.getSelectedValue();
  if (curType != null) {
    savePropertiesTo(curType);
  }
  core.getTypes().clear();
  try {
    core.getTypes().insert();
  }
 catch (  Exception e) {
    InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),this);
  }
  populateTypes();
  lstTypes.setSelectedIndex(0);
  txtName.requestFocus();
}

Fixed version (ground truth):
/** 
 * creates blank type, selects value for editing
 */
private void addType(){
  TypeNode curType=(TypeNode)lstTypes.getSelectedValue();
  if (curType != null) {
    savePropertiesTo(curType);
  }
  core.getTypes().clear();
  try {
    core.getTypes().insert();
  }
 catch (  Exception e) {
    InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),this);
  }
  updatingName=true;
  populateTypes();
  lstTypes.setSelectedIndex(0);
  txtName.setText("String_Node_Str");
  populateProperties();
  updatingName=false;
  txtName.requestFocus();
}
Program: 167162
Project: 167162
Buggy source:
private void setFile(String fileName){
  if (fileName.equals(PGTUtil.emptyFile) || fileName.isEmpty()) {
    return;
  }
  core=new DictCore();
  core.setRootWindow(this);
  updateAllValues(core);
  try {
    core.readFile(fileName);
    curFileName=fileName;
  }
 catch (  Exception e) {
    core=new DictCore();
    localError("String_Node_Str","String_Node_Str" + fileName + "String_Node_Str"+ e.getMessage());
  }
}

Fixed version (ground truth):
private void setFile(String fileName){
  if (fileName.equals(PGTUtil.emptyFile) || fileName.isEmpty()) {
    return;
  }
  core=new DictCore();
  core.setRootWindow(this);
  try {
    core.readFile(fileName);
    curFileName=fileName;
  }
 catch (  Exception e) {
    core=new DictCore();
    localError("String_Node_Str","String_Node_Str" + fileName + "String_Node_Str"+ e.getMessage());
  }
  updateAllValues(core);
}
Program: 167163
Project: 167163
Buggy source:
private boolean chapMatchSrc(GrammarChapNode curChap,String src){
  if (curChap.getName().contains(src)) {
    return true;
  }
  Enumeration sections=curChap.children();
  while (sections.hasMoreElements()) {
    GrammarSectionNode curSec=(GrammarSectionNode)sections.nextElement();
    if (curSec.getName().contains(src)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean chapMatchSrc(GrammarChapNode curChap,String src){
  if (curChap.getName().toLowerCase().contains(src.toLowerCase())) {
    return true;
  }
  Enumeration sections=curChap.children();
  while (sections.hasMoreElements()) {
    GrammarSectionNode curSec=(GrammarSectionNode)sections.nextElement();
    if (curSec.getName().contains(src)) {
      return true;
    }
  }
  return false;
}
Program: 167164
Project: 167164
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){
  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);
  setModal(true);
  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){
  core=_core;
  setupKeyStrokes();
  initComponents();
  try {
    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);
  setModal(true);
  populateDeclensionList();
  setupListeners();
  setupDimTable();
}
Program: 167165
Project: 167165
Buggy source:
private void logoHit(){
  if (btnLogos.isSelected()) {
    try {
      if (scrLogos == null || scrLogos.isDisposed()) {
        scrLogos=ScrLogoDetails.run(core);
        bindButtonToWindow(scrLogos,btnLogos);
      }
      scrLogos.setVisible(true);
    }
 catch (    Exception e) {
      InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),this);
    }
  }
 else {
    try {
      scrLogos.setVisible(false);
    }
 catch (    Exception e) {
      InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),this);
    }
  }
}

Fixed version (ground truth):
private void logoHit(){
  if (btnLogos.isSelected()) {
    try {
      if (scrLogos == null || scrLogos.isDisposed()) {
        scrLogos=ScrLogoDetails.run(core);
        bindButtonToWindow(scrLogos,btnLogos);
      }
      scrLogos.setVisible(true);
    }
 catch (    Exception e) {
      localError("String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
    }
  }
 else {
    try {
      scrLogos.setVisible(false);
    }
 catch (    Exception e) {
      localError("String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
    }
  }
}
Program: 167166
Project: 167166
Buggy source:
public void grammarHit(){
  if (btnGrammar.isSelected()) {
    try {
      if (scrGrammar == null || scrGrammar.isDisposed()) {
        scrGrammar=ScrGrammarGuide.run(core);
        bindButtonToWindow(scrGrammar,btnGrammar);
      }
      scrGrammar.setVisible(true);
    }
 catch (    Exception e) {
      InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),this);
    }
  }
 else {
    try {
      scrGrammar.setVisible(false);
    }
 catch (    Exception e) {
      InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),this);
    }
  }
}

Fixed version (ground truth):
public void grammarHit(){
  if (btnGrammar.isSelected()) {
    try {
      if (scrGrammar == null || scrGrammar.isDisposed()) {
        scrGrammar=ScrGrammarGuide.run(core);
        bindButtonToWindow(scrGrammar,btnGrammar);
      }
      scrGrammar.setVisible(true);
    }
 catch (    Exception e) {
      localError("String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
    }
  }
 else {
    try {
      scrGrammar.setVisible(false);
    }
 catch (    Exception e) {
      localError("String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
    }
  }
}
Program: 167167
Project: 167167
Buggy source:
@Override protected Object doInBackground() throws Exception {
  try {
    core.writeFile(_fileName);
  }
 catch (  IOException|ParserConfigurationException|TransformerException e) {
    parent.setCleanSave(false);
    InfoBox.error("String_Node_Str","String_Node_Str" + curFileName + "String_Node_Str"+ e.getMessage(),null);
  }
  latch.countDown();
  return null;
}

Fixed version (ground truth):
@Override protected Object doInBackground() throws Exception {
  try {
    core.writeFile(_fileName);
  }
 catch (  IOException|ParserConfigurationException|TransformerException e) {
    parent.setCleanSave(false);
    localError("String_Node_Str","String_Node_Str" + curFileName + "String_Node_Str"+ e.getMessage());
  }
  latch.countDown();
  return null;
}
Program: 167168
Project: 167168
Buggy source:
private void thesHit(){
  if (btnThes.isSelected()) {
    try {
      if (scrThes == null || scrThes.isDisposed()) {
        scrThes=ScrThesaurus.run(core,this);
        bindButtonToWindow(scrThes,btnThes);
      }
      scrThes.setVisible(true);
    }
 catch (    Exception e) {
      InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),this);
    }
  }
 else {
    try {
      scrThes.setVisible(false);
    }
 catch (    Exception e) {
      InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),this);
    }
  }
}

Fixed version (ground truth):
private void thesHit(){
  if (btnThes.isSelected()) {
    try {
      if (scrThes == null || scrThes.isDisposed()) {
        scrThes=ScrThesaurus.run(core,this);
        bindButtonToWindow(scrThes,btnThes);
      }
      scrThes.setVisible(true);
    }
 catch (    Exception e) {
      localError("String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
    }
  }
 else {
    try {
      scrThes.setVisible(false);
    }
 catch (    Exception e) {
      localInfo("String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
    }
  }
}
Program: 167169
Project: 167169
Buggy source:
@Override public void handlePrintFile(ApplicationEvent event){
  InfoBox.info("String_Node_Str","String_Node_Str",this);
}

Fixed version (ground truth):
@Override public void handlePrintFile(ApplicationEvent event){
  localInfo("String_Node_Str","String_Node_Str");
}
Program: 167170
Project: 167170
Buggy source:
/** 
 * Gives user option to save file, returns continue/don't continue
 * @return true to signal continue, false to signal stop
 */
private boolean saveOrCancelTest(){
  if (core != null && core.getWordCollection().getNodeIterator().hasNext()) {
    boolean localOpening=openingFile;
    openingFile=true;
    Integer saveFirst=InfoBox.yesNoCancel("String_Node_Str","String_Node_Str",this);
    openingFile=localOpening;
    if (saveFirst == JOptionPane.YES_OPTION) {
      boolean saved=saveFile();
      if (!saved) {
        return false;
      }
    }
 else     if (saveFirst == JOptionPane.CANCEL_OPTION) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Gives user option to save file, returns continue/don't continue
 * @return true to signal continue, false to signal stop
 */
private boolean saveOrCancelTest(){
  if (core != null && core.getWordCollection().getNodeIterator().hasNext()) {
    Integer saveFirst=localYesNoCancel("String_Node_Str","String_Node_Str");
    if (saveFirst == JOptionPane.YES_OPTION) {
      boolean saved=saveFile();
      if (!saved) {
        return false;
      }
    }
 else     if (saveFirst == JOptionPane.CANCEL_OPTION) {
      return false;
    }
  }
  return true;
}
Program: 167171
Project: 167171
Buggy source:
private void setFile(String fileName){
  if (fileName.equals(PGTUtil.emptyFile) || fileName.isEmpty()) {
    return;
  }
  core=new DictCore();
  core.setRootWindow(this);
  updateAllValues(core);
  try {
    core.readFile(fileName);
    curFileName=fileName;
  }
 catch (  Exception e) {
    core=new DictCore();
    InfoBox.error("String_Node_Str","String_Node_Str" + fileName + "String_Node_Str"+ e.getMessage(),this);
  }
}

Fixed version (ground truth):
private void setFile(String fileName){
  if (fileName.equals(PGTUtil.emptyFile) || fileName.isEmpty()) {
    return;
  }
  core=new DictCore();
  core.setRootWindow(this);
  updateAllValues(core);
  try {
    core.readFile(fileName);
    curFileName=fileName;
  }
 catch (  Exception e) {
    core=new DictCore();
    localError("String_Node_Str","String_Node_Str" + fileName + "String_Node_Str"+ e.getMessage());
  }
}
Program: 167172
Project: 167172
Buggy source:
/** 
 * Provided for cases where the java is run from an odd source folder (such as under an app file in OSX)
 * @param override directory for base PolyGlot directory
 */
private void setOverrideProgramPath(String override){
  core.getPropertiesManager().setOverrideProgramPath(override);
  try {
    core.getOptionsManager().loadIni();
  }
 catch (  Exception e) {
    InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),this);
  }
}

Fixed version (ground truth):
/** 
 * Provided for cases where the java is run from an odd source folder (such as under an app file in OSX)
 * @param override directory for base PolyGlot directory
 */
private void setOverrideProgramPath(String override){
  core.getPropertiesManager().setOverrideProgramPath(override);
  try {
    core.getOptionsManager().loadIni();
  }
 catch (  Exception e) {
    localError("String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 167173
Project: 167173
Buggy source:
@Override public void dispose(){
  if (!saveOrCancelTest()) {
    return;
  }
  try {
    core.getOptionsManager().setLastFiles(lastFiles);
    core.getOptionsManager().saveIni();
  }
 catch (  IOException e) {
    InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),this);
  }
  super.dispose();
  System.exit(0);
}

Fixed version (ground truth):
@Override public void dispose(){
  if (!saveOrCancelTest()) {
    return;
  }
  try {
    core.getOptionsManager().setLastFiles(lastFiles);
    core.getOptionsManager().saveIni();
  }
 catch (  IOException e) {
    localError("String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
  super.dispose();
  System.exit(0);
}
Program: 167174
Project: 167174
Buggy source:
/** 
 * Creates totally new file
 * @param performTest whether the UI ask for confirmation
 */
final public void newFile(boolean performTest){
  boolean localOpening=openingFile;
  openingFile=true;
  if (performTest && !saveOrCancelTest()) {
    return;
  }
  core=new DictCore();
  core.setRootWindow(this);
  updateAllValues(core);
  curFileName="String_Node_Str";
  openingFile=localOpening;
}

Fixed version (ground truth):
/** 
 * Creates totally new file
 * @param performTest whether the UI ask for confirmation
 */
final public void newFile(boolean performTest){
  if (performTest && !saveOrCancelTest()) {
    return;
  }
  core=new DictCore();
  core.setRootWindow(this);
  updateAllValues(core);
  curFileName="String_Node_Str";
}
Program: 167175
Project: 167175
Buggy source:
/** 
 * sends the write command to the core in a new thread
 * @param _fileName path to write to
 * @return returns success
 */
private boolean doWrite(final String _fileName){
  final ScrDictMenu parent=this;
  final CountDownLatch latch=new CountDownLatch(1);
  boolean ret;
  setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
  boolean localOpening=openingFile;
  openingFile=true;
  final SwingWorker worker=new SwingWorker(){
    @Override protected Object doInBackground() throws Exception {
      try {
        core.writeFile(_fileName);
      }
 catch (      IOException|ParserConfigurationException|TransformerException e) {
        parent.setCleanSave(false);
        InfoBox.error("String_Node_Str","String_Node_Str" + curFileName + "String_Node_Str"+ e.getMessage(),null);
      }
      latch.countDown();
      return null;
    }
  }
;
  worker.execute();
  try {
    latch.await(30,TimeUnit.SECONDS);
  }
 catch (  Exception e) {
    InfoBox.error("String_Node_Str","String_Node_Str",null);
  }
  setCursor(Cursor.getDefaultCursor());
  if (cleanSave) {
    InfoBox.info("String_Node_Str","String_Node_Str" + curFileName + "String_Node_Str",null);
    ret=true;
  }
 else {
    ret=false;
  }
  openingFile=localOpening;
  cleanSave=true;
  return ret;
}

Fixed version (ground truth):
/** 
 * sends the write command to the core in a new thread
 * @param _fileName path to write to
 * @return returns success
 */
private boolean doWrite(final String _fileName){
  final ScrDictMenu parent=this;
  final CountDownLatch latch=new CountDownLatch(1);
  boolean ret;
  setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
  final SwingWorker worker=new SwingWorker(){
    @Override protected Object doInBackground() throws Exception {
      try {
        core.writeFile(_fileName);
      }
 catch (      IOException|ParserConfigurationException|TransformerException e) {
        parent.setCleanSave(false);
        localError("String_Node_Str","String_Node_Str" + curFileName + "String_Node_Str"+ e.getMessage());
      }
      latch.countDown();
      return null;
    }
  }
;
  worker.execute();
  try {
    latch.await(30,TimeUnit.SECONDS);
  }
 catch (  Exception e) {
    localError("String_Node_Str","String_Node_Str");
  }
  setCursor(Cursor.getDefaultCursor());
  if (cleanSave) {
    localInfo("String_Node_Str","String_Node_Str" + curFileName + "String_Node_Str");
    ret=true;
  }
 else {
    ret=false;
  }
  cleanSave=true;
  return ret;
}
Program: 167177
Project: 167177
Buggy source:
/** 
 * saves file as particular filename
 * @return true if file saved, false otherwise
 */
private boolean saveFileAs(){
  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);
  chooser.setApproveButtonText("String_Node_Str");
  chooser.setCurrentDirectory(new File("String_Node_Str"));
  String fileName;
  if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
    fileName=chooser.getSelectedFile().getAbsolutePath();
  }
 else {
    return false;
  }
  if (!fileName.contains("String_Node_Str")) {
    fileName+="String_Node_Str";
  }
  File f=new File(fileName);
  if (f.exists()) {
    Integer overWrite=InfoBox.yesNoCancel("String_Node_Str","String_Node_Str" + fileName,this);
    if (overWrite == JOptionPane.NO_OPTION) {
      saveFileAs();
    }
 else     if (overWrite == JOptionPane.CANCEL_OPTION) {
      return false;
    }
  }
  curFileName=fileName;
  return true;
}

Fixed version (ground truth):
/** 
 * saves file as particular filename
 * @return true if file saved, false otherwise
 */
private boolean saveFileAs(){
  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);
  chooser.setApproveButtonText("String_Node_Str");
  chooser.setCurrentDirectory(new File("String_Node_Str"));
  String fileName;
  holdFront=true;
  if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
    fileName=chooser.getSelectedFile().getAbsolutePath();
  }
 else {
    return false;
  }
  holdFront=false;
  if (!fileName.contains("String_Node_Str")) {
    fileName+="String_Node_Str";
  }
  File f=new File(fileName);
  if (f.exists()) {
    Integer overWrite=localYesNoCancel("String_Node_Str","String_Node_Str" + fileName);
    if (overWrite == JOptionPane.NO_OPTION) {
      saveFileAs();
    }
 else     if (overWrite == JOptionPane.CANCEL_OPTION) {
      return false;
    }
  }
  curFileName=fileName;
  return true;
}
Program: 167178
Project: 167178
Buggy source:
/** 
 * Prompts user for a location and exports font within PGD to given path
 */
public void exportFont(){
  JFileChooser chooser=new JFileChooser();
  chooser.setDialogTitle("String_Node_Str");
  FileNameExtensionFilter filter=new FileNameExtensionFilter("String_Node_Str","String_Node_Str");
  chooser.setFileFilter(filter);
  String fileName;
  chooser.setCurrentDirectory(new File("String_Node_Str"));
  chooser.setApproveButtonText("String_Node_Str");
  if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
    fileName=chooser.getSelectedFile().getAbsolutePath();
  }
 else {
    return;
  }
  try {
    IOHandler.exportFont(fileName,curFileName);
  }
 catch (  IOException e) {
    InfoBox.error("String_Node_Str","String_Node_Str" + e.getMessage(),this);
  }
}

Fixed version (ground truth):
/** 
 * Prompts user for a location and exports font within PGD to given path
 */
public void exportFont(){
  JFileChooser chooser=new JFileChooser();
  chooser.setDialogTitle("String_Node_Str");
  FileNameExtensionFilter filter=new FileNameExtensionFilter("String_Node_Str","String_Node_Str");
  chooser.setFileFilter(filter);
  String fileName;
  chooser.setCurrentDirectory(new File("String_Node_Str"));
  chooser.setApproveButtonText("String_Node_Str");
  holdFront=true;
  if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
    fileName=chooser.getSelectedFile().getAbsolutePath();
  }
 else {
    return;
  }
  holdFront=false;
  try {
    IOHandler.exportFont(fileName,curFileName);
  }
 catch (  IOException e) {
    localError("String_Node_Str","String_Node_Str" + e.getMessage());
  }
}
Program: 167179
Project: 167179
Buggy source:
/** 
 * Checks to make certain Java is a high enough version. Informs user and quits otherwise.
 */
private void checkJavaVersion(){
  String javaVersion=System.getProperty("String_Node_Str");
  if (javaVersion.startsWith("String_Node_Str") || javaVersion.startsWith("String_Node_Str") || javaVersion.startsWith("String_Node_Str")|| javaVersion.startsWith("String_Node_Str")|| javaVersion.startsWith("String_Node_Str")|| javaVersion.startsWith("String_Node_Str")|| javaVersion.startsWith("String_Node_Str")) {
    InfoBox.error("String_Node_Str","String_Node_Str" + javaVersion + "String_Node_Str"+ "String_Node_Str",this);
    System.exit(0);
  }
}

Fixed version (ground truth):
/** 
 * Checks to make certain Java is a high enough version. Informs user and quits otherwise.
 */
private void checkJavaVersion(){
  String javaVersion=System.getProperty("String_Node_Str");
  if (javaVersion.startsWith("String_Node_Str") || javaVersion.startsWith("String_Node_Str") || javaVersion.startsWith("String_Node_Str")|| javaVersion.startsWith("String_Node_Str")|| javaVersion.startsWith("String_Node_Str")|| javaVersion.startsWith("String_Node_Str")|| javaVersion.startsWith("String_Node_Str")) {
    localError("String_Node_Str","String_Node_Str" + javaVersion + "String_Node_Str"+ "String_Node_Str");
    System.exit(0);
  }
}
Program: 167180
Project: 167180
Buggy source:
/** 
 * checks web for updates to PolyGlot
 * @param verbose Set this to have messages post to user.
 */
private void checkForUpdates(final boolean verbose){
  final Window parent=this;
  Thread check=new Thread(){
    @Override public void run(){
      try {
        ScrUpdateAlert.run(verbose,core);
      }
 catch (      Exception e) {
        if (verbose) {
          InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),parent);
        }
      }
    }
  }
;
  check.start();
}

Fixed version (ground truth):
/** 
 * checks web for updates to PolyGlot
 * @param verbose Set this to have messages post to user.
 */
private void checkForUpdates(final boolean verbose){
  final Window parent=this;
  Thread check=new Thread(){
    @Override public void run(){
      try {
        ScrUpdateAlert.run(verbose,core);
      }
 catch (      Exception e) {
        if (verbose) {
          PolyGlot.CustomControls.InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),parent);
        }
      }
    }
  }
;
  check.start();
}
Program: 167181
Project: 167181
Buggy source:
private void lexHit(){
  if (btnLexicon.isSelected()) {
    try {
      if (scrLexicon == null || scrLexicon.isDisposed()) {
        scrLexicon=ScrLexicon.run(core);
        bindButtonToWindow(scrLexicon,btnLexicon);
      }
      scrLexicon.setVisible(true);
    }
 catch (    Exception e) {
      InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),this);
    }
  }
 else {
    try {
      scrLexicon.setVisible(false);
    }
 catch (    Exception e) {
      InfoBox.error("String_Node_Str","String_Node_Str" + e.getLocalizedMessage(),this);
    }
  }
}

Fixed version (ground truth):
private void lexHit(){
  if (btnLexicon.isSelected()) {
    try {
      if (scrLexicon == null || scrLexicon.isDisposed()) {
        scrLexicon=ScrLexicon.run(core);
        bindButtonToWindow(scrLexicon,btnLexicon);
      }
      scrLexicon.setVisible(true);
    }
 catch (    Exception e) {
      localError("String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
    }
  }
 else {
    try {
      scrLexicon.setVisible(false);
    }
 catch (    Exception e) {
      localError("String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
    }
  }
}
Program: 167182
Project: 167182
Buggy source:
/** 
 * Export dictionary to excel file
 */
private void exportToExcel(){
  JFileChooser chooser=new JFileChooser();
  chooser.setDialogTitle("String_Node_Str");
  FileNameExtensionFilter filter=new FileNameExtensionFilter("String_Node_Str","String_Node_Str");
  chooser.setFileFilter(filter);
  chooser.setApproveButtonText("String_Node_Str");
  chooser.setCurrentDirectory(new File("String_Node_Str"));
  String fileName;
  if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
    fileName=chooser.getSelectedFile().getAbsolutePath();
  }
 else {
    return;
  }
  if (!fileName.contains("String_Node_Str")) {
    fileName+="String_Node_Str";
  }
  try {
    ExcelExport.exportExcelDict(fileName,core);
    InfoBox.info("String_Node_Str","String_Node_Str" + fileName + "String_Node_Str",this);
  }
 catch (  Exception e) {
    InfoBox.error("String_Node_Str",e.getLocalizedMessage(),this);
  }
}

Fixed version (ground truth):
/** 
 * Export dictionary to excel file
 */
private void exportToExcel(){
  JFileChooser chooser=new JFileChooser();
  chooser.setDialogTitle("String_Node_Str");
  FileNameExtensionFilter filter=new FileNameExtensionFilter("String_Node_Str","String_Node_Str");
  chooser.setFileFilter(filter);
  chooser.setApproveButtonText("String_Node_Str");
  chooser.setCurrentDirectory(new File("String_Node_Str"));
  String fileName;
  holdFront=true;
  if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
    fileName=chooser.getSelectedFile().getAbsolutePath();
  }
 else {
    return;
  }
  holdFront=false;
  if (!fileName.contains("String_Node_Str")) {
    fileName+="String_Node_Str";
  }
  try {
    ExcelExport.exportExcelDict(fileName,core);
    localInfo("String_Node_Str","String_Node_Str" + fileName + "String_Node_Str");
  }
 catch (  Exception e) {
    localError("String_Node_Str",e.getLocalizedMessage());
  }
}