nus-yam/ex-repair huggingface dataset:
Program: 123387
Project: 123387
Buggy source:
public void prepareXlsxFile(String fileName) throws Exception {
  File xlsxFile=new File(fileName);
  if (xlsxFile.exists()) {
    if (isAbsY && keepCellFormat) {
      initPreXlsx(fileName);
    }
    if (appendWorkbook) {
      InputStream inp=new FileInputStream(fileName);
      wb=WorkbookFactory.create(inp);
      sheet=wb.getSheet(sheetName);
      if (sheet != null) {
        if (appendSheet) {
          curY=sheet.getLastRowNum() + 1;
        }
 else {
          wb.removeSheetAt(wb.getSheetIndex(sheetName));
          sheet=wb.createSheet(sheetName);
        }
      }
 else {
        sheet=wb.createSheet(sheetName);
      }
    }
 else {
      xlsxFile.delete();
      wb=new SXSSFWorkbook(rowAccessWindowSize);
      sheet=wb.createSheet(sheetName);
    }
  }
 else {
    wb=new SXSSFWorkbook(rowAccessWindowSize);
    sheet=wb.createSheet(sheetName);
  }
  if (isAbsY) {
    startX=absX;
    curY=absY;
  }
}

Fixed version (ground truth):
public void prepareXlsxFile(String fileName) throws Exception {
  File xlsxFile=new File(fileName);
  if (xlsxFile.exists()) {
    if (isAbsY && keepCellFormat) {
      initPreXlsx(fileName);
    }
    if (appendWorkbook) {
      InputStream inp=new FileInputStream(fileName);
      wb=WorkbookFactory.create(inp);
      sheet=wb.getSheet(sheetName);
      if (sheet != null) {
        if (appendSheet) {
          if (sheet.getLastRowNum() != 0 || sheet.getRow(0) != null) {
            curY=sheet.getLastRowNum() + 1;
          }
        }
 else {
          wb.removeSheetAt(wb.getSheetIndex(sheetName));
          sheet=wb.createSheet(sheetName);
        }
      }
 else {
        sheet=wb.createSheet(sheetName);
      }
    }
 else {
      xlsxFile.delete();
      wb=new SXSSFWorkbook(rowAccessWindowSize);
      sheet=wb.createSheet(sheetName);
    }
  }
 else {
    wb=new SXSSFWorkbook(rowAccessWindowSize);
    sheet=wb.createSheet(sheetName);
  }
  if (isAbsY) {
    startX=absX;
    curY=absY;
  }
}
Program: 123388
Project: 123388
Buggy source:
private void openedByBrowser(Item item,URL url){
  if (url == null || item == null) {
    return;
  }
  WebBrowserEditor browser=new WebBrowserEditor();
  WebBrowserEditorInput input=new WebBrowserEditorInput(url);
  input.setName(item.getProperty().getLabel());
  input.setToolTipText(item.getProperty().getLabel() + "String_Node_Str" + item.getProperty().getVersion());
  browser.open(input);
}

Fixed version (ground truth):
private void openedByBrowser(Item item,URL url){
  if (url == null || item == null) {
    return;
  }
  WebBrowserEditor browser=new WebBrowserEditor();
  WebBrowserEditorInput input=new WebBrowserEditorInput(url);
  try {
    IWorkbenchPage page=getActivePage();
    IEditorReference[] iEditorReference=page.getEditorReferences();
    for (    IEditorReference editors : iEditorReference) {
      if ("String_Node_Str".equals(editors.getId())) {
        IEditorPart iEditorPart=editors.getEditor(true);
        if (iEditorPart != null && iEditorPart instanceof WebBrowserEditor) {
          WebBrowserEditorInput webBrowserEditorInput=(WebBrowserEditorInput)iEditorPart.getEditorInput();
          if (webBrowserEditorInput != null && url.equals(webBrowserEditorInput.getURL())) {
            iEditorPart.init(iEditorPart.getEditorSite(),webBrowserEditorInput);
            return;
          }
        }
      }
    }
  }
 catch (  PartInitException e) {
    MessageBoxExceptionHandler.process(e);
  }
  input.setName(item.getProperty().getLabel());
  input.setToolTipText(item.getProperty().getLabel() + "String_Node_Str" + item.getProperty().getVersion());
  browser.open(input);
}
Program: 123389
Project: 123389
Buggy source:
@Override public void partClosed(IWorkbenchPart part){
  if (part == AbstractMultiPageTalendEditor.this) {
    restorePropertyInformation();
    IProject currentProject;
    try {
      currentProject=ResourceModelUtils.getProject(ProjectManager.getInstance().getCurrentProject());
      String jobScriptVersion="String_Node_Str";
      if (getEditorInput() != null && getEditorInput() instanceof RepositoryEditorInput) {
        Item item=((RepositoryEditorInput)getEditorInput()).getItem();
        if (item != null) {
          Property property=item.getProperty();
          if (property != null) {
            jobScriptVersion="String_Node_Str" + property.getVersion();
          }
        }
      }
      IFile file=currentProject.getFolder("String_Node_Str").getFile(getEditorInput().getName() + jobScriptVersion + "String_Node_Str"+ "String_Node_Str");
      if (file.exists()) {
        file.delete(true,null);
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
catch (    CoreException e) {
      ExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
@Override public void partClosed(IWorkbenchPart part){
  if (part == AbstractMultiPageTalendEditor.this) {
    restorePropertyInformation();
    IProject currentProject;
    try {
      currentProject=ResourceModelUtils.getProject(ProjectManager.getInstance().getCurrentProject());
      String jobScriptVersion="String_Node_Str";
      if (getEditorInput() != null && getEditorInput() instanceof RepositoryEditorInput) {
        Item item=((RepositoryEditorInput)getEditorInput()).getItem();
        if (item != null) {
          Property property=item.getProperty();
          if (property != null) {
            jobScriptVersion="String_Node_Str" + property.getVersion();
          }
        }
      }
      IFile file=currentProject.getFolder("String_Node_Str").getFile(getEditorInput().getName() + jobScriptVersion + "String_Node_Str"+ "String_Node_Str");
      if (file.exists()) {
        file.delete(true,null);
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
catch (    CoreException e) {
      ExceptionHandler.process(e);
    }
    changeContextsViewStatus(true);
  }
}
Program: 123392
Project: 123392
Buggy source:
@Override public void partClosed(IWorkbenchPart part){
  if (part == AbstractMultiPageTalendEditor.this) {
    restorePropertyInformation();
    IProject currentProject;
    try {
      currentProject=ResourceModelUtils.getProject(ProjectManager.getInstance().getCurrentProject());
      String jobScriptVersion="String_Node_Str";
      if (getEditorInput() != null && getEditorInput() instanceof RepositoryEditorInput) {
        Item item=((RepositoryEditorInput)getEditorInput()).getItem();
        if (item != null) {
          Property property=item.getProperty();
          if (property != null) {
            jobScriptVersion="String_Node_Str" + property.getVersion();
          }
        }
      }
      IFile file=currentProject.getFolder("String_Node_Str").getFile(getEditorInput().getName() + jobScriptVersion + "String_Node_Str"+ "String_Node_Str");
      if (file.exists()) {
        file.delete(true,null);
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
catch (    CoreException e) {
      ExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
@Override public void partClosed(IWorkbenchPart part){
  if (part == AbstractMultiPageTalendEditor.this) {
    restorePropertyInformation();
    IProject currentProject;
    try {
      currentProject=ResourceModelUtils.getProject(ProjectManager.getInstance().getCurrentProject());
      String jobScriptVersion="String_Node_Str";
      if (getEditorInput() != null && getEditorInput() instanceof RepositoryEditorInput) {
        Item item=((RepositoryEditorInput)getEditorInput()).getItem();
        if (item != null) {
          Property property=item.getProperty();
          if (property != null) {
            jobScriptVersion="String_Node_Str" + property.getVersion();
          }
        }
      }
      IFile file=currentProject.getFolder("String_Node_Str").getFile(getEditorInput().getName() + jobScriptVersion + "String_Node_Str"+ "String_Node_Str");
      if (file.exists()) {
        file.delete(true,null);
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
catch (    CoreException e) {
      ExceptionHandler.process(e);
    }
    changeContextsViewStatus(true);
  }
}
Program: 123397
Project: 123397
Buggy source:
/** 
 * DOC amaumont Comment method "ckeckConstraintsAreEmpty".
 * @param ExternalDbMapTable
 * @return
 */
public boolean checkFiltersAreEmpty(ExternalDbMapTable outputTable){
  List<ExternalDbMapEntry> constraints=outputTable.getCustomConditionsEntries();
  int lstSize=constraints.size();
  boolean oneConstraintIsNotEmpty=false;
  for (int i=0; i < lstSize; i++) {
    String constraintExpression=((ExternalDbMapEntry)constraints.get(i)).getExpression();
    if (constraintExpression != null && constraintExpression.trim().length() > 0) {
      oneConstraintIsNotEmpty=true;
      break;
    }
  }
  return !oneConstraintIsNotEmpty;
}

Fixed version (ground truth):
/** 
 * DOC amaumont Comment method "ckeckConstraintsAreEmpty".
 * @param ExternalDbMapTable
 * @return
 */
public boolean checkFiltersAreEmpty(ExternalDbMapTable outputTable){
  List<ExternalDbMapEntry> constraints=outputTable.getCustomConditionsEntries();
  int lstSize=constraints.size();
  boolean oneConstraintIsNotEmpty=false;
  for (int i=0; i < lstSize; i++) {
    String constraintExpression=(constraints.get(i)).getExpression();
    if (constraintExpression != null && constraintExpression.trim().length() > 0) {
      oneConstraintIsNotEmpty=true;
      break;
    }
  }
  return !oneConstraintIsNotEmpty;
}
Program: 123399
Project: 123399
Buggy source:
protected String getSpecialRightJoin(ExternalDbMapTable table){
  if (language.getJoin(table.getJoinType()) == OracleLanguage.ORACLEJOIN.RIGHT_OUTER_JOIN_ORACLE) {
    return JOIN;
  }
  return DbMapSqlConstants.EMPTY;
}

Fixed version (ground truth):
@Override protected String getSpecialRightJoin(ExternalDbMapTable table){
  if (language.getJoin(table.getJoinType()) == OracleLanguage.ORACLEJOIN.RIGHT_OUTER_JOIN_ORACLE) {
    return JOIN;
  }
  return DbMapSqlConstants.EMPTY;
}
Program: 123400
Project: 123400
Buggy source:
protected String getSpecialLeftJoin(ExternalDbMapTable table){
  if (language.getJoin(table.getJoinType()) == OracleLanguage.ORACLEJOIN.LEFT_OUTER_JOIN_ORACLE) {
    return JOIN + DbMapSqlConstants.SPACE;
  }
  return DbMapSqlConstants.EMPTY;
}

Fixed version (ground truth):
@Override protected String getSpecialLeftJoin(ExternalDbMapTable table){
  if (language.getJoin(table.getJoinType()) == OracleLanguage.ORACLEJOIN.LEFT_OUTER_JOIN_ORACLE) {
    return JOIN + DbMapSqlConstants.SPACE;
  }
  return DbMapSqlConstants.EMPTY;
}
Program: 123401
Project: 123401
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  super.init(viewer,selection);
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  RepositoryNode node=(RepositoryNode)selection.getFirstElement();
  if (canWork) {
    if (node.getObjectType() != ERepositoryObjectType.ROUTINES || !ProjectManager.getInstance().isInCurrentMainProject(node) || !isLastVersion(node)) {
      canWork=false;
    }
 else {
      Item item=node.getObject().getProperty().getItem();
      if (item instanceof RoutineItem) {
        canWork=!((RoutineItem)item).isBuiltIn();
      }
    }
  }
  if (canWork) {
    canWork=(factory.getStatus(node.getObject()) != ERepositoryStatus.DELETED);
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  super.init(viewer,selection);
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  RepositoryNode node=(RepositoryNode)selection.getFirstElement();
  if (canWork) {
    if (node.getObjectType() != ERepositoryObjectType.ROUTINES || !ProjectManager.getInstance().isInCurrentMainProject(node) || !isLastVersion(node)) {
      canWork=false;
    }
 else {
      Item item=node.getObject().getProperty().getItem();
      if (item instanceof RoutineItem) {
        canWork=!((RoutineItem)item).isBuiltIn();
      }
    }
  }
  if (canWork) {
    canWork=(factory.getStatus(node.getObject()) != ERepositoryStatus.DELETED);
  }
  setEnabled(canWork);
}
Program: 123402
Project: 123402
Buggy source:
protected void doRun(){
  if (repositoryNode == null) {
    repositoryNode=(RepositoryNode)((IStructuredSelection)getSelection()).getFirstElement();
  }
  RoutineItem routineItem=(RoutineItem)repositoryNode.getObject().getProperty().getItem();
  try {
    openRoutineEditor(routineItem,false);
    refresh(repositoryNode);
  }
 catch (  PartInitException e) {
    MessageBoxExceptionHandler.process(e);
  }
catch (  SystemException e) {
    MessageBoxExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
@Override protected void doRun(){
  if (repositoryNode == null) {
    repositoryNode=(RepositoryNode)((IStructuredSelection)getSelection()).getFirstElement();
  }
  RoutineItem routineItem=(RoutineItem)repositoryNode.getObject().getProperty().getItem();
  try {
    openRoutineEditor(routineItem,false);
    refresh(repositoryNode);
    CorePlugin.getDefault().getLibrariesService().resetModulesNeeded();
    CorePlugin.getDefault().getRunProcessService().updateLibraries(new HashSet<String>(),null);
  }
 catch (  PartInitException e) {
    MessageBoxExceptionHandler.process(e);
  }
catch (  SystemException e) {
    MessageBoxExceptionHandler.process(e);
  }
}
Program: 123403
Project: 123403
Buggy source:
public void modifyText(ModifyEvent e){
  checkTextError(param,labelText,labelText.getText());
}

Fixed version (ground truth):
@Override public void modifyText(ModifyEvent e){
  checkTextError(param,labelText,labelText.getText());
}
Program: 123404
Project: 123404
Buggy source:
public void propertyChange(PropertyChangeEvent evt){
}

Fixed version (ground truth):
@Override public void propertyChange(PropertyChangeEvent evt){
}
Program: 123408
Project: 123408
Buggy source:
public void codeSync(){
  IProcess2 process=getProcess();
  if (!(process.getProperty().getItem() instanceof ProcessItem)) {
    return;
  }
  ProcessItem processItem=(ProcessItem)process.getProperty().getItem();
  if (oldPageIndex == 2) {
    ParametersType parameters=processItem.getProcess().getParameters();
    if (parameters != null && parameters.getRoutinesParameter() != null && parameters.getRoutinesParameter().size() == 0) {
      try {
        List<RoutinesParameterType> dependenciesInPreference=RoutinesUtil.createDependenciesInPreference();
        parameters.getRoutinesParameter().addAll(dependenciesInPreference);
      }
 catch (      PersistenceException e) {
        ExceptionHandler.process(e);
      }
    }
  }
  try {
    boolean lastGeneratedWithStats=ProcessorUtilities.getLastGeneratedWithStats(process.getId());
    boolean lastGeneratedWithTrace=ProcessorUtilities.getLastGeneratedWithTrace(process.getId());
    if (processor.isCodeGenerated()) {
      ProcessorUtilities.generateCode(process,process.getContextManager().getDefaultContext(),lastGeneratedWithStats,lastGeneratedWithTrace,true,ProcessorUtilities.GENERATE_MAIN_ONLY);
    }
 else {
      ProcessorUtilities.generateCode(process,process.getContextManager().getDefaultContext(),lastGeneratedWithStats,lastGeneratedWithTrace,true,ProcessorUtilities.GENERATE_WITH_FIRST_CHILD);
    }
  }
 catch (  ProcessorException e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
public void codeSync(){
  IProcess2 process=getProcess();
  if (!(process.getProperty().getItem() instanceof ProcessItem)) {
    return;
  }
  ProcessItem processItem=(ProcessItem)process.getProperty().getItem();
  if (oldPageIndex == 2) {
    covertJobscriptOnPageChange();
    ParametersType parameters=processItem.getProcess().getParameters();
    if (parameters != null && parameters.getRoutinesParameter() != null && parameters.getRoutinesParameter().size() == 0) {
      try {
        List<RoutinesParameterType> dependenciesInPreference=RoutinesUtil.createDependenciesInPreference();
        parameters.getRoutinesParameter().addAll(dependenciesInPreference);
      }
 catch (      PersistenceException e) {
        ExceptionHandler.process(e);
      }
    }
  }
  try {
    boolean lastGeneratedWithStats=ProcessorUtilities.getLastGeneratedWithStats(process.getId());
    boolean lastGeneratedWithTrace=ProcessorUtilities.getLastGeneratedWithTrace(process.getId());
    if (processor.isCodeGenerated()) {
      ProcessorUtilities.generateCode(process,process.getContextManager().getDefaultContext(),lastGeneratedWithStats,lastGeneratedWithTrace,true,ProcessorUtilities.GENERATE_MAIN_ONLY);
    }
 else {
      ProcessorUtilities.generateCode(process,process.getContextManager().getDefaultContext(),lastGeneratedWithStats,lastGeneratedWithTrace,true,ProcessorUtilities.GENERATE_WITH_FIRST_CHILD);
    }
  }
 catch (  ProcessorException e) {
    ExceptionHandler.process(e);
  }
}
Program: 123416
Project: 123416
Buggy source:
public static void setParameterValue(ParametersType paType,String paramName,Object value){
  if (value == null)   return;
  EList listParamType=paType.getElementParameter();
  if (!isContains(paType,paramName)) {
    ElementParameterType etype=TalendFileFactory.eINSTANCE.createElementParameterType();
    etype.setName(paramName);
    listParamType.add(etype);
  }
  for (int j=0; j < listParamType.size(); j++) {
    ElementParameterType pType=(ElementParameterType)listParamType.get(j);
    if (pType != null && paramName.equals(pType.getName())) {
      pType.setValue(value.toString());
      return;
    }
  }
}

Fixed version (ground truth):
public static void setParameterValue(ParametersType paType,String paramName,Object value){
  if (value == null) {
    return;
  }
  EList listParamType=paType.getElementParameter();
  if (!isContains(paType,paramName)) {
    ElementParameterType etype=TalendFileFactory.eINSTANCE.createElementParameterType();
    etype.setName(paramName);
    listParamType.add(etype);
  }
  for (int j=0; j < listParamType.size(); j++) {
    ElementParameterType pType=(ElementParameterType)listParamType.get(j);
    if (pType != null && paramName.equals(pType.getName())) {
      pType.setValue(value.toString());
      return;
    }
  }
}
Program: 123417
Project: 123417
Buggy source:
private void openedByBrowser(Item item,URL url){
  if (url == null || item == null) {
    return;
  }
  WebBrowserEditor browser=new WebBrowserEditor();
  WebBrowserEditorInput input=new WebBrowserEditorInput(url);
  input.setName(item.getProperty().getLabel());
  input.setToolTipText(item.getProperty().getLabel() + "String_Node_Str" + item.getProperty().getVersion());
  browser.open(input);
}

Fixed version (ground truth):
private void openedByBrowser(Item item,URL url){
  if (url == null || item == null) {
    return;
  }
  WebBrowserEditor browser=new WebBrowserEditor();
  WebBrowserEditorInput input=new WebBrowserEditorInput(url);
  try {
    IWorkbenchPage page=getActivePage();
    IEditorReference[] iEditorReference=page.getEditorReferences();
    for (    IEditorReference editors : iEditorReference) {
      if ("String_Node_Str".equals(editors.getId())) {
        IEditorPart iEditorPart=editors.getEditor(true);
        if (iEditorPart != null && iEditorPart instanceof WebBrowserEditor) {
          WebBrowserEditorInput webBrowserEditorInput=(WebBrowserEditorInput)iEditorPart.getEditorInput();
          if (webBrowserEditorInput != null && url.equals(webBrowserEditorInput.getURL())) {
            iEditorPart.init(iEditorPart.getEditorSite(),webBrowserEditorInput);
            return;
          }
        }
      }
    }
  }
 catch (  PartInitException e) {
    MessageBoxExceptionHandler.process(e);
  }
  input.setName(item.getProperty().getLabel());
  input.setToolTipText(item.getProperty().getLabel() + "String_Node_Str" + item.getProperty().getVersion());
  browser.open(input);
}
Program: 123422
Project: 123422
Buggy source:
public void codeSync(){
  IProcess2 process=getProcess();
  if (!(process.getProperty().getItem() instanceof ProcessItem)) {
    return;
  }
  ProcessItem processItem=(ProcessItem)process.getProperty().getItem();
  if (oldPageIndex == 2) {
    ParametersType parameters=processItem.getProcess().getParameters();
    if (parameters != null && parameters.getRoutinesParameter() != null && parameters.getRoutinesParameter().size() == 0) {
      try {
        List<RoutinesParameterType> dependenciesInPreference=RoutinesUtil.createDependenciesInPreference();
        parameters.getRoutinesParameter().addAll(dependenciesInPreference);
      }
 catch (      PersistenceException e) {
        ExceptionHandler.process(e);
      }
    }
  }
  try {
    boolean lastGeneratedWithStats=ProcessorUtilities.getLastGeneratedWithStats(process.getId());
    boolean lastGeneratedWithTrace=ProcessorUtilities.getLastGeneratedWithTrace(process.getId());
    if (processor.isCodeGenerated()) {
      ProcessorUtilities.generateCode(process,process.getContextManager().getDefaultContext(),lastGeneratedWithStats,lastGeneratedWithTrace,true,ProcessorUtilities.GENERATE_MAIN_ONLY);
    }
 else {
      ProcessorUtilities.generateCode(process,process.getContextManager().getDefaultContext(),lastGeneratedWithStats,lastGeneratedWithTrace,true,ProcessorUtilities.GENERATE_WITH_FIRST_CHILD);
    }
  }
 catch (  ProcessorException e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
public void codeSync(){
  IProcess2 process=getProcess();
  if (!(process.getProperty().getItem() instanceof ProcessItem)) {
    return;
  }
  ProcessItem processItem=(ProcessItem)process.getProperty().getItem();
  if (oldPageIndex == 2) {
    covertJobscriptOnPageChange();
    ParametersType parameters=processItem.getProcess().getParameters();
    if (parameters != null && parameters.getRoutinesParameter() != null && parameters.getRoutinesParameter().size() == 0) {
      try {
        List<RoutinesParameterType> dependenciesInPreference=RoutinesUtil.createDependenciesInPreference();
        parameters.getRoutinesParameter().addAll(dependenciesInPreference);
      }
 catch (      PersistenceException e) {
        ExceptionHandler.process(e);
      }
    }
  }
  try {
    boolean lastGeneratedWithStats=ProcessorUtilities.getLastGeneratedWithStats(process.getId());
    boolean lastGeneratedWithTrace=ProcessorUtilities.getLastGeneratedWithTrace(process.getId());
    if (processor.isCodeGenerated()) {
      ProcessorUtilities.generateCode(process,process.getContextManager().getDefaultContext(),lastGeneratedWithStats,lastGeneratedWithTrace,true,ProcessorUtilities.GENERATE_MAIN_ONLY);
    }
 else {
      ProcessorUtilities.generateCode(process,process.getContextManager().getDefaultContext(),lastGeneratedWithStats,lastGeneratedWithTrace,true,ProcessorUtilities.GENERATE_WITH_FIRST_CHILD);
    }
  }
 catch (  ProcessorException e) {
    ExceptionHandler.process(e);
  }
}
Program: 123423
Project: 123423
Buggy source:
public void doubleClick(DoubleClickEvent event){
  try {
    Function function=(Function)((IStructuredSelection)event.getSelection()).getFirstElement();
    selectedFunction=function;
    if (function != null && function.getDescription() != null) {
      if (docDisplayer instanceof Text) {
        ((Text)docDisplayer).setText(function.getDescription());
      }
 else       if (docDisplayer instanceof Browser) {
        ((Browser)docDisplayer).setText(function.getDescription());
      }
      VirtualMetadataColumn column=new VirtualMetadataColumn();
      column.setTalendType(function.getTalendType().getName());
      column.setFunction(function);
      ExpressionComposite expressionComposite=ExpressionBuilderDialog.getExpressionComposite();
      expressionComposite.setExpression(FunctionManagerExt.getOneColData(column,false),true);
    }
 else {
      if (docDisplayer instanceof Text) {
        ((Text)docDisplayer).setText("String_Node_Str");
      }
 else       if (docDisplayer instanceof Browser) {
        ((Browser)docDisplayer).setText("String_Node_Str");
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void doubleClick(DoubleClickEvent event){
  try {
    Function function=(Function)((IStructuredSelection)event.getSelection()).getFirstElement();
    selectedFunction=function;
    if (function != null && function.getDescription() != null) {
      if (docDisplayer instanceof Text) {
        ((Text)docDisplayer).setText(function.getDescription());
      }
 else       if (docDisplayer instanceof Browser) {
        ((Browser)docDisplayer).setText(function.getDescription());
      }
      VirtualMetadataColumn column=new VirtualMetadataColumn();
      column.setTalendType(function.getTalendType().getName());
      column.setFunction(function);
      ExpressionComposite expressionComposite=ExpressionBuilderDialog.getExpressionComposite();
      expressionComposite.setExpression(FunctionManagerExt.getOneColData(column,false),true);
    }
 else {
      if (docDisplayer instanceof Text) {
        ((Text)docDisplayer).setText("String_Node_Str");
      }
 else       if (docDisplayer instanceof Browser) {
        ((Browser)docDisplayer).setText("String_Node_Str");
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 123424
Project: 123424
Buggy source:
public int compare(IContentProposal o1,IContentProposal o2){
  return o1.getContent().compareToIgnoreCase(o2.getContent());
}

Fixed version (ground truth):
@Override public int compare(IContentProposal o1,IContentProposal o2){
  return o1.getContent().compareToIgnoreCase(o2.getContent());
}
Program: 123425
Project: 123425
Buggy source:
public void dragStart(DragSourceEvent event){
  if (functionList.getSelection().equals("String_Node_Str"))   event.doit=false;
}

Fixed version (ground truth):
@Override public void dragStart(DragSourceEvent event){
  if (functionList.getSelection().equals("String_Node_Str")) {
    event.doit=false;
  }
}
Program: 123426
Project: 123426
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  Function function=(Function)((IStructuredSelection)event.getSelection()).getFirstElement();
  if (function != null && function.getDescription() != null) {
    if (docDisplayer instanceof Text) {
      ((Text)docDisplayer).setText(function.getDescription());
    }
 else     if (docDisplayer instanceof Browser) {
      ((Browser)docDisplayer).setText(function.getDescription());
    }
  }
 else {
    if (docDisplayer instanceof Text) {
      ((Text)docDisplayer).setText("String_Node_Str");
    }
 else     if (docDisplayer instanceof Browser) {
      ((Browser)docDisplayer).setText("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void selectionChanged(SelectionChangedEvent event){
  Function function=(Function)((IStructuredSelection)event.getSelection()).getFirstElement();
  if (function != null && function.getDescription() != null) {
    if (docDisplayer instanceof Text) {
      ((Text)docDisplayer).setText(function.getDescription());
    }
 else     if (docDisplayer instanceof Browser) {
      ((Browser)docDisplayer).setText(function.getDescription());
    }
  }
 else {
    if (docDisplayer instanceof Text) {
      ((Text)docDisplayer).setText("String_Node_Str");
    }
 else     if (docDisplayer instanceof Browser) {
      ((Browser)docDisplayer).setText("String_Node_Str");
    }
  }
}
Program: 123428
Project: 123428
Buggy source:
public void dragSetData(DragSourceEvent event){
  if (textTransfer.isSupportedType(event.dataType)) {
    Function function=(Function)((IStructuredSelection)functionViewer.getSelection()).getFirstElement();
    VirtualMetadataColumn column=new VirtualMetadataColumn();
    column.setTalendType(function.getTalendType().getName());
    column.setFunction(function);
    event.data=(FunctionManagerExt.getOneColData(column,false));
  }
}

Fixed version (ground truth):
@Override public void dragSetData(DragSourceEvent event){
  if (textTransfer.isSupportedType(event.dataType)) {
    Function function=(Function)((IStructuredSelection)functionViewer.getSelection()).getFirstElement();
    VirtualMetadataColumn column=new VirtualMetadataColumn();
    column.setTalendType(function.getTalendType().getName());
    column.setFunction(function);
    event.data=(FunctionManagerExt.getOneColData(column,false));
  }
}
Program: 123429
Project: 123429
Buggy source:
public void dragFinished(DragSourceEvent event){
}

Fixed version (ground truth):
@Override public void dragFinished(DragSourceEvent event){
}
Program: 123443
Project: 123443
Buggy source:
@Override public ExecutionResult execute(Item item){
  ConnectionItem connectionItem=(ConnectionItem)item;
  DatabaseConnection connection=(DatabaseConnection)connectionItem.getConnection();
  if (connection.getDatabaseType().equals("String_Node_Str")) {
    if (connection.getDbVersionString() != null && connection.getDbVersionString().equals(NOTEXIST)) {
      connection.setDbVersionString(EXIST);
      try {
        ProxyRepositoryFactory.getInstance().save(item);
      }
 catch (      PersistenceException e) {
        ExceptionHandler.process(e);
        return ExecutionResult.FAILURE;
      }
      return ExecutionResult.SUCCESS_NO_ALERT;
    }
  }
 else {
    return ExecutionResult.NOTHING_TO_DO;
  }
  return ExecutionResult.NOTHING_TO_DO;
}

Fixed version (ground truth):
@Override public ExecutionResult execute(Item item){
  ConnectionItem connectionItem=(ConnectionItem)item;
  DatabaseConnection connection=(DatabaseConnection)connectionItem.getConnection();
  if (connection != null) {
    if (connection.getDatabaseType().equals("String_Node_Str")) {
      if (connection.getDbVersionString() != null && connection.getDbVersionString().equals(NOTEXIST)) {
        connection.setDbVersionString(EXIST);
        try {
          ProxyRepositoryFactory.getInstance().save(item);
        }
 catch (        PersistenceException e) {
          ExceptionHandler.process(e);
          return ExecutionResult.FAILURE;
        }
        return ExecutionResult.SUCCESS_NO_ALERT;
      }
    }
 else {
      return ExecutionResult.NOTHING_TO_DO;
    }
  }
  return ExecutionResult.NOTHING_TO_DO;
}
Program: 123449
Project: 123449
Buggy source:
public DbGenerationManager getGenerationManager(){
  if (generationManager == null) {
    IElementParameter elementParameter=getElementParameter("String_Node_Str");
    String value=(String)elementParameter.getValue();
    if (value.contains("String_Node_Str")) {
      generationManager=new TeradataGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new OracleGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new MysqlGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new PostgresGenerationManager();
    }
 else     if (value.contains("String_Node_Str") || value.contains("String_Node_Str") || value.contains("String_Node_Str")) {
      generationManager=new GenericDbGenerationManager();
    }
 else {
      throw new IllegalArgumentException(Messages.getString("String_Node_Str") + value);
    }
  }
  return generationManager;
}

Fixed version (ground truth):
public DbGenerationManager getGenerationManager(){
  if (generationManager == null) {
    IElementParameter elementParameter=getElementParameter("String_Node_Str");
    String value=(String)elementParameter.getValue();
    if (value.contains("String_Node_Str")) {
      generationManager=new TeradataGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new OracleGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new MysqlGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new PostgresGenerationManager();
    }
 else     if (value.contains("String_Node_Str") || value.contains("String_Node_Str") || value.contains("String_Node_Str")|| value.contains("String_Node_Str")) {
      generationManager=new GenericDbGenerationManager();
    }
 else {
      throw new IllegalArgumentException(Messages.getString("String_Node_Str") + value);
    }
  }
  return generationManager;
}
Program: 123461
Project: 123461
Buggy source:
public DbGenerationManager getGenerationManager(){
  if (generationManager == null) {
    IElementParameter elementParameter=getElementParameter("String_Node_Str");
    String value=(String)elementParameter.getValue();
    if (value.contains("String_Node_Str")) {
      generationManager=new TeradataGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new OracleGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new MysqlGenerationManager();
    }
 else     if (value.contains("String_Node_Str") || value.contains("String_Node_Str") || value.contains("String_Node_Str")|| value.contains("String_Node_Str")) {
      generationManager=new GenericDbGenerationManager();
    }
 else {
      throw new IllegalArgumentException(Messages.getString("String_Node_Str") + value);
    }
  }
  return generationManager;
}

Fixed version (ground truth):
public DbGenerationManager getGenerationManager(){
  if (generationManager == null) {
    IElementParameter elementParameter=getElementParameter("String_Node_Str");
    String value=(String)elementParameter.getValue();
    if (value.contains("String_Node_Str")) {
      generationManager=new TeradataGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new OracleGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new MysqlGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new PostgresGenerationManager();
    }
 else     if (value.contains("String_Node_Str") || value.contains("String_Node_Str") || value.contains("String_Node_Str")) {
      generationManager=new GenericDbGenerationManager();
    }
 else {
      throw new IllegalArgumentException(Messages.getString("String_Node_Str") + value);
    }
  }
  return generationManager;
}
Program: 123462
Project: 123462
Buggy source:
private String handleQuery(String query){
  if (query != null) {
    if (!query.trim().endsWith("String_Node_Str")) {
      query=query + "String_Node_Str";
    }
 else {
      if (query.trim().endsWith("String_Node_Str")) {
        query=query.substring(0,query.lastIndexOf("String_Node_Str"));
      }
    }
  }
  return query;
}

Fixed version (ground truth):
private String handleQuery(String query){
  if (query != null) {
    if (!query.trim().endsWith("String_Node_Str")) {
      query=query + "String_Node_Str";
    }
 else     if (isPostgres() && query.trim().endsWith("String_Node_Str")) {
      query=query + "String_Node_Str";
    }
 else {
      if (query.trim().endsWith("String_Node_Str")) {
        query=query.substring(0,query.lastIndexOf("String_Node_Str"));
      }
    }
  }
  return query;
}
Program: 123467
Project: 123467
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  super.init(viewer,selection);
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  RepositoryNode node=(RepositoryNode)selection.getFirstElement();
  if (canWork) {
    if (node.getObjectType() != ERepositoryObjectType.ROUTINES || !ProjectManager.getInstance().isInCurrentMainProject(node) || !isLastVersion(node)) {
      canWork=false;
    }
 else {
      Item item=node.getObject().getProperty().getItem();
      if (item instanceof RoutineItem) {
        canWork=!((RoutineItem)item).isBuiltIn();
      }
    }
  }
  if (canWork) {
    canWork=(factory.getStatus(node.getObject()) != ERepositoryStatus.DELETED);
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  super.init(viewer,selection);
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  RepositoryNode node=(RepositoryNode)selection.getFirstElement();
  if (canWork) {
    if (node.getObjectType() != ERepositoryObjectType.ROUTINES || !ProjectManager.getInstance().isInCurrentMainProject(node) || !isLastVersion(node)) {
      canWork=false;
    }
 else {
      Item item=node.getObject().getProperty().getItem();
      if (item instanceof RoutineItem) {
        canWork=!((RoutineItem)item).isBuiltIn();
      }
    }
  }
  if (canWork) {
    canWork=(factory.getStatus(node.getObject()) != ERepositoryStatus.DELETED);
  }
  setEnabled(canWork);
}
Program: 123468
Project: 123468
Buggy source:
protected void doRun(){
  if (repositoryNode == null) {
    repositoryNode=(RepositoryNode)((IStructuredSelection)getSelection()).getFirstElement();
  }
  RoutineItem routineItem=(RoutineItem)repositoryNode.getObject().getProperty().getItem();
  try {
    openRoutineEditor(routineItem,false);
    refresh(repositoryNode);
  }
 catch (  PartInitException e) {
    MessageBoxExceptionHandler.process(e);
  }
catch (  SystemException e) {
    MessageBoxExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
@Override protected void doRun(){
  if (repositoryNode == null) {
    repositoryNode=(RepositoryNode)((IStructuredSelection)getSelection()).getFirstElement();
  }
  RoutineItem routineItem=(RoutineItem)repositoryNode.getObject().getProperty().getItem();
  try {
    openRoutineEditor(routineItem,false);
    refresh(repositoryNode);
    CorePlugin.getDefault().getLibrariesService().resetModulesNeeded();
    CorePlugin.getDefault().getRunProcessService().updateLibraries(new HashSet<String>(),null);
  }
 catch (  PartInitException e) {
    MessageBoxExceptionHandler.process(e);
  }
catch (  SystemException e) {
    MessageBoxExceptionHandler.process(e);
  }
}
Program: 123469
Project: 123469
Buggy source:
protected void doRun(){
  if (repositoryNode == null) {
    repositoryNode=(RepositoryNode)((IStructuredSelection)getSelection()).getFirstElement();
  }
  RoutineItem routineItem=(RoutineItem)repositoryNode.getObject().getProperty().getItem();
  try {
    openRoutineEditor(routineItem,false);
    refresh(repositoryNode);
    CorePlugin.getDefault().getRunProcessService().updateLibraries(new HashSet<String>(),null);
  }
 catch (  PartInitException e) {
    MessageBoxExceptionHandler.process(e);
  }
catch (  SystemException e) {
    MessageBoxExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
protected void doRun(){
  if (repositoryNode == null) {
    repositoryNode=(RepositoryNode)((IStructuredSelection)getSelection()).getFirstElement();
  }
  RoutineItem routineItem=(RoutineItem)repositoryNode.getObject().getProperty().getItem();
  try {
    openRoutineEditor(routineItem,false);
    refresh(repositoryNode);
    CorePlugin.getDefault().getLibrariesService().resetModulesNeeded();
    CorePlugin.getDefault().getRunProcessService().updateLibraries(new HashSet<String>(),null);
  }
 catch (  PartInitException e) {
    MessageBoxExceptionHandler.process(e);
  }
catch (  SystemException e) {
    MessageBoxExceptionHandler.process(e);
  }
}
Program: 123470
Project: 123470
Buggy source:
public DbGenerationManager getGenerationManager(){
  if (generationManager == null) {
    IElementParameter elementParameter=getElementParameter("String_Node_Str");
    String value=(String)elementParameter.getValue();
    if (value.contains("String_Node_Str")) {
      generationManager=new TeradataGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new OracleGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new MysqlGenerationManager();
    }
 else     if (value.contains("String_Node_Str") || value.contains("String_Node_Str") || value.contains("String_Node_Str")|| value.contains("String_Node_Str")) {
      generationManager=new GenericDbGenerationManager();
    }
 else {
      throw new IllegalArgumentException(Messages.getString("String_Node_Str") + value);
    }
  }
  return generationManager;
}

Fixed version (ground truth):
public DbGenerationManager getGenerationManager(){
  if (generationManager == null) {
    IElementParameter elementParameter=getElementParameter("String_Node_Str");
    String value=(String)elementParameter.getValue();
    if (value.contains("String_Node_Str")) {
      generationManager=new TeradataGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new OracleGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new MysqlGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new PostgresGenerationManager();
    }
 else     if (value.contains("String_Node_Str") || value.contains("String_Node_Str") || value.contains("String_Node_Str")) {
      generationManager=new GenericDbGenerationManager();
    }
 else {
      throw new IllegalArgumentException(Messages.getString("String_Node_Str") + value);
    }
  }
  return generationManager;
}
Program: 123471
Project: 123471
Buggy source:
private String handleQuery(String query){
  if (query != null) {
    if (!query.trim().endsWith("String_Node_Str")) {
      query=query + "String_Node_Str";
    }
 else {
      if (query.trim().endsWith("String_Node_Str")) {
        query=query.substring(0,query.lastIndexOf("String_Node_Str"));
      }
    }
  }
  return query;
}

Fixed version (ground truth):
private String handleQuery(String query){
  if (query != null) {
    if (!query.trim().endsWith("String_Node_Str")) {
      query=query + "String_Node_Str";
    }
 else     if (isPostgres() && query.trim().endsWith("String_Node_Str")) {
      query=query + "String_Node_Str";
    }
 else {
      if (query.trim().endsWith("String_Node_Str")) {
        query=query.substring(0,query.lastIndexOf("String_Node_Str"));
      }
    }
  }
  return query;
}
Program: 123479
Project: 123479
Buggy source:
@Override public Control createControl(Composite subComposite,IElementParameter param,int numInRow,int nbInRow,int top,Control lastControl){
  Control lastControlUsed=lastControl;
  lastControlUsed=super.createControl(subComposite,param,numInRow,nbInRow,top,lastControl);
  if (EmfComponent.BUILTIN.equals(param.getChildParameters().get("String_Node_Str").getValue())) {
    if (param.getElement() instanceof INode) {
      if (canSaveProperty(param)) {
        lastControlUsed=addButton(subComposite,param,lastControlUsed,numInRow,top);
      }
    }
  }
  return lastControlUsed;
}

Fixed version (ground truth):
@Override public Control createControl(Composite subComposite,IElementParameter param,int numInRow,int nbInRow,int top,Control lastControl){
  Control lastControlUsed=lastControl;
  lastControlUsed=super.createControl(subComposite,param,numInRow,nbInRow,top,lastControl);
  if (EmfComponent.BUILTIN.equals(param.getChildParameters().get("String_Node_Str").getValue())) {
    if (param.getElement() instanceof INode) {
      if (canSaveProperty(param)) {
        lastControlUsed=addButton(subComposite,param,lastControlUsed,numInRow,top);
      }
    }
  }
  if (EmfComponent.REPOSITORY.equals(param.getChildParameters().get("String_Node_Str").getValue())) {
    if (param.getElement() != null && param.getElement() instanceof INode) {
      INode node=(INode)param.getElement();
      if (node != null && "String_Node_Str".equals(node.getComponent().getName())) {
        IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
        IElementParameter repositoryParam=param.getChildParameters().get(EParameterName.REPOSITORY_PROPERTY_TYPE.getName());
        String connectionLastSelected=(String)repositoryParam.getValue();
        try {
          if (!StringUtils.isEmpty(connectionLastSelected)) {
            IRepositoryViewObject repobj=factory.getLastVersion(connectionLastSelected);
            if (repobj != null && repobj.getProperty() != null) {
              Item item=repobj.getProperty().getItem();
              if (item != null && item instanceof MDMConnectionItem) {
                Connection connection=((MDMConnectionItem)item).getConnection();
                if (connection != null && connection instanceof MDMConnection) {
                  oldMdmConValues.clear();
                  oldMdmConValues.put("String_Node_Str",((MDMConnection)connection).getUsername());
                  oldMdmConValues.put("String_Node_Str",((MDMConnection)connection).getPassword());
                  oldMdmConValues.put("String_Node_Str",((MDMConnection)connection).getServer());
                  oldMdmConValues.put("String_Node_Str",((MDMConnection)connection).getPort());
                }
              }
            }
          }
        }
 catch (        PersistenceException e) {
          ExceptionHandler.process(e);
        }
      }
    }
  }
  return lastControlUsed;
}
Program: 123485
Project: 123485
Buggy source:
protected void doRun(){
  if (repositoryNode == null) {
    repositoryNode=(RepositoryNode)((IStructuredSelection)getSelection()).getFirstElement();
  }
  RoutineItem routineItem=(RoutineItem)repositoryNode.getObject().getProperty().getItem();
  try {
    openRoutineEditor(routineItem,false);
    refresh(repositoryNode);
  }
 catch (  PartInitException e) {
    MessageBoxExceptionHandler.process(e);
  }
catch (  SystemException e) {
    MessageBoxExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
protected void doRun(){
  if (repositoryNode == null) {
    repositoryNode=(RepositoryNode)((IStructuredSelection)getSelection()).getFirstElement();
  }
  RoutineItem routineItem=(RoutineItem)repositoryNode.getObject().getProperty().getItem();
  try {
    openRoutineEditor(routineItem,false);
    refresh(repositoryNode);
    CorePlugin.getDefault().getRunProcessService().updateLibraries(new HashSet<String>(),null);
  }
 catch (  PartInitException e) {
    MessageBoxExceptionHandler.process(e);
  }
catch (  SystemException e) {
    MessageBoxExceptionHandler.process(e);
  }
}
Program: 123495
Project: 123495
Buggy source:
public void prepareXlsxFile(String fileName) throws Exception {
  File xlsxFile=new File(fileName);
  if (xlsxFile.exists()) {
    if (isAbsY && keepCellFormat) {
      initPreXlsx(fileName);
    }
    InputStream inp=new FileInputStream(fileName);
    wb=WorkbookFactory.create(inp);
    if (appendWorkbook) {
      sheet=wb.getSheet(sheetName);
      if (sheet != null) {
        if (appendSheet) {
          curY=sheet.getLastRowNum() + 1;
        }
 else {
          wb.removeSheetAt(wb.getSheetIndex(sheetName));
          sheet=wb.createSheet(sheetName);
        }
      }
 else {
        sheet=wb.createSheet(sheetName);
      }
    }
 else {
      for (int i=wb.getNumberOfSheets() - 1; i >= 0; i--) {
        wb.removeSheetAt(i);
      }
      sheet=wb.createSheet(sheetName);
    }
  }
 else {
    wb=new SXSSFWorkbook(rowAccessWindowSize);
    sheet=wb.createSheet(sheetName);
  }
  if (isAbsY) {
    startX=absX;
    curY=absY;
  }
}

Fixed version (ground truth):
public void prepareXlsxFile(String fileName) throws Exception {
  File xlsxFile=new File(fileName);
  if (xlsxFile.exists()) {
    if (isAbsY && keepCellFormat) {
      initPreXlsx(fileName);
    }
    if (appendWorkbook) {
      InputStream inp=new FileInputStream(fileName);
      wb=WorkbookFactory.create(inp);
      sheet=wb.getSheet(sheetName);
      if (sheet != null) {
        if (appendSheet) {
          curY=sheet.getLastRowNum() + 1;
        }
 else {
          wb.removeSheetAt(wb.getSheetIndex(sheetName));
          sheet=wb.createSheet(sheetName);
        }
      }
 else {
        sheet=wb.createSheet(sheetName);
      }
    }
 else {
      xlsxFile.delete();
      wb=new SXSSFWorkbook(rowAccessWindowSize);
      sheet=wb.createSheet(sheetName);
    }
  }
 else {
    wb=new SXSSFWorkbook(rowAccessWindowSize);
    sheet=wb.createSheet(sheetName);
  }
  if (isAbsY) {
    startX=absX;
    curY=absY;
  }
}