nus-yam/ex-repair huggingface dataset:
Program: 125004
Project: 125004
Buggy source:
@Override public void notifyChanged(Notification notification){
  int type=notification.getEventType();
  int featureId=notification.getFeatureID(PigmapPackage.class);
switch (type) {
case Notification.ADD:
case Notification.REMOVE:
case Notification.REMOVE_MANY:
switch (featureId) {
case PigmapPackage.OUTPUT_TABLE__NODES:
      refreshChildren();
    break;
case PigmapPackage.ABSTRACT_IN_OUT_TABLE__FILTER_INCOMING_CONNECTIONS:
  refreshTargetConnections();
break;
}
break;
case Notification.SET:
switch (featureId) {
case PigmapPackage.OUTPUT_TABLE__NODES:
refreshChildren();
break;
case PigmapPackage.OUTPUT_TABLE__REJECT:
case PigmapPackage.OUTPUT_TABLE__REJECT_INNER_JOIN:
case PigmapPackage.OUTPUT_TABLE__ACTIVATE_EXPRESSION_FILTER:
case PigmapPackage.OUTPUT_TABLE__MINIMIZED:
case PigmapPackage.OUTPUT_TABLE__ALL_IN_ONE:
case PigmapPackage.OUTPUT_TABLE__ENABLE_EMPTY_ELEMENT:
((OutputTableFigure)getFigure()).update(featureId);
break;
}
}
}

Fixed version (ground truth):
@Override public void notifyChanged(Notification notification){
  int type=notification.getEventType();
  int featureId=notification.getFeatureID(PigmapPackage.class);
switch (type) {
case Notification.ADD:
case Notification.REMOVE:
case Notification.REMOVE_MANY:
switch (featureId) {
case PigmapPackage.OUTPUT_TABLE__NODES:
      refreshChildren();
    break;
case PigmapPackage.ABSTRACT_IN_OUT_TABLE__FILTER_INCOMING_CONNECTIONS:
  refreshTargetConnections();
break;
}
break;
case Notification.SET:
switch (featureId) {
case PigmapPackage.OUTPUT_TABLE__NODES:
refreshChildren();
break;
case PigmapPackage.OUTPUT_TABLE__REJECT:
case PigmapPackage.OUTPUT_TABLE__REJECT_INNER_JOIN:
case PigmapPackage.OUTPUT_TABLE__ACTIVATE_EXPRESSION_FILTER:
case PigmapPackage.OUTPUT_TABLE__MINIMIZED:
case PigmapPackage.OUTPUT_TABLE__ALL_IN_ONE:
case PigmapPackage.OUTPUT_TABLE__ENABLE_EMPTY_ELEMENT:
case PigmapPackage.OUTPUT_TABLE__EXPRESSION_FILTER:
((OutputTableFigure)getFigure()).update(featureId);
break;
}
}
}
Program: 125005
Project: 125005
Buggy source:
public void prepareClosing(int response){
}

Fixed version (ground truth):
public void prepareClosing(int response){
  List<IMetadataTable> newMetadatas=new ArrayList<IMetadataTable>();
  EList<OutputTable> outputTables=null;
  if (response == SWT.OK || response == SWT.APPLICATION_MODAL) {
    mapperManager.fireCurrentDirectEditApply();
    outputTables=copyOfMapData.getOutputTables();
  }
 else {
    outputTables=((PigMapData)mapperComponent.getExternalEmfData()).getOutputTables();
  }
  List<IMetadataTable> copyOfMetadata=new ArrayList<IMetadataTable>(mapperComponent.getMetadataList());
  for (  OutputTable outputTable : outputTables) {
    IMetadataTable found=null;
    for (    IMetadataTable table : mapperComponent.getMetadataList()) {
      if (outputTable.getName().equals(table.getTableName())) {
        found=table;
      }
    }
    if (found != null) {
      newMetadatas.add(found);
    }
 else {
      MetadataTable metadataTable=new MetadataTable();
      metadataTable.setTableName(outputTable.getName());
      mapperComponent.getProcess().addUniqueConnectionName(outputTable.getName());
      List<IMetadataColumn> listColumns=new ArrayList<IMetadataColumn>();
      for (      TableNode tableNode : outputTable.getNodes()) {
        MetadataColumn column=new MetadataColumn();
        column.setLabel(tableNode.getName());
        column.setKey(tableNode.isKey());
        column.setTalendType(tableNode.getType());
        column.setNullable(tableNode.isNullable());
        column.setPattern(tableNode.getPattern());
        listColumns.add(column);
      }
      metadataTable.setListColumns(listColumns);
      newMetadatas.add(metadataTable);
    }
  }
  mapperComponent.setMetadataList(newMetadatas);
  copyOfMetadata.removeAll(newMetadatas);
  List<IODataComponent> outputs=mapperComponent.getIODataComponents().getOuputs();
  List<String> connectionNames=new ArrayList<String>();
  for (  IODataComponent output : outputs) {
    connectionNames.add(output.getUniqueName());
  }
  for (  IMetadataTable leftTree : copyOfMetadata) {
    if (!connectionNames.contains(leftTree.getTableName())) {
      mapperComponent.getProcess().removeUniqueConnectionName(leftTree.getTableName());
    }
  }
}
Program: 125006
Project: 125006
Buggy source:
private Object getParameterValue(INode node,String paramName){
  Map<String,List<String>> componentParamsMap=HadoopMappingManager.getInstance().getComponentParamsMap();
  List<String> paramslist=componentParamsMap.get(paramName);
  if (paramslist != null && paramslist.size() > 0) {
    for (    String param : paramslist) {
      Object value=node.getPropertyValue(param);
      if (value != null) {
        return value;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private Object getParameterValue(INode node,String paramName){
  Map<String,List<String>> componentParamsMap=HadoopMappingManager.getInstance().getComponentParamsMap();
  List<String> paramslist=componentParamsMap.get(paramName);
  if (paramslist != null && paramslist.size() > 0) {
    for (    String param : paramslist) {
      Object value=null;
      if (node instanceof DataNode) {
        DataNode dataNode=(DataNode)node;
        IElementParameter parameter=dataNode.getElementParameter(param);
        if (parameter != null) {
          value=parameter.getValue();
        }
      }
 else {
        value=node.getPropertyValue(param);
      }
      if (value != null) {
        return value;
      }
    }
  }
  return null;
}
Program: 125010
Project: 125010
Buggy source:
public boolean hasDiffsFromClusterToProcess(Connection hcConnection,IProcess process){
  if (hcConnection == null || process == null) {
    return false;
  }
  if (hcConnection instanceof HadoopClusterConnection) {
    return HCRepositoryUtil.detectClusterChangeOfProcess((HadoopClusterConnection)hcConnection,process);
  }
  return false;
}

Fixed version (ground truth):
public boolean hasDiffsFromClusterToProcess(Item item,IProcess process){
  if (item == null || process == null) {
    return false;
  }
  String propertyParamName=MR_PROPERTY_PREFIX + EParameterName.PROPERTY_TYPE.getName();
  String propertyRepTypeParamName=MR_PROPERTY_PREFIX + EParameterName.REPOSITORY_PROPERTY_TYPE.getName();
  IElementParameter elementParameter=process.getElementParameter(propertyParamName);
  if (elementParameter != null && EmfComponent.REPOSITORY.equals(elementParameter.getValue())) {
    IElementParameter repositoryParam=process.getElementParameter(propertyRepTypeParamName);
    if (item.getProperty().getId().equals(repositoryParam.getValue())) {
      return false;
    }
 else {
      return true;
    }
  }
  return true;
}
Program: 125011
Project: 125011
Buggy source:
/** 
 * DOC ycbai Comment method "updateHDFSConnection".
 * @param connectionItem
 * @param show
 * @param onlySimpleShow
 * @return
 */
public static boolean updateHDFSConnection(ConnectionItem connectionItem,boolean show,final boolean onlySimpleShow){
  List<Relation> relations=RelationshipItemBuilder.getInstance().getItemsRelatedTo(connectionItem.getProperty().getId(),RelationshipItemBuilder.LATEST_VERSION,RelationshipItemBuilder.PROPERTY_RELATION);
  RepositoryUpdateManager repositoryUpdateManager=new RepositoryUpdateManager(connectionItem.getConnection(),relations){
    @Override public Set<EUpdateItemType> getTypes(){
      Set<EUpdateItemType> types=new HashSet<EUpdateItemType>();
      types.add(EUpdateItemType.NODE_PROPERTY);
      return types;
    }
  }
;
  return repositoryUpdateManager.doWork(true,false);
}

Fixed version (ground truth):
/** 
 * DOC ycbai Comment method "updateHDFSConnection".
 * @param connectionItem
 * @param show
 * @param onlySimpleShow
 * @return
 */
public static boolean updateHDFSConnection(ConnectionItem connectionItem,boolean show,final boolean onlySimpleShow){
  List<Relation> relations=RelationshipItemBuilder.getInstance().getItemsRelatedTo(connectionItem.getProperty().getId(),RelationshipItemBuilder.LATEST_VERSION,RelationshipItemBuilder.PROPERTY_RELATION);
  RepositoryUpdateManager repositoryUpdateManager=new RepositoryUpdateManager(connectionItem.getConnection(),relations){
    @Override public Set<EUpdateItemType> getTypes(){
      Set<EUpdateItemType> types=new HashSet<EUpdateItemType>();
      types.add(EUpdateItemType.NODE_PROPERTY);
      types.add(EUpdateItemType.JOB_PROPERTY_MAPREDUCE);
      return types;
    }
  }
;
  return repositoryUpdateManager.doWork(true,false);
}
Program: 125012
Project: 125012
Buggy source:
@Override public Set<EUpdateItemType> getTypes(){
  Set<EUpdateItemType> types=new HashSet<EUpdateItemType>();
  types.add(EUpdateItemType.NODE_PROPERTY);
  return types;
}

Fixed version (ground truth):
@Override public Set<EUpdateItemType> getTypes(){
  Set<EUpdateItemType> types=new HashSet<EUpdateItemType>();
  types.add(EUpdateItemType.NODE_PROPERTY);
  types.add(EUpdateItemType.JOB_PROPERTY_MAPREDUCE);
  return types;
}
Program: 125013
Project: 125013
Buggy source:
public static boolean hasAuthority(FileStatus status,String userName,ELinuxAuthority authority){
  boolean hasAuthority=false;
  if (status == null) {
    return hasAuthority;
  }
  if (authority == null) {
    authority=ELinuxAuthority.READ;
  }
  FsPermission permission=status.getPermission();
  if (permission == null) {
    return hasAuthority;
  }
  String owner=status.getOwner();
  FsAction userAction=permission.getUserAction();
  FsAction groupAction=permission.getGroupAction();
  FsAction otherAction=permission.getOtherAction();
switch (authority) {
case READ:
    if (owner != null && owner.equals(userName)) {
      return hasReadAuthority(userAction) || hasReadAuthority(groupAction);
    }
  return hasReadAuthority(otherAction);
case WRITE:
if (owner != null && owner.equals(userName)) {
  return hasWriteAuthority(userAction) || hasWriteAuthority(groupAction);
}
return hasWriteAuthority(otherAction);
case EXCUTE:
if (owner != null && owner.equals(userName)) {
return hasExcuteAuthority(userAction) || hasExcuteAuthority(groupAction);
}
return hasExcuteAuthority(otherAction);
default :
break;
}
return hasAuthority;
}

Fixed version (ground truth):
public static boolean hasAuthority(FileStatus status,String userName,ELinuxAuthority authority){
  boolean hasAuthority=false;
  if (status == null) {
    return hasAuthority;
  }
  if (authority == null) {
    authority=ELinuxAuthority.READ;
  }
  FsPermission permission=status.getPermission();
  if (permission == null) {
    return hasAuthority;
  }
  userName=TalendQuoteUtils.addQuotesIfNotExist(userName);
  String owner=TalendQuoteUtils.addQuotesIfNotExist(status.getOwner());
  FsAction userAction=permission.getUserAction();
  FsAction groupAction=permission.getGroupAction();
  FsAction otherAction=permission.getOtherAction();
switch (authority) {
case READ:
    if (owner != null && owner.equals(userName)) {
      return hasReadAuthority(userAction) || hasReadAuthority(groupAction);
    }
  return hasReadAuthority(otherAction);
case WRITE:
if (owner != null && owner.equals(userName)) {
  return hasWriteAuthority(userAction) || hasWriteAuthority(groupAction);
}
return hasWriteAuthority(otherAction);
case EXCUTE:
if (owner != null && owner.equals(userName)) {
return hasExcuteAuthority(userAction) || hasExcuteAuthority(groupAction);
}
return hasExcuteAuthority(otherAction);
default :
break;
}
return hasAuthority;
}
Program: 125015
Project: 125015
Buggy source:
private void initMetadataForm(){
  if (metadataTable == null) {
    return;
  }
  metadataEditor.setMetadataTable(metadataTable);
  Boolean flag=CoreRuntimePlugin.getInstance().getPreferenceStore().getBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS);
  if (!flag.booleanValue()) {
    List<MetadataColumn> list=metadataEditor.getMetadataColumnList();
    for (    MetadataColumn column : list) {
      if (!isCnorEn(column.getLabel())) {
        String label=metadataEditor.getNextGeneratedColumnName("String_Node_Str");
        column.setLabel(label);
      }
    }
  }
  tableEditorView.setMetadataEditor(metadataEditor);
  tableEditorView.getTableViewerCreator().layout();
  metadataEditor.addAfterOperationListListener(new IListenableListListener(){
    @Override public void handleEvent(    ListenableListEvent event){
      changeTableNavigatorStatus(checkFieldsValue());
    }
  }
);
  String label=MetadataToolHelper.validateValue(metadataTable.getLabel());
  nameText.setText(label);
  commentText.setText(metadataTable.getComment());
  updateRetreiveSchemaButton();
  nameText.forceFocus();
}

Fixed version (ground truth):
private void initMetadataForm(){
  if (metadataTable == null) {
    return;
  }
  metadataEditor.setMetadataTable(metadataTable);
  IEclipsePreferences preferences=new InstanceScope().getNode(CoreRuntimePlugin.PLUGIN_ID);
  Boolean flag=preferences.getBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS,false);
  if (!flag.booleanValue()) {
    List<MetadataColumn> list=metadataEditor.getMetadataColumnList();
    for (    MetadataColumn column : list) {
      if (!isCnorEn(column.getLabel())) {
        String label=metadataEditor.getNextGeneratedColumnName("String_Node_Str");
        column.setLabel(label);
      }
    }
  }
  tableEditorView.setMetadataEditor(metadataEditor);
  tableEditorView.getTableViewerCreator().layout();
  metadataEditor.addAfterOperationListListener(new IListenableListListener(){
    @Override public void handleEvent(    ListenableListEvent event){
      changeTableNavigatorStatus(checkFieldsValue());
    }
  }
);
  String label=MetadataToolHelper.validateValue(metadataTable.getLabel());
  nameText.setText(label);
  commentText.setText(metadataTable.getComment());
  updateRetreiveSchemaButton();
  nameText.forceFocus();
}
Program: 125016
Project: 125016
Buggy source:
private void initMetadataForm(){
  if (metadataTable == null) {
    return;
  }
  metadataEditor.setMetadataTable(metadataTable);
  IEclipsePreferences preferences=new InstanceScope().getNode(CoreRuntimePlugin.PLUGIN_ID);
  Boolean flag=preferences.getBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS,false);
  if (!flag.booleanValue()) {
    List<MetadataColumn> list=metadataEditor.getMetadataColumnList();
    for (    MetadataColumn column : list) {
      if (!isCnorEn(column.getLabel())) {
        String label=metadataEditor.getNextGeneratedColumnName("String_Node_Str");
        column.setLabel(label);
      }
    }
  }
  tableEditorView.setMetadataEditor(metadataEditor);
  tableEditorView.getTableViewerCreator().layout();
  metadataEditor.addAfterOperationListListener(new IListenableListListener(){
    @Override public void handleEvent(    ListenableListEvent event){
      changeTableNavigatorStatus(checkFieldsValue());
    }
  }
);
  String label=MetadataToolHelper.validateValue(metadataTable.getLabel());
  nameText.setText(label);
  commentText.setText(metadataTable.getComment());
  updateRetreiveSchemaButton();
  nameText.forceFocus();
}

Fixed version (ground truth):
private void initMetadataForm(){
  if (metadataTable == null) {
    return;
  }
  metadataEditor.setMetadataTable(metadataTable);
  IEclipsePreferences preferences=new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
  Boolean flag=preferences.getBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS,false);
  if (!flag.booleanValue()) {
    List<MetadataColumn> list=metadataEditor.getMetadataColumnList();
    for (    MetadataColumn column : list) {
      if (!isCnorEn(column.getLabel())) {
        String label=metadataEditor.getNextGeneratedColumnName("String_Node_Str");
        column.setLabel(label);
      }
    }
  }
  tableEditorView.setMetadataEditor(metadataEditor);
  tableEditorView.getTableViewerCreator().layout();
  metadataEditor.addAfterOperationListListener(new IListenableListListener(){
    @Override public void handleEvent(    ListenableListEvent event){
      changeTableNavigatorStatus(checkFieldsValue());
    }
  }
);
  String label=MetadataToolHelper.validateValue(metadataTable.getLabel());
  nameText.setText(label);
  commentText.setText(metadataTable.getComment());
  updateRetreiveSchemaButton();
  nameText.forceFocus();
}
Program: 125017
Project: 125017
Buggy source:
private void initMetadataForm(){
  if (metadataTable == null) {
    return;
  }
  metadataEditor.setMetadataTable(metadataTable);
  Boolean flag=CoreRuntimePlugin.getInstance().getPreferenceStore().getBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS);
  if (!flag.booleanValue()) {
    List<MetadataColumn> list=metadataEditor.getMetadataColumnList();
    for (    MetadataColumn column : list) {
      if (!isCnorEn(column.getLabel())) {
        String label=metadataEditor.getNextGeneratedColumnName("String_Node_Str");
        column.setLabel(label);
      }
    }
  }
  tableEditorView.setMetadataEditor(metadataEditor);
  tableEditorView.getTableViewerCreator().layout();
  metadataEditor.addAfterOperationListListener(new IListenableListListener(){
    @Override public void handleEvent(    ListenableListEvent event){
      changeTableNavigatorStatus(checkFieldsValue());
    }
  }
);
  String label=MetadataToolHelper.validateValue(metadataTable.getLabel());
  nameText.setText(label);
  commentText.setText(metadataTable.getComment());
  String filePath=metadataTable.getAdditionalProperties().get(HDFSConstants.HDFS_PATH);
  baseFilePathText.setText(StringUtils.trimToEmpty(filePath));
  updateRetreiveSchemaButton();
  nameText.forceFocus();
}

Fixed version (ground truth):
private void initMetadataForm(){
  if (metadataTable == null) {
    return;
  }
  metadataEditor.setMetadataTable(metadataTable);
  IEclipsePreferences preferences=new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
  Boolean flag=preferences.getBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS,false);
  if (!flag.booleanValue()) {
    List<MetadataColumn> list=metadataEditor.getMetadataColumnList();
    for (    MetadataColumn column : list) {
      if (!isCnorEn(column.getLabel())) {
        String label=metadataEditor.getNextGeneratedColumnName("String_Node_Str");
        column.setLabel(label);
      }
    }
  }
  tableEditorView.setMetadataEditor(metadataEditor);
  tableEditorView.getTableViewerCreator().layout();
  metadataEditor.addAfterOperationListListener(new IListenableListListener(){
    @Override public void handleEvent(    ListenableListEvent event){
      changeTableNavigatorStatus(checkFieldsValue());
    }
  }
);
  String label=MetadataToolHelper.validateValue(metadataTable.getLabel());
  nameText.setText(label);
  commentText.setText(metadataTable.getComment());
  String filePath=metadataTable.getAdditionalProperties().get(HDFSConstants.HDFS_PATH);
  baseFilePathText.setText(StringUtils.trimToEmpty(filePath));
  updateRetreiveSchemaButton();
  nameText.forceFocus();
}
Program: 125018
Project: 125018
Buggy source:
@Override protected void doRun(){
  if (repositoryNode == null) {
    repositoryNode=getCurrentRepositoryNode();
  }
  if (isToolbar()) {
    if (repositoryNode != null && repositoryNode.getContentType() != getNodeType()) {
      repositoryNode=null;
    }
    if (repositoryNode == null) {
      repositoryNode=getRepositoryNodeForDefault(getNodeType());
    }
  }
  IWizard wizard=getWizard(PlatformUI.getWorkbench(),creation,repositoryNode,getExistingNames());
  if (isToolbar()) {
    init(repositoryNode);
  }
  WizardDialog wizardDialog=new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),wizard);
  wizardDialog.setPageSize(getWizardWidth(),getWizardHeight());
  wizardDialog.create();
  wizardDialog.open();
}

Fixed version (ground truth):
@Override protected void doRun(){
  if (repositoryNode == null) {
    repositoryNode=getCurrentRepositoryNode();
  }
  if (isToolbar()) {
    if (repositoryNode != null && repositoryNode.getContentType() != getNodeType()) {
      repositoryNode=null;
    }
    if (repositoryNode == null) {
      repositoryNode=getRepositoryNodeForDefault(getNodeType());
    }
  }
  IWizard wizard=getWizard(PlatformUI.getWorkbench(),creation,repositoryNode,getExistingNames());
  if (isToolbar()) {
    init(repositoryNode);
  }
  WizardDialog wizardDialog=new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),wizard);
  if (Platform.getOS().equals(Platform.OS_LINUX)) {
    wizardDialog.setPageSize(getWizardWidth(),getWizardHeight() + 80);
  }
  wizardDialog.create();
  wizardDialog.open();
}
Program: 125019
Project: 125019
Buggy source:
private void addHadoopPropertiesFields(){
  Composite compositeTable=Form.startNewDimensionnedGridLayout(this,1,this.getBorderWidth(),150);
  GridData gridData=new GridData(GridData.FILL_BOTH);
  gridData.horizontalSpan=4;
  compositeTable.setLayoutData(gridData);
  CommandStackForComposite commandStack=new CommandStackForComposite(compositeTable);
  properties=new ArrayList<HashMap<String,Object>>();
  initHadoopProperties();
  HadoopPropertiesFieldModel model=new HadoopPropertiesFieldModel(properties,"String_Node_Str");
  propertiesTableView=new HadoopPropertiesTableView(model,compositeTable);
  propertiesTableView.getExtendedTableViewer().setCommandStack(commandStack);
  final Composite fieldTableEditorComposite=propertiesTableView.getMainComposite();
  fieldTableEditorComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
  fieldTableEditorComposite.setBackground(null);
}

Fixed version (ground truth):
private void addHadoopPropertiesFields(){
  Composite compositeTable=Form.startNewDimensionnedGridLayout(this,1,this.getBorderWidth(),150);
  GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
  gridData.horizontalSpan=4;
  compositeTable.setLayoutData(gridData);
  CommandStackForComposite commandStack=new CommandStackForComposite(compositeTable);
  properties=new ArrayList<HashMap<String,Object>>();
  initHadoopProperties();
  HadoopPropertiesFieldModel model=new HadoopPropertiesFieldModel(properties,"String_Node_Str");
  propertiesTableView=new HadoopPropertiesTableView(model,compositeTable);
  propertiesTableView.getExtendedTableViewer().setCommandStack(commandStack);
  final Composite fieldTableEditorComposite=propertiesTableView.getMainComposite();
  gridData=new GridData(GridData.FILL_HORIZONTAL);
  gridData.heightHint=180;
  fieldTableEditorComposite.setLayoutData(gridData);
  fieldTableEditorComposite.setBackground(null);
}
Program: 125020
Project: 125020
Buggy source:
private void addHadoopPropertiesFields(){
  Composite compositeTable=Form.startNewDimensionnedGridLayout(this,1,this.getBorderWidth(),150);
  GridData gridData=new GridData(GridData.FILL_BOTH);
  gridData.horizontalSpan=4;
  compositeTable.setLayoutData(gridData);
  CommandStackForComposite commandStack=new CommandStackForComposite(compositeTable);
  properties=new ArrayList<HashMap<String,Object>>();
  initHadoopProperties();
  HadoopPropertiesFieldModel model=new HadoopPropertiesFieldModel(properties,"String_Node_Str");
  propertiesTableView=new HadoopPropertiesTableView(model,compositeTable);
  propertiesTableView.getExtendedTableViewer().setCommandStack(commandStack);
  final Composite fieldTableEditorComposite=propertiesTableView.getMainComposite();
  fieldTableEditorComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
  fieldTableEditorComposite.setBackground(null);
}

Fixed version (ground truth):
private void addHadoopPropertiesFields(){
  Composite compositeTable=Form.startNewDimensionnedGridLayout(this,1,this.getBorderWidth(),150);
  GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
  gridData.horizontalSpan=4;
  compositeTable.setLayoutData(gridData);
  CommandStackForComposite commandStack=new CommandStackForComposite(compositeTable);
  properties=new ArrayList<HashMap<String,Object>>();
  initHadoopProperties();
  HadoopPropertiesFieldModel model=new HadoopPropertiesFieldModel(properties,"String_Node_Str");
  propertiesTableView=new HadoopPropertiesTableView(model,compositeTable);
  propertiesTableView.getExtendedTableViewer().setCommandStack(commandStack);
  final Composite fieldTableEditorComposite=propertiesTableView.getMainComposite();
  gridData=new GridData(GridData.FILL_HORIZONTAL);
  gridData.heightHint=180;
  fieldTableEditorComposite.setLayoutData(gridData);
  fieldTableEditorComposite.setBackground(null);
}
Program: 125023
Project: 125023
Buggy source:
private static WebClient getHCatalogRootClient(HCatalogConnection connection){
  String host=StringUtils.trimToEmpty(connection.getHostName());
  String port=StringUtils.trimToEmpty(connection.getPort());
  String userName=StringUtils.trimToEmpty(connection.getUserName());
  String path="String_Node_Str" + host + "String_Node_Str"+ port+ "String_Node_Str"+ userName;
  return WebClient.create(path);
}

Fixed version (ground truth):
private static WebClient getHCatalogRootClient(HCatalogConnection connection){
  String host=StringUtils.trimToEmpty(connection.getHostName());
  String port=StringUtils.trimToEmpty(connection.getPort());
  String userName=StringUtils.trimToEmpty(connection.getUserName());
  String path="String_Node_Str" + host + "String_Node_Str"+ port+ "String_Node_Str"+ userName;
  WebClient client=WebClient.create(path);
  addKerberos2Client(client,connection);
  return client;
}
Program: 125024
Project: 125024
Buggy source:
public static JSONObject getDataFromHCatalog(WebClient client,String tableName) throws Exception {
  Response response=client.get();
  InputStream inputStream=(InputStream)response.getEntity();
  String input=IOUtils.toString(inputStream);
  JSONObject jsonObject=(JSONObject)JSONValue.parse(input);
  String errorMsgDetail="String_Node_Str";
  Object errorObj=jsonObject.get("String_Node_Str");
  if (errorObj != null) {
    errorMsgDetail=errorObj.toString();
  }
  int status=response.getStatus();
  if (status != 200) {
switch (status) {
case 400:
      throw new Exception("String_Node_Str" + errorMsgDetail);
case 401:
    throw new Exception("String_Node_Str" + errorMsgDetail);
case 404:
  throw new Exception("String_Node_Str" + errorMsgDetail);
case 500:
if (("String_Node_Str" + tableName + "String_Node_Str").equals(errorMsgDetail)) {
  CommonExceptionHandler.warn("String_Node_Str" + errorMsgDetail);
}
 else {
  throw new Exception("String_Node_Str" + errorMsgDetail);
}
break;
case 503:
throw new Exception("String_Node_Str" + errorMsgDetail);
default :
throw new Exception(jsonObject.get("String_Node_Str") + "String_Node_Str" + jsonObject.get("String_Node_Str")+ jsonObject.get("String_Node_Str"));
}
}
return jsonObject;
}

Fixed version (ground truth):
public static JSONObject getDataFromHCatalog(WebClient client,String tableName) throws Exception {
  Response response=client.get();
  InputStream inputStream=(InputStream)response.getEntity();
  String input=IOUtils.toString(inputStream);
  JSONObject jsonObject=(JSONObject)JSONValue.parse(input);
  if (jsonObject == null) {
    throw new Exception(input);
  }
  String errorMsgDetail="String_Node_Str";
  Object errorObj=jsonObject.get("String_Node_Str");
  if (errorObj != null) {
    errorMsgDetail=errorObj.toString();
  }
  int status=response.getStatus();
  if (status != 200) {
switch (status) {
case 400:
      throw new Exception("String_Node_Str" + errorMsgDetail);
case 401:
    throw new Exception("String_Node_Str" + errorMsgDetail);
case 404:
  throw new Exception("String_Node_Str" + errorMsgDetail);
case 500:
if (("String_Node_Str" + tableName + "String_Node_Str").equals(errorMsgDetail)) {
  CommonExceptionHandler.warn("String_Node_Str" + errorMsgDetail);
}
 else {
  throw new Exception("String_Node_Str" + errorMsgDetail);
}
break;
case 503:
throw new Exception("String_Node_Str" + errorMsgDetail);
default :
throw new Exception(jsonObject.get("String_Node_Str") + "String_Node_Str" + jsonObject.get("String_Node_Str")+ jsonObject.get("String_Node_Str"));
}
}
return jsonObject;
}
Program: 125025
Project: 125025
Buggy source:
/** 
 * DOC ycbai Comment method "getHCatalogDBClient".
 * @param connection
 * @return the HCatalog client of the special database from HCatalogConnection.
 */
public static WebClient getHCatalogDBClient(HCatalogConnection connection){
  String database=StringUtils.trimToEmpty(connection.getDatabase());
  WebClient client=getHCatalogClient(connection,database);
  addKerberos2Client(client,connection);
  return client;
}

Fixed version (ground truth):
/** 
 * DOC ycbai Comment method "getHCatalogDBClient".
 * @param connection
 * @return the HCatalog client of the special database from HCatalogConnection.
 */
public static WebClient getHCatalogDBClient(HCatalogConnection connection){
  String database=StringUtils.trimToEmpty(connection.getDatabase());
  WebClient client=getHCatalogClient(connection,database);
  return client;
}
Program: 125026
Project: 125026
Buggy source:
public AppConfigurationEntry[] getAppConfigurationEntry(String name){
  return new AppConfigurationEntry[]{new AppConfigurationEntry("String_Node_Str",AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,properties)};
}

Fixed version (ground truth):
@Override public AppConfigurationEntry[] getAppConfigurationEntry(String name){
  return new AppConfigurationEntry[]{new AppConfigurationEntry(Krb5LoginModule.class.getName(),AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,properties)};
}
Program: 125027
Project: 125027
Buggy source:
private boolean isValidFolder(IRepositoryNode node){
  if (node.getObjectType() != null && node.getObjectType().equals(HadoopClusterRepositoryNodeType.HADOOPCLUSTER)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean isValidFolder(IRepositoryNode node){
  ERepositoryObjectType repObjType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (repObjType != null && repObjType.equals(HadoopClusterRepositoryNodeType.HADOOPCLUSTER)) {
    return true;
  }
  return false;
}
Program: 125028
Project: 125028
Buggy source:
public static ClassLoader getCustomClassLoader(IMetadataConnection metadataConnection){
  String hcId=metadataConnection.getId();
  String index="String_Node_Str" + hcId;
  return ClassLoaderFactory.getCustomClassLoader(index,(String)metadataConnection.getParameter(ECustomVersionGroup.HBASE.getName()));
}

Fixed version (ground truth):
public static ClassLoader getCustomClassLoader(IMetadataConnection metadataConnection){
  String hcId=metadataConnection.getId();
  String index="String_Node_Str" + hcId;
  return ClassLoaderFactory.getCustomClassLoader(index,(String)metadataConnection.getParameter(ConnParameterKeys.CONN_PARA_KEY_HADOOP_CUSTOM_JARS));
}
Program: 125031
Project: 125031
Buggy source:
private Object getAdmin(IMetadataConnection metadataConnection){
  Object hAdmin=adminMap.get(metadataConnection);
  if (hAdmin == null) {
    ClassLoader oldClassLoaderLoader=Thread.currentThread().getContextClassLoader();
    try {
      Thread.currentThread().setContextClassLoader(classLoader);
      Object config=ReflectionUtils.invokeStaticMethod("String_Node_Str",classLoader,"String_Node_Str",new Object[0]);
      ReflectionUtils.invokeMethod(config,"String_Node_Str",new Object[]{"String_Node_Str",metadataConnection.getServerName()});
      ReflectionUtils.invokeMethod(config,"String_Node_Str",new Object[]{"String_Node_Str",metadataConnection.getPort()});
      hAdmin=ReflectionUtils.newInstance("String_Node_Str",classLoader,new Object[]{config});
      adminMap.put(metadataConnection,hAdmin);
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
 finally {
      Thread.currentThread().setContextClassLoader(oldClassLoaderLoader);
    }
  }
  return hAdmin;
}

Fixed version (ground truth):
private Object getAdmin(IMetadataConnection metadataConnection){
  Object hAdmin=adminMap.get(metadataConnection);
  if (hAdmin == null) {
    ClassLoader oldClassLoaderLoader=Thread.currentThread().getContextClassLoader();
    try {
      Thread.currentThread().setContextClassLoader(classLoader);
      Object config=ReflectionUtils.invokeStaticMethod("String_Node_Str",classLoader,"String_Node_Str",new Object[0]);
      ReflectionUtils.invokeMethod(config,"String_Node_Str",new Object[]{"String_Node_Str",metadataConnection.getServerName()});
      ReflectionUtils.invokeMethod(config,"String_Node_Str",new Object[]{"String_Node_Str",metadataConnection.getPort()});
      ReflectionUtils.invokeMethod(config,"String_Node_Str",new Object[]{"String_Node_Str",metadataConnection.getPort()});
      hAdmin=ReflectionUtils.newInstance("String_Node_Str",classLoader,new Object[]{config});
      adminMap.put(metadataConnection,hAdmin);
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
 finally {
      Thread.currentThread().setContextClassLoader(oldClassLoaderLoader);
    }
  }
  return hAdmin;
}
Program: 125032
Project: 125032
Buggy source:
private boolean isExistTable(IHDFSNode node){
  if (node != null && node.getType() == EHadoopFileTypes.FILE) {
    String tabLabel=MetadataToolHelper.validateTableName(node.getTable().getName());
    return HDFSSchemaUtil.getTableByLabel(getConnection(),tabLabel) != null;
  }
  return false;
}

Fixed version (ground truth):
private boolean isExistTable(IHDFSNode node){
  if (node != null && node.getType() == EHadoopFileTypes.FILE) {
    return HDFSSchemaUtil.getTableByLabel(getConnection(),node.getTable().getName()) != null;
  }
  return false;
}
Program: 125033
Project: 125033
Buggy source:
public static MetadataTable getTableByLabel(HDFSConnection connection,String label){
  if (label != null) {
    for (    Object obj : ConnectionHelper.getTables(connection)) {
      if (obj == null) {
        continue;
      }
      MetadataTable table=(MetadataTable)obj;
      if (table.getLabel().equals(label)) {
        return table;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public static MetadataTable getTableByLabel(HDFSConnection connection,String tableLabel){
  if (tableLabel != null) {
    String label=MetadataToolHelper.validateTableName(tableLabel);
    for (    Object obj : ConnectionHelper.getTables(connection)) {
      if (obj == null) {
        continue;
      }
      MetadataTable table=(MetadataTable)obj;
      if (table.getLabel().equals(label)) {
        return table;
      }
    }
  }
  return null;
}
Program: 125034
Project: 125034
Buggy source:
/** 
 * DOC ycbai Comment method "updateHadoopClusterConnection".
 * @param connectionItem
 * @param show
 * @param onlySimpleShow
 * @return
 */
public static boolean updateHadoopClusterConnection(ConnectionItem connectionItem,boolean show,final boolean onlySimpleShow){
  List<RelationshipItemBuilder.Relation> relations=RelationshipItemBuilder.getInstance().getItemsRelatedTo(connectionItem.getProperty().getId(),RelationshipItemBuilder.LATEST_VERSION,RelationshipItemBuilder.PROPERTY_RELATION);
  RepositoryUpdateManager repositoryUpdateManager=new RepositoryUpdateManager(connectionItem.getConnection(),relations){
    @Override public Set<EUpdateItemType> getTypes(){
      Set<EUpdateItemType> types=new HashSet<EUpdateItemType>();
      types.add(EUpdateItemType.NODE_PROPERTY);
      return types;
    }
  }
;
  return repositoryUpdateManager.doWork(true,false);
}

Fixed version (ground truth):
/** 
 * DOC ycbai Comment method "updateHadoopClusterConnection".
 * @param connectionItem
 * @param show
 * @param onlySimpleShow
 * @return
 */
public static boolean updateHadoopClusterConnection(ConnectionItem connectionItem,boolean show,final boolean onlySimpleShow){
  List<RelationshipItemBuilder.Relation> relations=RelationshipItemBuilder.getInstance().getItemsRelatedTo(connectionItem.getProperty().getId(),RelationshipItemBuilder.LATEST_VERSION,RelationshipItemBuilder.PROPERTY_RELATION);
  RepositoryUpdateManager repositoryUpdateManager=new RepositoryUpdateManager(connectionItem.getConnection(),relations){
    @Override public Set<EUpdateItemType> getTypes(){
      Set<EUpdateItemType> types=new HashSet<EUpdateItemType>();
      types.add(EUpdateItemType.NODE_PROPERTY);
      types.add(EUpdateItemType.JOB_PROPERTY_MAPREDUCE);
      return types;
    }
  }
;
  return repositoryUpdateManager.doWork(true,false);
}
Program: 125035
Project: 125035
Buggy source:
@Override public Set<EUpdateItemType> getTypes(){
  Set<EUpdateItemType> types=new HashSet<EUpdateItemType>();
  types.add(EUpdateItemType.NODE_PROPERTY);
  return types;
}

Fixed version (ground truth):
@Override public Set<EUpdateItemType> getTypes(){
  Set<EUpdateItemType> types=new HashSet<EUpdateItemType>();
  types.add(EUpdateItemType.NODE_PROPERTY);
  types.add(EUpdateItemType.JOB_PROPERTY_MAPREDUCE);
  return types;
}
Program: 125038
Project: 125038
Buggy source:
private boolean isExistTable(IHDFSNode node){
  if (node != null && node.getType() == EHadoopFileTypes.FILE) {
    return HDFSSchemaUtil.getTableByName(getConnection(),node.getTable().getName()) != null;
  }
  return false;
}

Fixed version (ground truth):
private boolean isExistTable(IHDFSNode node){
  if (node != null && node.getType() == EHadoopFileTypes.FILE) {
    String tabName=MetadataToolHelper.validateTableName(node.getTable().getName());
    return HDFSSchemaUtil.getTableByName(getConnection(),tabName) != null;
  }
  return false;
}
Program: 125039
Project: 125039
Buggy source:
@Override public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  setDefaultPageImageDescriptor(ImageProvider.getImageDesc(EHCatalogImage.HCATALOG_WIZ));
  if (isToolBar) {
    pathToSave=null;
  }
  propertiesPage=new Step0WizardPage(connectionProperty,pathToSave,ERepositoryObjectType.METADATA_CONNECTIONS,!isRepositoryObjectEditable(),creation);
  mainPage=new HCatalogWizardPage(connectionItem,isRepositoryObjectEditable(),existingNames);
  if (creation) {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(false);
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(false);
  }
 else {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(isRepositoryObjectEditable());
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(propertiesPage);
  addPage(mainPage);
}

Fixed version (ground truth):
@Override public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  setDefaultPageImageDescriptor(ImageProvider.getImageDesc(EHCatalogImage.HCATALOG_WIZ));
  if (isToolBar) {
    pathToSave=null;
  }
  propertiesPage=new HadoopPropertiesWizardPage("String_Node_Str",connectionProperty,pathToSave,HCatalogRepositoryNodeType.HCATALOG,!isRepositoryObjectEditable());
  mainPage=new HCatalogWizardPage(connectionItem,isRepositoryObjectEditable(),existingNames);
  if (creation) {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(false);
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(false);
  }
 else {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(isRepositoryObjectEditable());
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(propertiesPage);
  addPage(mainPage);
}
Program: 125040
Project: 125040
Buggy source:
@Override public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  setDefaultPageImageDescriptor(ImageProvider.getImageDesc(EHDFSImage.HDFS_WIZ));
  if (isToolBar) {
    pathToSave=null;
  }
  propertiesPage=new Step0WizardPage(connectionProperty,pathToSave,ERepositoryObjectType.METADATA_CONNECTIONS,!isRepositoryObjectEditable(),creation);
  mainPage=new HDFSWizardPage(connectionItem,isRepositoryObjectEditable(),existingNames);
  if (creation) {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(false);
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(false);
  }
 else {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(isRepositoryObjectEditable());
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(propertiesPage);
  addPage(mainPage);
}

Fixed version (ground truth):
@Override public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  setDefaultPageImageDescriptor(ImageProvider.getImageDesc(EHDFSImage.HDFS_WIZ));
  if (isToolBar) {
    pathToSave=null;
  }
  propertiesPage=new HadoopPropertiesWizardPage("String_Node_Str",connectionProperty,pathToSave,HDFSRepositoryNodeType.HDFS,!isRepositoryObjectEditable());
  mainPage=new HDFSWizardPage(connectionItem,isRepositoryObjectEditable(),existingNames);
  if (creation) {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(false);
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(false);
  }
 else {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(isRepositoryObjectEditable());
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(propertiesPage);
  addPage(mainPage);
}
Program: 125041
Project: 125041
Buggy source:
@Override public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  setDefaultPageImageDescriptor(ImageProvider.getImageDesc(EHadoopClusterImage.HADOOPCLUSTER_WIZ));
  if (isToolBar) {
    pathToSave=null;
  }
  propertiesPage=new Step0WizardPage(connectionProperty,pathToSave,ERepositoryObjectType.METADATA_CONNECTIONS,!isRepositoryObjectEditable(),creation);
  mainPage=new HadoopClusterWizardPage(connectionItem,isRepositoryObjectEditable(),existingNames);
  if (creation) {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(false);
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(false);
  }
 else {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(isRepositoryObjectEditable());
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(propertiesPage);
  addPage(mainPage);
}

Fixed version (ground truth):
@Override public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  setDefaultPageImageDescriptor(ImageProvider.getImageDesc(EHadoopClusterImage.HADOOPCLUSTER_WIZ));
  if (isToolBar) {
    pathToSave=null;
  }
  propertiesPage=new HadoopPropertiesWizardPage("String_Node_Str",connectionProperty,pathToSave,HadoopClusterRepositoryNodeType.HADOOPCLUSTER,!isRepositoryObjectEditable(),creation);
  mainPage=new HadoopClusterWizardPage(connectionItem,isRepositoryObjectEditable(),existingNames);
  if (creation) {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(false);
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(false);
  }
 else {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(isRepositoryObjectEditable());
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(propertiesPage);
  addPage(mainPage);
}
Program: 125042
Project: 125042
Buggy source:
@Override public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  setDefaultPageImageDescriptor(ImageProvider.getImageDesc(EOozieImage.OOZIE_WIZ));
  if (isToolBar) {
    pathToSave=null;
  }
  propertiesPage=new Step0WizardPage(connectionProperty,pathToSave,ERepositoryObjectType.METADATA_CONNECTIONS,!isRepositoryObjectEditable(),creation);
  mainPage=new OozieWizardPage(connectionItem,isRepositoryObjectEditable(),existingNames);
  if (creation) {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(false);
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(false);
  }
 else {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(isRepositoryObjectEditable());
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(propertiesPage);
  addPage(mainPage);
}

Fixed version (ground truth):
@Override public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  setDefaultPageImageDescriptor(ImageProvider.getImageDesc(EOozieImage.OOZIE_WIZ));
  if (isToolBar) {
    pathToSave=null;
  }
  propertiesPage=new HadoopPropertiesWizardPage("String_Node_Str",connectionProperty,pathToSave,OozieRepositoryNodeType.OOZIE,!isRepositoryObjectEditable());
  mainPage=new OozieWizardPage(connectionItem,isRepositoryObjectEditable(),existingNames);
  if (creation) {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(false);
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(false);
  }
 else {
    propertiesPage.setTitle(Messages.getString("String_Node_Str"));
    propertiesPage.setDescription(Messages.getString("String_Node_Str"));
    propertiesPage.setPageComplete(isRepositoryObjectEditable());
    mainPage.setTitle(Messages.getString("String_Node_Str"));
    mainPage.setDescription(Messages.getString("String_Node_Str"));
    mainPage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(propertiesPage);
  addPage(mainPage);
}