nus-yam/ex-repair huggingface dataset:
Program: 127820
Project: 127820
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public void setLabel(String newLabel){
  String oldLabel=label;
  label=newLabel;
  setName(newLabel);
  if (eNotificationRequired()) {
    eNotify(new ENotificationImpl(this,Notification.SET,ConnectionPackage.ABSTRACT_METADATA_OBJECT__LABEL,oldLabel,label));
  }
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public void setLabel(String newLabel){
  String oldLabel=label;
  label=newLabel;
  if (!StringUtils.isEmpty(newLabel)) {
    setName(newLabel);
  }
  if (eNotificationRequired()) {
    eNotify(new ENotificationImpl(this,Notification.SET,ConnectionPackage.ABSTRACT_METADATA_OBJECT__LABEL,oldLabel,label));
  }
}
Program: 127821
Project: 127821
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public void setLabel(String newLabel){
  String oldLabel=label;
  label=newLabel;
  setName(newLabel);
  if (eNotificationRequired()) {
    eNotify(new ENotificationImpl(this,Notification.SET,ConnectionPackage.ABSTRACT_METADATA_OBJECT__LABEL,oldLabel,label));
  }
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public void setLabel(String newLabel){
  String oldLabel=label;
  label=newLabel;
  if (!StringUtils.isEmpty(newLabel)) {
    setName(newLabel);
  }
  if (eNotificationRequired()) {
    eNotify(new ENotificationImpl(this,Notification.SET,ConnectionPackage.ABSTRACT_METADATA_OBJECT__LABEL,oldLabel,label));
  }
}
Program: 127822
Project: 127822
Buggy source:
private TableEditor addTableEditor(TableViewerCreatorColumnNotModifiable column,TableEditorContentNotModifiable tableEditorContent,String idProperty,TableItem tableItem){
  if (tableItem.getData() == null) {
    return null;
  }
  tableEditorContent.setLayoutEnabled(true);
  TableEditor tableEditor=tableEditorContent.createTableEditor(tableItem.getParent());
  tableEditorList.add(tableEditor);
  dataToMultipleDataEditor.put(tableItem.getData(),tableEditor);
  Object currentRowObject=tableItem.getData();
  Object value=null;
  if (column.getBeanPropertyAccessors() != null) {
    value=column.getBeanPropertyAccessors().get(tableItem.getData());
  }
 else {
    value=tableViewerCreator.getCellModifier().getValue(currentRowObject,idProperty);
  }
  Control control=tableEditorContent.initialize(tableItem.getParent(),tableEditor,column,currentRowObject,value);
  if (tableItem != null && !tableItem.isDisposed()) {
    tableEditor.setEditor(control,tableItem,column.getIndex());
    fireEvent(new TableEditorManagerEvent(EVENT_TYPE.CONTROL_CREATED,tableEditor));
  }
  return tableEditor;
}

Fixed version (ground truth):
private TableEditor addTableEditor(TableViewerCreatorColumnNotModifiable column,TableEditorContentNotModifiable tableEditorContent,String idProperty,TableItem tableItem){
  if (tableItem.getData() == null) {
    return null;
  }
  if (tableEditorContent == null) {
    return null;
  }
  tableEditorContent.setLayoutEnabled(true);
  TableEditor tableEditor=tableEditorContent.createTableEditor(tableItem.getParent());
  tableEditorList.add(tableEditor);
  dataToMultipleDataEditor.put(tableItem.getData(),tableEditor);
  Object currentRowObject=tableItem.getData();
  Object value=null;
  if (column.getBeanPropertyAccessors() != null) {
    value=column.getBeanPropertyAccessors().get(tableItem.getData());
  }
 else {
    value=tableViewerCreator.getCellModifier().getValue(currentRowObject,idProperty);
  }
  Control control=tableEditorContent.initialize(tableItem.getParent(),tableEditor,column,currentRowObject,value);
  if (tableItem != null && !tableItem.isDisposed()) {
    tableEditor.setEditor(control,tableItem,column.getIndex());
    fireEvent(new TableEditorManagerEvent(EVENT_TYPE.CONTROL_CREATED,tableEditor));
  }
  return tableEditor;
}
Program: 127823
Project: 127823
Buggy source:
@Override public void updateChildCount(Object element,int currentChildCount){
  int length=0;
  if (element instanceof ATreeNode) {
    ATreeNode node=(ATreeNode)element;
    length=node.getChildren().length;
  }
 else   if (element == elements) {
    length=elements.length;
  }
  viewer.setChildCount(element,length);
}

Fixed version (ground truth):
@Override public void updateChildCount(Object element,int currentChildCount){
  int length=0;
  if (element instanceof ATreeNode) {
    ATreeNode node=(ATreeNode)element;
    length=node.getChildren().length;
  }
 else   if (element == elements) {
    length=elements.length;
  }
  if (length != currentChildCount) {
    viewer.setChildCount(element,length);
  }
}
Program: 127825
Project: 127825
Buggy source:
@Override public void installModules(String[] jarNames){
  Shell shell=PlatformUI.getWorkbench().getDisplay().getActiveShell();
  ModulesInstaller.installModules(new Shell(shell),jarNames);
}

Fixed version (ground truth):
@Override public void installModules(final String[] jarNames){
  PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable(){
    @Override public void run(){
      Shell shell=PlatformUI.getWorkbench().getDisplay().getActiveShell();
      ModulesInstaller.installModules(new Shell(shell),jarNames);
    }
  }
);
}
Program: 127827
Project: 127827
Buggy source:
/** 
 * DOC qwei Comment method "saveProjectf".
 * @param author
 * @param prj
 * @param project
 * @throws PersistenceException
 */
private void saveProject(IProject prj,Project project) throws PersistenceException {
  Resource projectResource=xmiResourceManager.createProjectResource(prj);
  projectResource.getContents().add(project.getEmfProject());
  projectResource.getContents().add(project.getAuthor());
  projectResource.getContents().add(project.getExchangeUser());
  xmiResourceManager.saveResource(projectResource);
}

Fixed version (ground truth):
/** 
 * DOC qwei Comment method "saveProjectf".
 * @param author
 * @param prj
 * @param project
 * @throws PersistenceException
 */
private void saveProject(IProject prj,Project project) throws PersistenceException {
  Resource projectResource=xmiResourceManager.createProjectResource(prj);
  projectResource.getContents().add(project.getEmfProject());
  projectResource.getContents().add(project.getAuthor());
  xmiResourceManager.saveResource(projectResource);
}
Program: 127828
Project: 127828
Buggy source:
public StartingBrowser(){
}

Fixed version (ground truth):
public StartingBrowser(){
  Image[] images=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getImages();
  if (images.length > 0) {
    this.setTitleImage(images[0]);
  }
}
Program: 127829
Project: 127829
Buggy source:
public StartingBrowser(){
}

Fixed version (ground truth):
public StartingBrowser(){
  Image[] images=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getImages();
  if (images.length > 0) {
    this.setTitleImage(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getImages()[0]);
  }
}
Program: 127830
Project: 127830
Buggy source:
@Override public void create(Project project,Item item,IPath path,boolean... isImportItem) throws PersistenceException {
  boolean isOherProcess=false;
  for (  IRepositoryContentHandler handler : RepositoryContentManager.getHandlers()) {
    isOherProcess=handler.isProcess(item);
    if (isOherProcess) {
      break;
    }
  }
  if (isOherProcess || item instanceof ProcessItem) {
    try {
      coreService.checkJob(item.getProperty().getLabel());
    }
 catch (    BusinessException e) {
      throw new PersistenceException(e);
    }
catch (    RuntimeException e) {
    }
  }
  checkFileNameAndPath(project,item,RepositoryConstants.getPattern(ERepositoryObjectType.getItemType(item)),path,false,isImportItem);
  this.repositoryFactoryFromProvider.create(project,item,path,isImportItem);
  if (isImportItem.length == 0) {
    fireRepositoryPropertyChange(ERepositoryActionName.CREATE.getName(),null,item);
  }
  if (isImportItem.length > 0 && item instanceof ProcessItem) {
    fireRepositoryPropertyChange(ERepositoryActionName.IMPORT.getName(),null,item);
  }
}

Fixed version (ground truth):
@Override public void create(Project project,Item item,IPath path,boolean... isImportItem) throws PersistenceException {
  boolean isOherProcess=false;
  for (  IRepositoryContentHandler handler : RepositoryContentManager.getHandlers()) {
    isOherProcess=handler.isProcess(item);
    if (isOherProcess) {
      break;
    }
  }
  if (isOherProcess || item instanceof ProcessItem) {
    try {
      coreService.checkJob(item.getProperty().getLabel());
    }
 catch (    BusinessException e) {
      throw new PersistenceException(e);
    }
catch (    RuntimeException e) {
    }
  }
  checkFileNameAndPath(project,item,RepositoryConstants.getPattern(ERepositoryObjectType.getItemType(item)),path,false,isImportItem);
  this.repositoryFactoryFromProvider.create(project,item,path,isImportItem);
  if (isImportItem.length == 0) {
    fireRepositoryPropertyChange(ERepositoryActionName.CREATE.getName(),null,item);
  }
  if (isImportItem.length > 0 && isImportItem[0]) {
    fireRepositoryPropertyChange(ERepositoryActionName.IMPORT.getName(),null,item);
  }
}
Program: 127831
Project: 127831
Buggy source:
public StartingBrowser(){
}

Fixed version (ground truth):
public StartingBrowser(){
  Image[] images=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getImages();
  if (images.length > 0) {
    this.setTitleImage(images[0]);
  }
}
Program: 127832
Project: 127832
Buggy source:
@Override public void create(Project project,Item item,IPath path,boolean... isImportItem) throws PersistenceException {
  boolean isOherProcess=false;
  for (  IRepositoryContentHandler handler : RepositoryContentManager.getHandlers()) {
    isOherProcess=handler.isProcess(item);
    if (isOherProcess) {
      break;
    }
  }
  if (isOherProcess || item instanceof ProcessItem) {
    try {
      coreService.checkJob(item.getProperty().getLabel());
    }
 catch (    BusinessException e) {
      throw new PersistenceException(e);
    }
catch (    RuntimeException e) {
    }
  }
  checkFileNameAndPath(project,item,RepositoryConstants.getPattern(ERepositoryObjectType.getItemType(item)),path,false,isImportItem);
  this.repositoryFactoryFromProvider.create(project,item,path,isImportItem);
  if (isImportItem.length == 0) {
    fireRepositoryPropertyChange(ERepositoryActionName.CREATE.getName(),null,item);
  }
}

Fixed version (ground truth):
@Override public void create(Project project,Item item,IPath path,boolean... isImportItem) throws PersistenceException {
  boolean isOherProcess=false;
  for (  IRepositoryContentHandler handler : RepositoryContentManager.getHandlers()) {
    isOherProcess=handler.isProcess(item);
    if (isOherProcess) {
      break;
    }
  }
  if (isOherProcess || item instanceof ProcessItem) {
    try {
      coreService.checkJob(item.getProperty().getLabel());
    }
 catch (    BusinessException e) {
      throw new PersistenceException(e);
    }
catch (    RuntimeException e) {
    }
  }
  checkFileNameAndPath(project,item,RepositoryConstants.getPattern(ERepositoryObjectType.getItemType(item)),path,false,isImportItem);
  this.repositoryFactoryFromProvider.create(project,item,path,isImportItem);
  if (isImportItem.length == 0) {
    fireRepositoryPropertyChange(ERepositoryActionName.CREATE.getName(),null,item);
  }
  if (isImportItem.length > 0 && item instanceof ProcessItem) {
    fireRepositoryPropertyChange(ERepositoryActionName.IMPORT.getName(),null,item);
  }
}
Program: 127838
Project: 127838
Buggy source:
public void removeHadoopDbParameters(DatabaseConnection connection);

Fixed version (ground truth):
/** 
 * DOC ycbai Comment method "removeHadoopDbParameters".
 * @param connection
 */
public void removeHadoopDbParameters(DatabaseConnection connection);
Program: 127839
Project: 127839
Buggy source:
@Override public void create(Project project,Item item,IPath path,boolean... isImportItem) throws PersistenceException {
  boolean isOherProcess=false;
  for (  IRepositoryContentHandler handler : RepositoryContentManager.getHandlers()) {
    isOherProcess=handler.isProcess(item);
    if (isOherProcess) {
      break;
    }
  }
  if (isOherProcess || item instanceof ProcessItem) {
    try {
      coreService.checkJob(item.getProperty().getLabel());
    }
 catch (    BusinessException e) {
      throw new PersistenceException(e);
    }
catch (    RuntimeException e) {
    }
  }
  checkFileNameAndPath(project,item,RepositoryConstants.getPattern(ERepositoryObjectType.getItemType(item)),path,false,isImportItem);
  this.repositoryFactoryFromProvider.create(project,item,path,isImportItem);
  if (isImportItem.length == 0) {
    fireRepositoryPropertyChange(ERepositoryActionName.CREATE.getName(),null,item);
  }
  if (isImportItem.length > 0 && isImportItem[0]) {
    fireRepositoryPropertyChange(ERepositoryActionName.IMPORT.getName(),null,item);
  }
}

Fixed version (ground truth):
@Override public void create(Project project,Item item,IPath path,boolean... isImportItem) throws PersistenceException {
  boolean isOherProcess=false;
  for (  IRepositoryContentHandler handler : RepositoryContentManager.getHandlers()) {
    isOherProcess=handler.isProcess(item);
    if (isOherProcess) {
      break;
    }
  }
  if (isOherProcess || item instanceof ProcessItem) {
    try {
      coreService.checkJob(item.getProperty().getLabel());
    }
 catch (    BusinessException e) {
      throw new PersistenceException(e);
    }
catch (    RuntimeException e) {
    }
  }
  checkFileNameAndPath(project,item,RepositoryConstants.getPattern(ERepositoryObjectType.getItemType(item)),path,false,isImportItem);
  this.repositoryFactoryFromProvider.create(project,item,path,isImportItem);
  if (isImportItem.length == 0 || !isImportItem[0]) {
    fireRepositoryPropertyChange(ERepositoryActionName.CREATE.getName(),null,item);
  }
  if (isImportItem.length > 0 && isImportItem[0]) {
    fireRepositoryPropertyChange(ERepositoryActionName.IMPORT.getName(),null,item);
  }
}
Program: 127841
Project: 127841
Buggy source:
public void handleEvent(ModifiedBeanEvent<IMetadataColumn> event){
  if ((inputMetaTable != null) && outputMetaTable.isReadOnly() && outputNode.getComponent().isSchemaAutoPropagated()) {
    MetadataToolHelper.copyTable(inputMetaTable,outputMetaTable);
    outputMetaView.getTableViewerCreator().refresh();
  }
  if (AbstractMetadataTableEditorView.ID_COLUMN_NAME.equals(event.column.getId())) {
    IMetadataColumn modifiedObject=event.bean;
    if (modifiedObject != null) {
      String originalLabel=changedNameColumns.get(modifiedObject);
      if (originalLabel == null) {
        changedNameColumns.put(modifiedObject,(String)event.previousValue);
        changeNameInColumns.put(modifiedObject.getLabel(),(String)event.previousValue);
      }
    }
  }
  if (AbstractMetadataTableEditorView.ID_COLUMN_USEFUL.equals(event.column.getId())) {
    isUsefulChange=true;
  }
}

Fixed version (ground truth):
@Override public void handleEvent(ModifiedBeanEvent<IMetadataColumn> event){
  if ((inputMetaTable != null) && outputMetaTable.isReadOnly() && outputNode.getComponent().isSchemaAutoPropagated()) {
    MetadataToolHelper.copyTable(inputMetaTable,outputMetaTable);
    outputMetaView.getTableViewerCreator().refresh();
  }
  if (AbstractMetadataTableEditorView.ID_COLUMN_NAME.equals(event.column.getId())) {
    IMetadataColumn modifiedObject=event.bean;
    if (modifiedObject != null) {
      String originalLabel=changedNameColumns.get(modifiedObject);
      if (originalLabel == null) {
        changedNameColumns.put(modifiedObject,(String)event.previousValue);
        changeNameInColumns.put(modifiedObject.getLabel(),(String)event.previousValue);
      }
    }
  }
  if (AbstractMetadataTableEditorView.ID_COLUMN_USEFUL.equals(event.column.getId())) {
    isUsefulChange=true;
  }
}
Program: 127843
Project: 127843
Buggy source:
public void widgetSelected(SelectionEvent e){
  CTabFolder source=(CTabFolder)e.getSource();
  CTabItem tabItem=source.getSelection();
  inputNode=(INode)tabItem.getData(INPUTNODE_KEY);
  inputMetaTable=(IMetadataTable)tabItem.getData(INPUTMETATABLE_KEY);
  inputMetaView=(MetadataTableEditorView)tabItem.getData(INPUTMETAVIEW_KEY);
  inputFamily=inputNode.getComponent().getOriginalFamilyName();
  inputReadOnly=(Boolean)tabItem.getData(INPUTREADONLY_KEY);
  if (inputReadOnly || inputMetaTable.isReadOnly()) {
    copyToInput.setEnabled(false);
    copySelectionToInput.setEnabled(false);
  }
 else {
    copyToInput.setEnabled(true);
    copySelectionToInput.setEnabled(true);
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  CTabFolder source=(CTabFolder)e.getSource();
  CTabItem tabItem=source.getSelection();
  inputNode=(INode)tabItem.getData(INPUTNODE_KEY);
  inputMetaTable=(IMetadataTable)tabItem.getData(INPUTMETATABLE_KEY);
  inputMetaView=(MetadataTableEditorView)tabItem.getData(INPUTMETAVIEW_KEY);
  inputFamily=inputNode.getComponent().getOriginalFamilyName();
  inputReadOnly=(Boolean)tabItem.getData(INPUTREADONLY_KEY);
  if (inputReadOnly || inputMetaTable.isReadOnly()) {
    copyToInput.setEnabled(false);
    copySelectionToInput.setEnabled(false);
  }
 else {
    copyToInput.setEnabled(true);
    copySelectionToInput.setEnabled(true);
  }
}
Program: 127844
Project: 127844
Buggy source:
public void handleEvent(ModifiedBeanEvent<IMetadataColumn> event){
  if (outputMetaTable.isReadOnly() && outputNode.getComponent().isSchemaAutoPropagated()) {
    MetadataToolHelper.copyTable(inputMetaTable,outputMetaTable);
    outputMetaView.getTableViewerCreator().getTableViewer().refresh();
  }
  if (AbstractMetadataTableEditorView.ID_COLUMN_NAME.equals(event.column.getId())) {
    IMetadataColumn modifiedObject=event.bean;
    if (modifiedObject != null) {
      String originalLabel=changedNameColumns.get(modifiedObject);
      if (originalLabel == null) {
        changedNameColumns.put(modifiedObject,(String)event.previousValue);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void handleEvent(ModifiedBeanEvent<IMetadataColumn> event){
  if (outputMetaTable.isReadOnly() && outputNode.getComponent().isSchemaAutoPropagated()) {
    MetadataToolHelper.copyTable(inputMetaTable,outputMetaTable);
    outputMetaView.getTableViewerCreator().getTableViewer().refresh();
  }
  if (AbstractMetadataTableEditorView.ID_COLUMN_NAME.equals(event.column.getId())) {
    IMetadataColumn modifiedObject=event.bean;
    if (modifiedObject != null) {
      String originalLabel=changedNameColumns.get(modifiedObject);
      if (originalLabel == null) {
        changedNameColumns.put(modifiedObject,(String)event.previousValue);
      }
    }
  }
}
Program: 127846
Project: 127846
Buggy source:
public void widgetDefaultSelected(SelectionEvent e){
}

Fixed version (ground truth):
@Override public void widgetDefaultSelected(SelectionEvent e){
}
Program: 127848
Project: 127848
Buggy source:
/** 
 * DOC zshen check whether the file is exist
 */
private boolean isSqliteFileFieldInvalidate(){
  String fileFullPath=null;
  String urlText=null;
  if (isGeneralJDBC()) {
    urlText=generalJdbcUrlText.getText();
  }
 else   if (isSqlite()) {
    urlText=DBConnectionContextUtils.getUrlConnectionString(connectionItem,false);
  }
  String[] analyseURL=DatabaseConnStrUtil.analyseURL(dbTypeCombo.getText(),"String_Node_Str",urlText);
  if (analyseURL[1] != null && analyseURL.length > 1) {
    fileFullPath=getSqliteFileFullPath(analyseURL[0],analyseURL[1]);
  }
  if (fileFullPath != null) {
    File file=new File(fileFullPath);
    if (file.exists()) {
      return false;
    }
    MessageDialog.openWarning(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str",fileFullPath));
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC zshen check whether the file is exist
 */
private boolean isSqliteFileFieldInvalidate(){
  String fileFullPath=null;
  String urlText=null;
  if (isGeneralJDBCSqlite()) {
    urlText=generalJdbcUrlText.getText();
  }
 else   if (isSqlite()) {
    urlText=DBConnectionContextUtils.getUrlConnectionString(connectionItem,false);
  }
 else {
    return false;
  }
  String[] analyseURL=DatabaseConnStrUtil.analyseURL(dbTypeCombo.getText(),"String_Node_Str",urlText);
  if (analyseURL[1] != null && analyseURL.length > 1) {
    fileFullPath=getSqliteFileFullPath(analyseURL[0],analyseURL[1]);
  }
  if (fileFullPath != null) {
    File file=new File(fileFullPath);
    if (file.exists()) {
      return false;
    }
    MessageDialog.openWarning(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str",fileFullPath));
    return true;
  }
  return false;
}
Program: 127852
Project: 127852
Buggy source:
/** 
 * wzhang Comment method "fillAll".
 * @param pack the object(catalog or schema) which you want tables to be filled.Can't be null if need to fill thetables into the object of package(catalog or schema).And if Linked is false everything is ok.
 * @param dbJDBCMetadata If it is null the method will do nothing and return null too.
 * @param tableFilter The list for filter tables which you want to get.If it is null all of tables which belong tothe package will be return.
 * @param tablePattern another method to filter the tables.the table will be keep if it's name match to thetablePattern.And if you don't want to use it null is ok.
 * @param tableType the type of Table which you want to fill.It should be the one of TableType enum.
 * @return The list of tables/views/sysnonyms after filter.Will return null only if dbJDBCMetadata isn't normal.
 */
public List<MetadataTable> fillAll(Package pack,DatabaseMetaData dbJDBCMetadata,List<String> tableFilter,String tablePattern,String[] tableType);

Fixed version (ground truth):
public List<MetadataTable> fillAll(Package pack,DatabaseMetaData dbJDBCMetadata,IMetadataConnection metaConnection,List<String> tableFilter,String tablePattern,String[] tableType);
Program: 127853
Project: 127853
Buggy source:
public List<MetadataTable> fillAll(Package pack,DatabaseMetaData dbJDBCMetadata,List<String> tableFilter,String tablePattern,String[] tableType){
  return null;
}

Fixed version (ground truth):
public List<MetadataTable> fillAll(Package pack,DatabaseMetaData dbJDBCMetadata,IMetadataConnection metaConnection,List<String> tableFilter,String tablePattern,String[] tableType){
  return null;
}
Program: 127854
Project: 127854
Buggy source:
/** 
 * wzhang Comment method "fillAll".
 * @param pack the object(catalog or schema) which you want tables to be filled.Can't be null if need to fill thetables into the object of package(catalog or schema).And if Linked is false everything is ok.
 * @param dbJDBCMetadata If it is null the method will do nothing and return null too.
 * @param tableFilter The list for filter tables which you want to get.If it is null all of tables which belong tothe package will be return.
 * @param tablePattern another method to filter the tables.the table will be keep if it's name match to thetablePattern.And if you don't want to use it null is ok.
 * @param tableType the type of Table which you want to fill.It should be the one of TableType enum.
 * @return The list of tables/views/sysnonyms after filter.Will return null only if dbJDBCMetadata isn't normal.
 */
public List<MetadataTable> fillAll(Package pack,DatabaseMetaData dbJDBCMetadata,List<String> tableFilter,String tablePattern,String[] tableType){
  return metadataFiller.fillAll(pack,dbJDBCMetadata,tableFilter,tablePattern,tableType);
}

Fixed version (ground truth):
public List<MetadataTable> fillAll(Package pack,DatabaseMetaData dbJDBCMetadata,IMetadataConnection metaConnection,List<String> tableFilter,String tablePattern,String[] tableType){
  return metadataFiller.fillAll(pack,dbJDBCMetadata,metaConnection,tableFilter,tablePattern,tableType);
}
Program: 127855
Project: 127855
Buggy source:
/** 
 * Initialize value, forceFocus first field for right Click (new Table).
 */
@Override public void initialize(){
  getTableInfoParameters().setSqlFiter(sqlFilter.getText());
  getTableInfoParameters().changeType(ETableTypes.TABLETYPE_TABLE,tableCheck.getSelection());
  getTableInfoParameters().changeType(ETableTypes.TABLETYPE_EXTERNAL_TABLE,tableCheck.getSelection());
  getTableInfoParameters().changeType(ETableTypes.TABLETYPE_VIEW,viewCheck.getSelection());
  getTableInfoParameters().changeType(ETableTypes.TABLETYPE_SYNONYM,synonymCheck.getSelection());
  if (isOracle()) {
    getTableInfoParameters().changeType(ETableTypes.TABLETYPE_ALL_SYNONYM,publicSynonymCheck.getSelection());
  }
  switchFilter();
  IDBMetadataProviderObject providerObjectByDbType=ExtractMetaDataFromDataBase.getProviderObjectByDbType(metadataconnection.getDbType());
  if (typeName != null && typeName.isUseProvider() && !providerObjectByDbType.isSupportJDBC()) {
    disableAllJDBCControls();
  }
}

Fixed version (ground truth):
/** 
 * Initialize value, forceFocus first field for right Click (new Table).
 */
@Override public void initialize(){
  getTableInfoParameters().setSqlFiter(sqlFilter.getText());
  getTableInfoParameters().changeType(ETableTypes.TABLETYPE_TABLE,tableCheck.getSelection());
  getTableInfoParameters().changeType(ETableTypes.TABLETYPE_EXTERNAL_TABLE,tableCheck.getSelection());
  getTableInfoParameters().changeType(ETableTypes.TABLETYPE_VIEW,viewCheck.getSelection());
  getTableInfoParameters().changeType(ETableTypes.TABLETYPE_SYNONYM,synonymCheck.getSelection());
  if (HiveConnectionManager.getInstance().isCDHHive2(metadataconnection)) {
    getTableInfoParameters().changeType(ETableTypes.EXTERNAL_TABLE,tableCheck.getSelection());
    getTableInfoParameters().changeType(ETableTypes.MANAGED_TABLE,tableCheck.getSelection());
  }
  if (isOracle()) {
    getTableInfoParameters().changeType(ETableTypes.TABLETYPE_ALL_SYNONYM,publicSynonymCheck.getSelection());
  }
  switchFilter();
  IDBMetadataProviderObject providerObjectByDbType=ExtractMetaDataFromDataBase.getProviderObjectByDbType(metadataconnection.getDbType());
  if (typeName != null && typeName.isUseProvider() && !providerObjectByDbType.isSupportJDBC()) {
    disableAllJDBCControls();
  }
}
Program: 127858
Project: 127858
Buggy source:
@Override public void deploy(List<ModuleNeeded> modules,IProgressMonitor... monitorWrap){
  String installLocation=getStorageDirectory().getAbsolutePath();
  File indexFile=new File(installLocation + JAR_INDEX);
  if (indexFile.exists()) {
    LibrariesIndexManager.getInstance().loadResource();
  }
  boolean modified=false;
  LibrariesIndex index=LibrariesIndexManager.getInstance().getIndex();
  EMap<String,String> jarsToRelativePath=index.getJarsToRelativePath();
  for (  ModuleNeeded module : modules) {
    if (module.getModuleLocaion() != null && !"String_Node_Str".equals(module.getModuleLocaion())) {
      if (!jarsToRelativePath.keySet().contains(module.getModuleName())) {
        jarsToRelativePath.put(module.getModuleName(),module.getModuleLocaion());
        modified=true;
      }
    }
  }
  if (modified) {
    LibrariesIndexManager.getInstance().saveResource();
  }
}

Fixed version (ground truth):
@Override public void deploy(List<ModuleNeeded> modules,IProgressMonitor... monitorWrap){
  String installLocation=getStorageDirectory().getAbsolutePath();
  File indexFile=new File(installLocation + JAR_INDEX);
  if (indexFile.exists()) {
    LibrariesIndexManager.getInstance().loadResource();
  }
  boolean modified=false;
  LibrariesIndex index=LibrariesIndexManager.getInstance().getIndex();
  EMap<String,String> jarsToRelativePath=index.getJarsToRelativePath();
  for (  ModuleNeeded module : modules) {
    String moduleLocaion=module.getModuleLocaion();
    if (moduleLocaion != null && !"String_Node_Str".equals(moduleLocaion)) {
      if (!jarsToRelativePath.keySet().contains(module.getModuleName())) {
        jarsToRelativePath.put(module.getModuleName(),moduleLocaion);
        modified=true;
      }
 else {
        boolean jarFound=false;
        String existePath=jarsToRelativePath.get(module.getModuleName());
        if (existePath != null && existePath.startsWith("String_Node_Str")) {
          try {
            URI uri=new URI(existePath);
            URL url=FileLocator.toFileURL(uri.toURL());
            File file=new File(url.getFile());
            if (file.exists()) {
              jarFound=true;
            }
          }
 catch (          Exception e) {
          }
        }
        if (!jarFound) {
          jarsToRelativePath.put(module.getModuleName(),moduleLocaion);
          modified=true;
        }
      }
    }
  }
  if (modified) {
    LibrariesIndexManager.getInstance().saveResource();
  }
}
Program: 127859
Project: 127859
Buggy source:
@Override public void installModules(String[] jarNames){
  Shell shell=Display.getCurrent().getActiveShell();
  ModulesInstaller.installModules(new Shell(shell),jarNames);
}

Fixed version (ground truth):
@Override public void installModules(String[] jarNames){
  Shell shell=PlatformUI.getWorkbench().getDisplay().getActiveShell();
  ModulesInstaller.installModules(new Shell(shell),jarNames);
}
Program: 127860
Project: 127860
Buggy source:
public ExternalModulesInstallDialog(Shell shell,String text,String title){
  super(shell);
  setShellStyle(SWT.CLOSE | SWT.MIN | SWT.MAX| SWT.TITLE| SWT.BORDER| SWT.RESIZE| getDefaultOrientation());
  if (osName.contains("String_Node_Str")) {
    font=fontMac;
  }
  this.text=text;
  this.title=title;
}

Fixed version (ground truth):
public ExternalModulesInstallDialog(Shell shell,String text,String title){
  super(shell);
  setShellStyle(SWT.DIALOG_TRIM | SWT.MAX | SWT.RESIZE| SWT.SYSTEM_MODAL| getDefaultOrientation());
  if (osName.contains("String_Node_Str")) {
    font=fontMac;
  }
  this.text=text;
  this.title=title;
}
Program: 127861
Project: 127861
Buggy source:
/** 
 * DOC zshen check whether the file is exist
 */
private boolean isSqliteFileFieldInvalidate(){
  String fileFullPath=null;
  String urlText=null;
  if (isGeneralJDBC()) {
    urlText=generalJdbcUrlText.getText();
  }
 else   if (isSqlite()) {
    urlText=DBConnectionContextUtils.getUrlConnectionString(connectionItem,false);
  }
  String[] analyseURL=DatabaseConnStrUtil.analyseURL(dbTypeCombo.getText(),"String_Node_Str",urlText);
  if (analyseURL[1] != null && analyseURL.length > 1) {
    fileFullPath=getSqliteFileFullPath(analyseURL[0],analyseURL[1]);
  }
  if (fileFullPath != null) {
    File file=new File(fileFullPath);
    if (file.exists()) {
      return false;
    }
    MessageDialog.openWarning(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str",fileFullPath));
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC zshen check whether the file is exist
 */
private boolean isSqliteFileFieldInvalidate(){
  String fileFullPath=null;
  String urlText=null;
  if (isGeneralJDBCSqlite()) {
    urlText=generalJdbcUrlText.getText();
  }
 else   if (isSqlite()) {
    urlText=DBConnectionContextUtils.getUrlConnectionString(connectionItem,false);
  }
 else {
    return false;
  }
  String[] analyseURL=DatabaseConnStrUtil.analyseURL(dbTypeCombo.getText(),"String_Node_Str",urlText);
  if (analyseURL[1] != null && analyseURL.length > 1) {
    fileFullPath=getSqliteFileFullPath(analyseURL[0],analyseURL[1]);
  }
  if (fileFullPath != null) {
    File file=new File(fileFullPath);
    if (file.exists()) {
      return false;
    }
    MessageDialog.openWarning(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str",fileFullPath));
    return true;
  }
  return false;
}
Program: 127863
Project: 127863
Buggy source:
/** 
 * DOC zshen check whether the file is exist
 */
private boolean isSqliteFileFieldInvalidate(){
  String fileFullPath=null;
  String urlText=null;
  if (isGeneralJDBC()) {
    urlText=generalJdbcUrlText.getText();
  }
 else   if (isSqlite()) {
    urlText=DBConnectionContextUtils.getUrlConnectionString(connectionItem,false);
  }
  String[] analyseURL=DatabaseConnStrUtil.analyseURL(dbTypeCombo.getText(),"String_Node_Str",urlText);
  if (analyseURL[1] != null && analyseURL.length > 1) {
    fileFullPath=getSqliteFileFullPath(analyseURL[0],analyseURL[1]);
  }
  if (fileFullPath != null) {
    File file=new File(fileFullPath);
    if (file.exists()) {
      return false;
    }
    MessageDialog.openWarning(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str",fileFullPath));
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC zshen check whether the file is exist
 */
private boolean isSqliteFileFieldInvalidate(){
  String fileFullPath=null;
  String urlText=null;
  if (isGeneralJDBCSqlite()) {
    urlText=generalJdbcUrlText.getText();
  }
 else   if (isSqlite()) {
    urlText=DBConnectionContextUtils.getUrlConnectionString(connectionItem,false);
  }
 else {
    return false;
  }
  String[] analyseURL=DatabaseConnStrUtil.analyseURL(dbTypeCombo.getText(),"String_Node_Str",urlText);
  if (analyseURL[1] != null && analyseURL.length > 1) {
    fileFullPath=getSqliteFileFullPath(analyseURL[0],analyseURL[1]);
  }
  if (fileFullPath != null) {
    File file=new File(fileFullPath);
    if (file.exists()) {
      return false;
    }
    MessageDialog.openWarning(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str",fileFullPath));
    return true;
  }
  return false;
}
Program: 127864
Project: 127864
Buggy source:
public ExternalModulesInstallDialog(Shell shell,String text,String title){
  super(shell);
  setShellStyle(SWT.DIALOG_TRIM | SWT.MAX | SWT.RESIZE| SWT.SYSTEM_MODAL| getDefaultOrientation());
  if (osName.contains("String_Node_Str")) {
    font=fontMac;
  }
  this.text=text;
  this.title=title;
}

Fixed version (ground truth):
public ExternalModulesInstallDialog(Shell shell,String text,String title){
  super(shell);
  setShellStyle(SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX| SWT.RESIZE| getDefaultOrientation());
  if (osName.contains("String_Node_Str")) {
    font=fontMac;
  }
  this.text=text;
  this.title=title;
}
Program: 127866
Project: 127866
Buggy source:
/** 
 * Sets the name.
 * @param name the name to set
 */
public void setName(String name){
  this.name=name;
}

Fixed version (ground truth):
/** 
 * Sets the name.
 * @param name the name to set
 */
@Override public void setName(String name){
  this.name=name;
}
Program: 127867
Project: 127867
Buggy source:
/** 
 * Getter for name.
 * @return the name
 */
public String getName(){
  return this.name;
}

Fixed version (ground truth):
/** 
 * Getter for name.
 * @return the name
 */
@Override public String getName(){
  return this.name;
}
Program: 127868
Project: 127868
Buggy source:
public List<ContextItem> getContextItem(Project project) throws PersistenceException {
  List<ContextItem> result=new ArrayList<ContextItem>();
  for (  IRepositoryViewObject repositoryObject : getMetadata(project,ERepositoryObjectType.CONTEXT).getAbsoluteMembers().objects()) {
    ContextItem contextItem=(ContextItem)repositoryObject.getProperty().getItem();
    if (getStatus(contextItem) != ERepositoryStatus.DELETED) {
      result.add(contextItem);
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public List<ContextItem> getContextItem(Project project) throws PersistenceException {
  List<ContextItem> result=new ArrayList<ContextItem>();
  for (  IRepositoryViewObject repositoryObject : getMetadata(project,ERepositoryObjectType.CONTEXT).getAbsoluteMembers().objects()) {
    ContextItem contextItem=(ContextItem)repositoryObject.getProperty().getItem();
    if (getStatus(contextItem) != ERepositoryStatus.DELETED) {
      result.add(contextItem);
    }
  }
  return result;
}
Program: 127869
Project: 127869
Buggy source:
public String getId(){
  return this.id;
}

Fixed version (ground truth):
@Override public String getId(){
  return this.id;
}
Program: 127870
Project: 127870
Buggy source:
@SuppressWarnings("String_Node_Str") public void executeRepositoryWorkUnit(RepositoryWorkUnit workUnit){
  workUnit.executeRun();
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public void executeRepositoryWorkUnit(RepositoryWorkUnit workUnit){
  workUnit.executeRun();
}
Program: 127871
Project: 127871
Buggy source:
public void logOffProject(){
  loggedOnProject=false;
  listeners.clear();
}

Fixed version (ground truth):
@Override public void logOffProject(){
  ProjectManager.getInstance().clearAll();
  unloadResources();
  loggedOnProject=false;
  listeners.clear();
}
Program: 127872
Project: 127872
Buggy source:
/** 
 * Sets the authenticationNeeded.
 * @param authenticationNeeded the authenticationNeeded to set
 */
public void setAuthenticationNeeded(boolean authenticationNeeded){
  this.authenticationNeeded=authenticationNeeded;
}

Fixed version (ground truth):
/** 
 * Sets the authenticationNeeded.
 * @param authenticationNeeded the authenticationNeeded to set
 */
@Override public void setAuthenticationNeeded(boolean authenticationNeeded){
  this.authenticationNeeded=authenticationNeeded;
}
Program: 127873
Project: 127873
Buggy source:
/** 
 * Getter for authenticationNeeded.
 * @return the authenticationNeeded
 */
public boolean isAuthenticationNeeded(){
  return this.authenticationNeeded;
}

Fixed version (ground truth):
/** 
 * Getter for authenticationNeeded.
 * @return the authenticationNeeded
 */
@Override public boolean isAuthenticationNeeded(){
  return this.authenticationNeeded;
}
Program: 127874
Project: 127874
Buggy source:
public void setId(String id){
  this.id=id;
}

Fixed version (ground truth):
@Override public void setId(String id){
  this.id=id;
}
Program: 127875
Project: 127875
Buggy source:
public void addRepositoryWorkUnitListener(IRepositoryWorkUnitListener listener){
synchronized (lock) {
    listeners.add(listener);
  }
}

Fixed version (ground truth):
@Override public void addRepositoryWorkUnitListener(IRepositoryWorkUnitListener listener){
synchronized (lock) {
    listeners.add(listener);
  }
}
Program: 127876
Project: 127876
Buggy source:
public Project[] readProject(boolean unloadResource) throws PersistenceException, BusinessException {
  return readProject();
}

Fixed version (ground truth):
@Override public Project[] readProject(boolean unloadResource) throws PersistenceException, BusinessException {
  return readProject();
}
Program: 127877
Project: 127877
Buggy source:
public List<DynamicButtonBean> getButtons(){
  return buttons;
}

Fixed version (ground truth):
@Override public List<DynamicButtonBean> getButtons(){
  return buttons;
}
Program: 127878
Project: 127878
Buggy source:
public List<DynamicChoiceBean> getChoices(){
  return choices;
}

Fixed version (ground truth):
@Override public List<DynamicChoiceBean> getChoices(){
  return choices;
}
Program: 127879
Project: 127879
Buggy source:
public void setFields(List<DynamicFieldBean> fields){
  this.fields=fields;
}

Fixed version (ground truth):
@Override public void setFields(List<DynamicFieldBean> fields){
  this.fields=fields;
}
Program: 127880
Project: 127880
Buggy source:
public void checkAvailability(){
}

Fixed version (ground truth):
@Override public void checkAvailability(){
}
Program: 127881
Project: 127881
Buggy source:
public List<ConnectionItem> getMetadataConnectionsItem(Project project) throws PersistenceException {
  List<ConnectionItem> result=new ArrayList<ConnectionItem>();
  collect(getMetadata(project,ERepositoryObjectType.METADATA_FILE_DELIMITED),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_FILE_POSITIONAL),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_FILE_REGEXP),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_FILE_XML),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_FILE_EXCEL),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_FILE_LDIF),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_CONNECTIONS),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_SAPCONNECTIONS),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_HEADER_FOOTER),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_LDAP_SCHEMA),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_GENERIC_SCHEMA),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_WSDL_SCHEMA),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA),result);
  return result;
}

Fixed version (ground truth):
@Override public List<ConnectionItem> getMetadataConnectionsItem(Project project) throws PersistenceException {
  List<ConnectionItem> result=new ArrayList<ConnectionItem>();
  collect(getMetadata(project,ERepositoryObjectType.METADATA_FILE_DELIMITED),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_FILE_POSITIONAL),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_FILE_REGEXP),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_FILE_XML),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_FILE_EXCEL),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_FILE_LDIF),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_CONNECTIONS),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_SAPCONNECTIONS),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_HEADER_FOOTER),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_LDAP_SCHEMA),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_GENERIC_SCHEMA),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_WSDL_SCHEMA),result);
  collect(getMetadata(project,ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA),result);
  return result;
}
Program: 127882
Project: 127882
Buggy source:
public List<DynamicFieldBean> getFields(){
  return this.fields;
}

Fixed version (ground truth):
@Override public List<DynamicFieldBean> getFields(){
  return this.fields;
}
Program: 127883
Project: 127883
Buggy source:
public boolean isUserReadOnlyOnCurrentProject(){
  return false;
}

Fixed version (ground truth):
@Override public boolean isUserReadOnlyOnCurrentProject(){
  return false;
}
Program: 127884
Project: 127884
Buggy source:
/** 
 * Generates the next id for serializable. If no serializable returns 0.
 * @param project the project to scan
 * @return the next id for the project
 * @throws PersistenceException
 * @throws PersistenceException if processes cannot be retrieved
 */
public String getNextId(){
  return EcoreUtil.generateUUID();
}

Fixed version (ground truth):
/** 
 * Generates the next id for serializable. If no serializable returns 0.
 * @param project the project to scan
 * @return the next id for the project
 * @throws PersistenceException
 * @throws PersistenceException if processes cannot be retrieved
 */
@Override public String getNextId(){
  return EcoreUtil.generateUUID();
}
Program: 127885
Project: 127885
Buggy source:
public boolean isDisplayToUser(){
  return displayToUser;
}

Fixed version (ground truth):
@Override public boolean isDisplayToUser(){
  return displayToUser;
}
Program: 127886
Project: 127886
Buggy source:
public void setDisplayToUser(boolean displayToUser){
  this.displayToUser=displayToUser;
}

Fixed version (ground truth):
@Override public void setDisplayToUser(boolean displayToUser){
  this.displayToUser=displayToUser;
}
Program: 127887
Project: 127887
Buggy source:
/** 
 * return all the referenced projects of current project.
 */
public List<Project> getAllReferencedProjects(){
  allReferencedprojects.clear();
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    IProxyRepositoryFactory factory=service.getProxyRepositoryFactory();
    if (factory != null) {
      List<org.talend.core.model.properties.Project> rProjects=factory.getReferencedProjects(this.getCurrentProject());
      if (rProjects != null) {
        for (        org.talend.core.model.properties.Project p : rProjects) {
          Project project=new Project(p);
          allReferencedprojects.add(project);
          resolveSubRefProject(p);
        }
      }
    }
  }
  return this.allReferencedprojects;
}

Fixed version (ground truth):
/** 
 * return all the referenced projects of current project.
 */
public List<Project> getAllReferencedProjects(){
  allReferencedprojects.clear();
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
    if (this.getCurrentProject() == null) {
      return allReferencedprojects;
    }
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    IProxyRepositoryFactory factory=service.getProxyRepositoryFactory();
    if (factory != null) {
      List<org.talend.core.model.properties.Project> rProjects=factory.getReferencedProjects(this.getCurrentProject());
      if (rProjects != null) {
        for (        org.talend.core.model.properties.Project p : rProjects) {
          Project project=new Project(p);
          allReferencedprojects.add(project);
          resolveSubRefProject(p);
        }
      }
    }
  }
  return this.allReferencedprojects;
}
Program: 127888
Project: 127888
Buggy source:
public static String getHiveURLString(DatabaseConnection dbConn,String server,String port,String sidOrDatabase){
  String hiveModel=dbConn.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_MODE);
  String url=dbConn.getURL();
  if (url != null) {
    if (url.startsWith(DbConnStrForHive.URL_HIVE_2_TEMPLATE)) {
      if (HiveConnVersionInfo.MODE_EMBEDDED.getKey().equalsIgnoreCase(hiveModel)) {
        url=getHive2EmbeddedURLString();
      }
 else {
        url=getHive2StandaloneURLString(false,server,port,sidOrDatabase);
      }
    }
 else     if (url.startsWith(DbConnStrForHive.URL_HIVE_1_TEMPLATE)) {
      if (HiveConnVersionInfo.MODE_EMBEDDED.getKey().equalsIgnoreCase(hiveModel)) {
        url=getHive1EmbeddedURLString();
      }
 else {
        url=getHive1StandaloneURLString(false,server,port,sidOrDatabase);
      }
    }
 else {
      url=getHive1EmbeddedURLString();
    }
  }
 else {
    url=getHive1EmbeddedURLString();
  }
  return url;
}

Fixed version (ground truth):
public static String getHiveURLString(DatabaseConnection dbConn,String server,String port,String sidOrDatabase,String template){
  String hiveModel=dbConn.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_MODE);
  String url=null;
  if (template.startsWith(DbConnStrForHive.URL_HIVE_2_TEMPLATE)) {
    if (HiveConnVersionInfo.MODE_EMBEDDED.getKey().equalsIgnoreCase(hiveModel)) {
      url=getHive2EmbeddedURLString();
    }
 else {
      url=getHive2StandaloneURLString(false,server,port,sidOrDatabase);
    }
  }
 else   if (template.startsWith(DbConnStrForHive.URL_HIVE_1_TEMPLATE)) {
    if (HiveConnVersionInfo.MODE_EMBEDDED.getKey().equalsIgnoreCase(hiveModel)) {
      url=getHive1EmbeddedURLString();
    }
 else {
      url=getHive1StandaloneURLString(false,server,port,sidOrDatabase);
    }
  }
  if (url == null) {
    url=getHive1EmbeddedURLString();
  }
  return url;
}