nus-yam/ex-repair huggingface dataset:
Program: 124917
Project: 124917
Buggy source:
private static Callable<Object> getDFS(final URI uri,final Object conf,final String userName,final ClassLoader classLoader){
  return new Callable<Object>(){
    @Override public Object call() throws Exception {
      return ReflectionUtils.invokeStaticMethod("String_Node_Str",classLoader,"String_Node_Str",new Object[]{uri,conf,userName});
    }
  }
;
}

Fixed version (ground truth):
/** 
 * DOC ycbai Comment method "getDFS". Provides access to the HDFS System.
 * @param connection
 * @return
 * @throws HadoopServerException
 */
public static Object getDFS(HDFSConnectionBean connection) throws HadoopServerException {
  if (connection == null) {
    return null;
  }
  String nameNodeURI=connection.getNameNodeURI();
  if (nameNodeURI == null) {
    return null;
  }
  Object dfs=null;
  ClassLoader oldClassLoaderLoader=Thread.currentThread().getContextClassLoader();
  try {
    ClassLoader classLoader=getClassLoader(connection);
    Thread.currentThread().setContextClassLoader(classLoader);
    Object conf=getConfiguration(connection);
    boolean enableKerberos=connection.isEnableKerberos();
    String userName=StringUtils.trimToNull(connection.getUserName());
    if (enableKerberos) {
      userName=null;
    }
    String group=StringUtils.trimToNull(connection.getGroup());
    if (userName == null || group != null) {
      dfs=ReflectionUtils.invokeStaticMethod("String_Node_Str",classLoader,"String_Node_Str",new Object[]{conf});
    }
 else {
      dfs=ReflectionUtils.invokeStaticMethod("String_Node_Str",classLoader,"String_Node_Str",new Object[]{new URI(EHadoopConfProperties.FS_DEFAULT_URI.get(conf)),conf,userName});
    }
  }
 catch (  Exception e) {
    throw new HadoopServerException(e);
  }
 finally {
    Thread.currentThread().setContextClassLoader(oldClassLoaderLoader);
  }
  return dfs;
}
Program: 124919
Project: 124919
Buggy source:
@Override public void setComponentValue(Connection connection,INode node,String repositoryValue){
  if (node != null && canHandle(connection)) {
    setHadoopClusterRepositoryValue((HadoopClusterConnection)connection,node,repositoryValue);
  }
}

Fixed version (ground truth):
@Override public void setComponentValue(Connection connection,INode node,IElementParameter param){
  if (node != null && canHandle(connection)) {
    setHadoopClusterRepositoryValue((HadoopClusterConnection)connection,node,param);
  }
}
Program: 124920
Project: 124920
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<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);
}

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<Relation> relations=RelationshipItemBuilder.getInstance().getItemsRelatedTo(connectionItem.getProperty().getId(),RelationshipItemBuilder.LATEST_VERSION,RelationshipItemBuilder.PROPERTY_RELATION);
  RepositoryUpdateManager repositoryUpdateManager=new RepositoryUpdateManager(connectionItem,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: 124921
Project: 124921
Buggy source:
@Override public void setComponentValue(Connection connection,INode node,String repositoryValue){
  if (node != null && canHandle(connection)) {
    setHCatalogRepositoryValue((HCatalogConnection)connection,node,repositoryValue);
  }
}

Fixed version (ground truth):
@Override public void setComponentValue(Connection connection,INode node,IElementParameter param){
  if (node != null && canHandle(connection)) {
    setHCatalogRepositoryValue((HCatalogConnection)connection,node,param);
  }
}
Program: 124923
Project: 124923
Buggy source:
/** 
 * DOC ycbai Comment method "updateHCatalogConnection".
 * @param connectionItem
 * @param show
 * @param onlySimpleShow
 * @return
 */
public static boolean updateHCatalogConnection(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 "updateHCatalogConnection".
 * @param connectionItem
 * @param show
 * @param onlySimpleShow
 * @return
 */
public static boolean updateHCatalogConnection(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,relations){
    @Override public Set<EUpdateItemType> getTypes(){
      Set<EUpdateItemType> types=new HashSet<EUpdateItemType>();
      types.add(EUpdateItemType.NODE_PROPERTY);
      return types;
    }
  }
;
  return repositoryUpdateManager.doWork(true,false);
}
Program: 124924
Project: 124924
Buggy source:
public boolean checkIfAllValidOrNot(){
  boolean okBtnIsEnabled=false;
  boolean startTimeHasValue=hasStartTimeValue();
  boolean endTimeHasValue=hasEndTimeValue();
  boolean frequencyValueIsValid=checkFrequencyValue();
  if (startTimeHasValue && endTimeHasValue && frequencyValueIsValid)   okBtnIsEnabled=true;
 else   okBtnIsEnabled=false;
  return okBtnIsEnabled;
}

Fixed version (ground truth):
public boolean checkIfAllValidOrNot(){
  boolean okBtnIsEnabled=false;
  boolean checkTimeValue=checkTime();
  boolean frequencyValueIsValid=checkFrequencyValue();
  if (checkTimeValue && frequencyValueIsValid)   okBtnIsEnabled=true;
 else   okBtnIsEnabled=false;
  return okBtnIsEnabled;
}
Program: 124925
Project: 124925
Buggy source:
public boolean checkIfAllValidOrNot(){
  boolean okBtnIsEnabled=false;
  boolean startTimeHasValue=hasStartTimeValue();
  boolean endTimeHasValue=hasEndTimeValue();
  boolean frequencyValueIsValid=checkFrequencyValue();
  if (startTimeHasValue && endTimeHasValue && frequencyValueIsValid)   okBtnIsEnabled=true;
 else   okBtnIsEnabled=false;
  return okBtnIsEnabled;
}

Fixed version (ground truth):
public boolean checkIfAllValidOrNot(){
  boolean okBtnIsEnabled=false;
  boolean checkTimeValue=checkTime();
  boolean frequencyValueIsValid=checkFrequencyValue();
  if (checkTimeValue && frequencyValueIsValid)   okBtnIsEnabled=true;
 else   okBtnIsEnabled=false;
  return okBtnIsEnabled;
}
Program: 124926
Project: 124926
Buggy source:
/** 
 * DOC ycbai Comment method "testConnection". Test whether can connect to HDFS.
 * @return
 */
public static ConnectionStatus testConnection(HDFSConnectionBean connection){
  ConnectionStatus connectionStatus=new ConnectionStatus();
  connectionStatus.setResult(false);
  String errorMsg="String_Node_Str" + connection.getNameNodeURI() + "String_Node_Str";
  Object dfs=null;
  try {
    dfs=getDFS(connection);
    if (dfs != null) {
      connectionStatus.setResult(true);
      connectionStatus.setMessageException("String_Node_Str");
    }
 else {
      connectionStatus.setMessageException(errorMsg);
    }
  }
 catch (  Exception e) {
    Set<String> jars=getMissingJars(connection);
    String missJarMsg="String_Node_Str";
    if (jars.size() > 0) {
      missJarMsg="String_Node_Str" + jars.toString() + "String_Node_Str"+ "String_Node_Str";
    }
    ExceptionHandler.process(e);
    connectionStatus.setMessageException(errorMsg + "String_Node_Str" + missJarMsg);
  }
 finally {
    if (dfs != null) {
      try {
        ReflectionUtils.invokeMethod(dfs,"String_Node_Str",new Object[0]);
      }
 catch (      Exception e) {
      }
    }
  }
  return connectionStatus;
}

Fixed version (ground truth):
/** 
 * DOC ycbai Comment method "testConnection". Test whether can connect to HDFS.
 * @return
 */
public static ConnectionStatus testConnection(HDFSConnectionBean connection){
  ConnectionStatus connectionStatus=new ConnectionStatus();
  connectionStatus.setResult(false);
  String errorMsg="String_Node_Str" + connection.getNameNodeURI() + "String_Node_Str";
  Object dfs=null;
  try {
    dfs=getDFS(connection);
    if (dfs != null) {
      Object pathObj=ReflectionUtils.newInstance("String_Node_Str",getClassLoader(connection),new Object[]{ROOT_PATH});
      ReflectionUtils.invokeMethod(dfs,"String_Node_Str",new Object[]{pathObj});
      connectionStatus.setResult(true);
      connectionStatus.setMessageException("String_Node_Str");
    }
 else {
      connectionStatus.setMessageException(errorMsg);
    }
  }
 catch (  Exception e) {
    Set<String> jars=getMissingJars(connection);
    String missJarMsg="String_Node_Str";
    if (jars.size() > 0) {
      missJarMsg="String_Node_Str" + jars.toString() + "String_Node_Str"+ "String_Node_Str";
    }
    ExceptionHandler.process(e);
    connectionStatus.setMessageException(errorMsg + "String_Node_Str" + missJarMsg);
  }
 finally {
    if (dfs != null) {
      try {
        ReflectionUtils.invokeMethod(dfs,"String_Node_Str",new Object[0]);
      }
 catch (      Exception e) {
      }
    }
  }
  return connectionStatus;
}
Program: 124927
Project: 124927
Buggy source:
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
      ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
    if (nodeType != ERepositoryObjectType.PIG_UDF) {
      canWork=false;
    }
  if (node.getObject() != null && node.getObject().getProperty().getItem().getState().isDeleted()) {
    canWork=false;
  }
break;
default :
canWork=false;
}
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
canWork=false;
}
}
setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
      ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
    if (nodeType != ERepositoryObjectType.PIG_UDF) {
      canWork=false;
    }
  if (node.getObject() != null && node.getObject().isDeleted()) {
    canWork=false;
  }
break;
default :
canWork=false;
}
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
canWork=false;
}
}
setEnabled(canWork);
}
Program: 124928
Project: 124928
Buggy source:
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=selection.size() == 1;
  if (canWork) {
    Object o=selection.getFirstElement();
    if (o instanceof RepositoryNode) {
      RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case REPOSITORY_ELEMENT:
        if (node.getObjectType() == ERepositoryObjectType.PIG_UDF) {
          Item item=node.getObject().getProperty().getItem();
          if (item instanceof PigudfItem) {
            canWork=true;
          }
 else {
            canWork=false;
          }
        }
 else {
          canWork=false;
        }
      break;
default :
    canWork=false;
  break;
}
if (canWork) {
canWork=(node.getObject().getRepositoryStatus() != ERepositoryStatus.DELETED);
}
if (canWork) {
canWork=isLastVersion(node);
}
}
}
setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=selection.size() == 1;
  if (canWork) {
    boolean loadMetadata=PluginChecker.isPluginLoaded("String_Node_Str");
    if (!loadMetadata) {
      setEnabled(false);
      return;
    }
    Object o=selection.getFirstElement();
    if (o instanceof RepositoryNode) {
      RepositoryNode node=(RepositoryNode)o;
switch (node.getType()) {
case REPOSITORY_ELEMENT:
        if (node.getObjectType() == ERepositoryObjectType.PIG_UDF) {
          Item item=node.getObject().getProperty().getItem();
          if (item instanceof PigudfItem) {
            canWork=true;
          }
 else {
            canWork=false;
          }
        }
 else {
          canWork=false;
        }
      break;
default :
    canWork=false;
  break;
}
if (canWork) {
canWork=(node.getObject().getRepositoryStatus() != ERepositoryStatus.DELETED);
}
if (canWork) {
canWork=isLastVersion(node);
}
}
}
setEnabled(canWork);
}
Program: 124929
Project: 124929
Buggy source:
private void addHadoopPropertiesFields(Composite comp){
  Composite compositeTable=Form.startNewDimensionnedGridLayout(comp,1,comp.getBorderWidth(),150);
  GridData gridData=new GridData(GridData.FILL_BOTH);
  gridData.horizontalSpan=4;
  compositeTable.setLayoutData(gridData);
  CommandStackForComposite commandStack=new CommandStackForComposite(compositeTable);
  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 comp){
  Composite compositeTable=Form.startNewDimensionnedGridLayout(comp,1,comp.getBorderWidth(),150);
  GridData gridData=new GridData(GridData.FILL_BOTH);
  gridData.horizontalSpan=4;
  compositeTable.setLayoutData(gridData);
  CommandStackForComposite commandStack=new CommandStackForComposite(compositeTable);
  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);
}
Program: 124932
Project: 124932
Buggy source:
/** 
 * DOC Talend Comment method "getMissingJars".
 * @param connection
 * @return
 */
public static Set<String> getMissingJars(HDFSConnectionBean connection){
  Set<String> set=new HashSet<String>();
  Set<String> jars=new HashSet<String>();
  ClassLoader classLoader=HadoopClassLoaderFactory.getClassLoader(connection.getDistribution(),connection.getDfVersion(),false,false);
  if (classLoader instanceof DynamicClassLoader) {
    set.addAll(((DynamicClassLoader)classLoader).getLibraries());
  }
  List jarsNeed=ModulesNeededProvider.getModulesNeeded();
  for (  Object jar : jarsNeed) {
    if (jar instanceof ModuleNeeded) {
      String jarName=((ModuleNeeded)jar).getModuleName();
      if (set.contains(jarName) && ((ModuleNeeded)jar).getStatus().equals(ELibraryInstallStatus.NOT_INSTALLED)) {
        jars.add(jarName);
      }
    }
  }
  return jars;
}

Fixed version (ground truth):
/** 
 * DOC Talend Comment method "getMissingJars".
 * @param connection
 * @return
 */
public static Set<String> getMissingJars(HDFSConnectionBean connection){
  Set<String> set=new HashSet<String>();
  Set<String> jars=new HashSet<String>();
  ClassLoader classLoader=HadoopClassLoaderFactory.getClassLoader(connection.getDistribution(),connection.getDfVersion(),connection.isEnableKerberos(),false);
  if (classLoader instanceof DynamicClassLoader) {
    set.addAll(((DynamicClassLoader)classLoader).getLibraries());
  }
  List jarsNeed=ModulesNeededProvider.getModulesNeeded();
  for (  Object jar : jarsNeed) {
    if (jar instanceof ModuleNeeded) {
      String jarName=((ModuleNeeded)jar).getModuleName();
      if (set.contains(jarName) && ((ModuleNeeded)jar).getStatus().equals(ELibraryInstallStatus.NOT_INSTALLED)) {
        jars.add(jarName);
      }
    }
  }
  return jars;
}
Program: 124933
Project: 124933
Buggy source:
private String getUniqueTableEntry(List<? extends AbstractNode> nodeExisted,String nameToCreate){
  boolean exists=true;
  int counter=1;
  String newName=nameToCreate;
  while (exists) {
    boolean found=false;
    for (    AbstractNode node : nodeExisted) {
      if (node.getName().equals(newName)) {
        found=true;
        break;
      }
    }
    exists=found;
    if (!exists) {
      break;
    }
    newName=nameToCreate + "String_Node_Str" + counter++;
  }
  return newName;
}

Fixed version (ground truth):
private String getUniqueTableEntry(List<? extends AbstractNode> nodeExisted,String nameToCreate){
  boolean exists=true;
  int counter=1;
  String newName=nameToCreate;
  while (exists) {
    boolean found=false;
    for (    AbstractNode node : nodeExisted) {
      if (node.getName().equalsIgnoreCase(newName)) {
        found=true;
        break;
      }
    }
    exists=found;
    if (!exists) {
      break;
    }
    newName=nameToCreate + "String_Node_Str" + counter++;
  }
  return newName;
}
Program: 124934
Project: 124934
Buggy source:
public void search(String searchText){
  if (searchMaps.size() > 0) {
    if (!searchZoneMapper.isHightlightAll()) {
      searchZoneMapper.hightlightAll(searchMaps,false);
    }
 else {
      searchZoneMapper.hightlightAll(searchMaps,true);
    }
    searchMaps.clear();
  }
  searchZoneMapper.search(searchMaps,searchText);
  selectKey=searchZoneMapper.selectHightlight(searchMaps,0,"String_Node_Str");
}

Fixed version (ground truth):
public void search(String searchText){
  if (searchMaps.size() > 0) {
    searchZoneMapper.hightlightAll(searchMaps,false);
    searchZoneMapper.setHightlightAll(false);
    searchMaps.clear();
  }
  searchZoneMapper.search(searchMaps,searchText);
  selectKey=searchZoneMapper.selectHightlight(searchMaps,0,"String_Node_Str");
}
Program: 124936
Project: 124936
Buggy source:
public SearchZoneMapper(MapperManager mapperManager){
  this.mapperManager=mapperManager;
}

Fixed version (ground truth):
public SearchZoneMapper(MapperManager mapperManager){
  this.mapperManager=mapperManager;
  matcher=new SearchPattern();
}
Program: 124937
Project: 124937
Buggy source:
public static ClassLoader getClassLoader(ECustomVersionType type,String distribution,String version,boolean enableKerberos){
  if (type == null) {
    return HadoopClassLoaderFactory.class.getClassLoader();
  }
  String baseIndex=type.getName() + "String_Node_Str" + distribution+ "String_Node_Str"+ version;
  String index=baseIndex;
  String hive_embeded=null;
switch (type) {
case HDFS:
    if (enableKerberos) {
      index+="String_Node_Str";
    }
  break;
case HIVE:
index+="String_Node_Str" + STANDALONE;
hive_embeded="String_Node_Str" + EMBEDDED;
break;
}
ClassLoader loader=ClassLoaderFactory.getClassLoader(index);
if (loader == null && hive_embeded != null) {
index=baseIndex + hive_embeded;
loader=ClassLoaderFactory.getClassLoader(index);
}
if (loader == null) {
loader=HadoopClassLoaderFactory.class.getClassLoader();
}
return loader;
}

Fixed version (ground truth):
public static ClassLoader getClassLoader(ECustomVersionType type,String distribution,String version,boolean enableKerberos,boolean showDownloadIfNotExist){
  if (type == null) {
    return HadoopClassLoaderFactory.class.getClassLoader();
  }
  String baseIndex=type.getName() + "String_Node_Str" + distribution+ "String_Node_Str"+ version;
  String index=baseIndex;
  String hive_embeded=null;
switch (type) {
case HDFS:
    if (enableKerberos) {
      index+="String_Node_Str";
    }
  break;
case HIVE:
index+="String_Node_Str" + STANDALONE;
hive_embeded="String_Node_Str" + EMBEDDED;
break;
}
ClassLoader loader=ClassLoaderFactory.getClassLoader(index,showDownloadIfNotExist);
if (loader == null && hive_embeded != null) {
index=baseIndex + hive_embeded;
loader=ClassLoaderFactory.getClassLoader(index,showDownloadIfNotExist);
}
if (loader == null) {
loader=HadoopClassLoaderFactory.class.getClassLoader();
}
return loader;
}
Program: 124938
Project: 124938
Buggy source:
/** 
 * DOC Talend Comment method "getMissingJars".
 * @param connection
 * @return
 */
public static Set<String> getMissingJars(HDFSConnectionBean connection){
  Set<String> set=new HashSet<String>();
  Set<String> jars=new HashSet<String>();
  ClassLoader classLoader=HadoopClassLoaderFactory.getClassLoader(connection.getDistribution(),connection.getDfVersion());
  if (classLoader instanceof DynamicClassLoader) {
    set.addAll(((DynamicClassLoader)classLoader).getLibraries());
  }
  List jarsNeed=ModulesNeededProvider.getModulesNeeded();
  for (  Object jar : jarsNeed) {
    if (jar instanceof ModuleNeeded) {
      String jarName=((ModuleNeeded)jar).getModuleName();
      if (set.contains(jarName) && ((ModuleNeeded)jar).getStatus().equals(ELibraryInstallStatus.NOT_INSTALLED)) {
        jars.add(jarName);
      }
    }
  }
  return jars;
}

Fixed version (ground truth):
/** 
 * DOC Talend Comment method "getMissingJars".
 * @param connection
 * @return
 */
public static Set<String> getMissingJars(HDFSConnectionBean connection){
  Set<String> set=new HashSet<String>();
  Set<String> jars=new HashSet<String>();
  ClassLoader classLoader=HadoopClassLoaderFactory.getClassLoader(connection.getDistribution(),connection.getDfVersion(),false,false);
  if (classLoader instanceof DynamicClassLoader) {
    set.addAll(((DynamicClassLoader)classLoader).getLibraries());
  }
  List jarsNeed=ModulesNeededProvider.getModulesNeeded();
  for (  Object jar : jarsNeed) {
    if (jar instanceof ModuleNeeded) {
      String jarName=((ModuleNeeded)jar).getModuleName();
      if (set.contains(jarName) && ((ModuleNeeded)jar).getStatus().equals(ELibraryInstallStatus.NOT_INSTALLED)) {
        jars.add(jarName);
      }
    }
  }
  return jars;
}
Program: 124939
Project: 124939
Buggy source:
@Override public Set<String> getHadoopLibrariesByType(ECustomVersionType type,String distribution,String version){
  Set<String> set=new HashSet<String>();
  ClassLoader classLoader=HadoopClassLoaderFactory.getClassLoader(type,distribution,version,false);
  if (classLoader instanceof DynamicClassLoader) {
    set.addAll(((DynamicClassLoader)classLoader).getLibraries());
  }
  return set;
}

Fixed version (ground truth):
@Override public Set<String> getHadoopLibrariesByType(ECustomVersionType type,String distribution,String version){
  Set<String> set=new HashSet<String>();
  ClassLoader classLoader=HadoopClassLoaderFactory.getClassLoader(type,distribution,version,false,false);
  if (classLoader instanceof DynamicClassLoader) {
    set.addAll(((DynamicClassLoader)classLoader).getLibraries());
  }
  return set;
}
Program: 124940
Project: 124940
Buggy source:
@Override public Set<String> getMissingLibraries(String distribution,String version){
  Set<String> jars=new HashSet<String>();
  Set<String> set=getHadoopLibraries(distribution,version);
  List jarsNeed=ModulesNeededProvider.getModulesNeeded();
  for (  Object jar : jarsNeed) {
    if (jar instanceof ModuleNeeded) {
      String jarName=((ModuleNeeded)jar).getModuleName();
      if (set.contains(jarName) && ((ModuleNeeded)jar).getStatus().equals(ELibraryInstallStatus.NOT_INSTALLED)) {
        jars.add(jarName);
      }
    }
  }
  return jars;
}

Fixed version (ground truth):
@Override public Set<String> getMissingLibraries(String distribution,String version){
  Set<String> jars=new HashSet<String>();
  Set<String> set=getHadoopLibraries(distribution,version,false);
  List jarsNeed=ModulesNeededProvider.getModulesNeeded();
  for (  Object jar : jarsNeed) {
    if (jar instanceof ModuleNeeded) {
      String jarName=((ModuleNeeded)jar).getModuleName();
      if (set.contains(jarName) && ((ModuleNeeded)jar).getStatus().equals(ELibraryInstallStatus.NOT_INSTALLED)) {
        jars.add(jarName);
      }
    }
  }
  return jars;
}
Program: 124941
Project: 124941
Buggy source:
@Override public Set<String> getHadoopLibraries(String distribution,String version){
  Set<String> set=new HashSet<String>();
  ClassLoader classLoader=HadoopClassLoaderFactory.getClassLoader(distribution,version);
  if (classLoader instanceof DynamicClassLoader) {
    set.addAll(((DynamicClassLoader)classLoader).getLibraries());
  }
  return set;
}

Fixed version (ground truth):
@Override public Set<String> getHadoopLibraries(String distribution,String version,boolean showDownloadIfNotExist){
  Set<String> set=new HashSet<String>();
  ClassLoader classLoader=HadoopClassLoaderFactory.getClassLoader(distribution,version,false,showDownloadIfNotExist);
  if (classLoader instanceof DynamicClassLoader) {
    set.addAll(((DynamicClassLoader)classLoader).getLibraries());
  }
  return set;
}
Program: 124942
Project: 124942
Buggy source:
public static ClassLoader getClassLoader(){
  ClassLoader classLoader=null;
  String distributionValue=TOozieParamUtils.getHadoopDistribution();
  String versionValue=TOozieParamUtils.getHadoopVersion();
  String customJars=TOozieParamUtils.getHadoopCustomJars();
  if (distributionValue.equals(EHadoopDistributions.CUSTOM.getName())) {
    classLoader=ClassLoaderFactory.getCustomClassLoader(ITalendCorePrefConstants.OOZIE_SCHEDULER_HADOOP_CUSTOM_JARS,customJars);
  }
 else {
    classLoader=HadoopClassLoaderFactory.getClassLoader(distributionValue,versionValue);
  }
  if (classLoader == null) {
    classLoader=OozieClassLoaderFactory.class.getClassLoader();
  }
  return classLoader;
}

Fixed version (ground truth):
public static ClassLoader getClassLoader(){
  ClassLoader classLoader=null;
  String distributionValue=TOozieParamUtils.getHadoopDistribution();
  String versionValue=TOozieParamUtils.getHadoopVersion();
  String customJars=TOozieParamUtils.getHadoopCustomJars();
  if (distributionValue.equals(EHadoopDistributions.CUSTOM.getName())) {
    classLoader=ClassLoaderFactory.getCustomClassLoader(ITalendCorePrefConstants.OOZIE_SCHEDULER_HADOOP_CUSTOM_JARS,customJars);
  }
 else {
    classLoader=HadoopClassLoaderFactory.getClassLoader(distributionValue,versionValue,false,true);
  }
  if (classLoader == null) {
    classLoader=OozieClassLoaderFactory.class.getClassLoader();
  }
  return classLoader;
}
Program: 124943
Project: 124943
Buggy source:
protected String doSubmit(JobContext jobContext) throws OozieClientException {
  OozieClient oozieClient=createOozieClient(jobContext.getOozieEndPoint(),jobContext.getDebug());
  String userName=jobContext.get(OozieClient.USER_NAME);
  Properties configuration=oozieClient.createConfiguration();
  if (userName != null && !"String_Node_Str".equals(userName))   configuration.setProperty(OozieClient.USER_NAME,userName);
  configuration.setProperty(OozieClient.COORDINATOR_APP_PATH,jobContext.getNameNodeEndPoint() + jobContext.getJobPathOnHDFS());
  return oozieClient.run(configuration);
}

Fixed version (ground truth):
protected String doSubmit(JobContext jobContext) throws OozieClientException {
  OozieClient oozieClient=createOozieClient(jobContext.getOozieEndPoint(),jobContext.getDebug());
  String userName=jobContext.get(OozieClient.USER_NAME);
  Properties configuration=oozieClient.createConfiguration();
  if (userName != null && !"String_Node_Str".equals(userName)) {
    configuration.setProperty(OozieClient.USER_NAME,userName);
  }
  String cooAppPath=jobContext.getJobPathOnHDFS();
  String hadoopDistribution=TOozieParamUtils.getHadoopDistribution();
  EHadoopDistributions distribution=EHadoopDistributions.getDistributionByName(hadoopDistribution,false);
  if (distribution == EHadoopDistributions.MAPR) {
    cooAppPath="String_Node_Str".concat(cooAppPath);
  }
 else {
    cooAppPath=jobContext.getNameNodeEndPoint().concat(cooAppPath);
  }
  configuration.setProperty(OozieClient.COORDINATOR_APP_PATH,cooAppPath);
  return oozieClient.run(configuration);
}
Program: 124945
Project: 124945
Buggy source:
protected Coordinator createCoordinator(JobContext jobContext){
  Utils.assertTrue(jobContext.getFrequency() > 0,"String_Node_Str");
  return new Coordinator(jobContext.getJobName(),jobContext.getNameNodeEndPoint() + jobContext.getJobPathOnHDFS(),jobContext.getStartTime(),jobContext.getEndTime(),jobContext.getFrequency(),jobContext.getTimeUnit());
}

Fixed version (ground truth):
protected Coordinator createCoordinator(JobContext jobContext){
  Utils.assertTrue(jobContext.getFrequency() > 0,"String_Node_Str");
  String cooAppPath=jobContext.getJobPathOnHDFS();
  String hadoopDistribution=TOozieParamUtils.getHadoopDistribution();
  EHadoopDistributions distribution=EHadoopDistributions.getDistributionByName(hadoopDistribution,false);
  if (distribution == EHadoopDistributions.MAPR) {
    cooAppPath="String_Node_Str".concat(cooAppPath);
  }
 else {
    cooAppPath=jobContext.getNameNodeEndPoint().concat(cooAppPath);
  }
  return new Coordinator(jobContext.getJobName(),cooAppPath,jobContext.getStartTime(),jobContext.getEndTime(),jobContext.getFrequency(),jobContext.getTimeUnit());
}
Program: 124946
Project: 124946
Buggy source:
@Override public List<String> checkNeededRoutines(List<String> possibleRoutines,String additionalString){
  return null;
}

Fixed version (ground truth):
@Override public List<String> checkNeededRoutines(List<String> possiblePigudfs,String additionalString){
  List<String> pigudfsToAdd=new ArrayList<String>();
  PigMapData pigMapData=(PigMapData)getExternalEmfData();
  for (  String pigudf : possiblePigudfs) {
    List<OutputTable> listOutput=pigMapData.getOutputTables();
    for (    OutputTable outTable : listOutput) {
      List<TableNode> listOutEntry=outTable.getNodes();
      if (listOutEntry != null && !listOutEntry.isEmpty()) {
        for (        TableNode outEntry : listOutEntry) {
          String expression=outEntry.getExpression();
          if (expression != null && !pigudfsToAdd.contains(pigudf) && expression.contains(SOURCE_JAVA_PIGUDF + additionalString + pigudf)) {
            pigudfsToAdd.add(pigudf);
          }
        }
      }
      String filter=outTable.getExpressionFilter();
      if (filter != null && !pigudfsToAdd.contains(pigudf) && filter.contains(SOURCE_JAVA_PIGUDF + additionalString + pigudf)) {
        pigudfsToAdd.add(pigudf);
      }
    }
    List<InputTable> listInput=pigMapData.getInputTables();
    for (    InputTable inputTable : listInput) {
      List<TableNode> listInEntry=inputTable.getNodes();
      if (listInEntry != null && !listInEntry.isEmpty()) {
        for (        TableNode inEntry : listInEntry) {
          String expression=inEntry.getExpression();
          if (expression != null && !pigudfsToAdd.contains(pigudf) && expression.contains(SOURCE_JAVA_PIGUDF + additionalString + pigudf)) {
            pigudfsToAdd.add(pigudf);
          }
        }
      }
      String filter=inputTable.getExpressionFilter();
      if (filter != null && !pigudfsToAdd.contains(pigudf) && filter.contains(SOURCE_JAVA_PIGUDF + additionalString + pigudf)) {
        pigudfsToAdd.add(pigudf);
      }
    }
  }
  return pigudfsToAdd;
}
Program: 124947
Project: 124947
Buggy source:
/** 
 * DOC ycbai Comment method "testConnection". Test whether can connect to HDFS.
 * @return
 */
public static ConnectionStatus testConnection(HDFSConnectionBean connection){
  ConnectionStatus connectionStatus=new ConnectionStatus();
  connectionStatus.setResult(false);
  String errorMsg="String_Node_Str" + connection.getNameNodeURI() + "String_Node_Str";
  Object dfs=null;
  try {
    dfs=getDFS(connection);
    if (dfs != null) {
      connectionStatus.setResult(true);
      connectionStatus.setMessageException("String_Node_Str");
    }
 else {
      connectionStatus.setMessageException(errorMsg);
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
    connectionStatus.setMessageException(errorMsg);
  }
 finally {
    if (dfs != null) {
      try {
        ReflectionUtils.invokeMethod(dfs,"String_Node_Str",new Object[0]);
      }
 catch (      Exception e) {
      }
    }
  }
  return connectionStatus;
}

Fixed version (ground truth):
/** 
 * DOC ycbai Comment method "testConnection". Test whether can connect to HDFS.
 * @return
 */
public static ConnectionStatus testConnection(HDFSConnectionBean connection){
  ConnectionStatus connectionStatus=new ConnectionStatus();
  connectionStatus.setResult(false);
  String errorMsg="String_Node_Str" + connection.getNameNodeURI() + "String_Node_Str";
  Object dfs=null;
  try {
    dfs=getDFS(connection);
    if (dfs != null) {
      connectionStatus.setResult(true);
      connectionStatus.setMessageException("String_Node_Str");
    }
 else {
      connectionStatus.setMessageException(errorMsg);
    }
  }
 catch (  Exception e) {
    Set<String> jars=getMissingJars(connection);
    String missJarMsg="String_Node_Str";
    if (jars.size() > 0) {
      missJarMsg="String_Node_Str" + jars.toString() + "String_Node_Str"+ "String_Node_Str";
    }
    ExceptionHandler.process(e);
    connectionStatus.setMessageException(errorMsg + "String_Node_Str" + missJarMsg);
  }
 finally {
    if (dfs != null) {
      try {
        ReflectionUtils.invokeMethod(dfs,"String_Node_Str",new Object[0]);
      }
 catch (      Exception e) {
      }
    }
  }
  return connectionStatus;
}
Program: 124948
Project: 124948
Buggy source:
public HadoopReflectionException(String msg,Exception e){
  super(msg,e);
}

Fixed version (ground truth):
public HadoopReflectionException(String msg,Throwable cause){
  super(msg,cause instanceof InvocationTargetException ? cause.getCause() : cause);
}
Program: 124949
Project: 124949
Buggy source:
public HadoopServerException(String msg,Exception e){
  super(msg,e);
}

Fixed version (ground truth):
public HadoopServerException(String msg,Throwable cause){
  super(msg,cause instanceof InvocationTargetException ? cause.getCause() : cause);
}
Program: 124951
Project: 124951
Buggy source:
public void initValues(){
  Text pathText=executeJobComposite.getPathText();
  Text outputText=executeJobComposite.getOutputTxt();
  if (!pathText.isDisposed() && !outputText.isDisposed()) {
    final IProcess2 process=OozieJobTrackerListener.getProcess();
    if (process != null) {
      String jobIdInOozie=CorePlugin.getDefault().getPreferenceStore().getString(TOozieCommonConstants.OOZIE_PREFIX_FOR_PREFERENCE + process.getLabel());
      String appPath=(String)process.getElementParameter(EOozieParameterName.HADOOP_APP_PATH.getName()).getValue();
      pathText.setText(appPath);
      String outputValue=traceManager.getTrace(jobIdInOozie);
      updateOutputTextContents(outputValue == null ? "String_Node_Str" : outputValue,process.getLabel());
      updatePathTxtEnabledOrNot();
      updateOutputTxtEnabledOrNot();
    }
 else {
      pathText.setText("String_Node_Str");
      outputText.setText("String_Node_Str");
      updatePathTxtEnabledOrNot();
      updateOutputTxtEnabledOrNot();
    }
  }
}

Fixed version (ground truth):
public void initValues(){
  Text pathText=executeJobComposite.getPathText();
  Text outputText=executeJobComposite.getOutputTxt();
  if (!pathText.isDisposed() && !outputText.isDisposed()) {
    final IProcess2 process=OozieJobTrackerListener.getProcess();
    if (process != null) {
      String jobIdInOozie=CorePlugin.getDefault().getPreferenceStore().getString(TOozieCommonConstants.OOZIE_PREFIX_FOR_PREFERENCE + process.getLabel());
      String appPath=(String)process.getElementParameter(EOozieParameterName.HADOOP_APP_PATH.getName()).getValue();
      pathText.setText(appPath);
      String outputValue=traceManager.getTrace(jobIdInOozie);
      updateOutputTextContents(outputValue == null ? "String_Node_Str" : outputValue,process.getLabel());
      updatePathEnabledOrNot();
      updateOutputTxtEnabledOrNot();
    }
 else {
      pathText.setText("String_Node_Str");
      outputText.setText("String_Node_Str");
      updatePathEnabledOrNot();
      updateOutputTxtEnabledOrNot();
    }
  }
}
Program: 124952
Project: 124952
Buggy source:
/** 
 * Updates all buttons status, enabled or not.
 */
public void updateAllEnabledOrNot(){
  String jobIdInOozie=getJobIdInOozie();
  String pathValue=executeJobComposite.getPathValue();
  Button runBtn=executeJobComposite.getRunBtn();
  Button scheduleBtn=executeJobComposite.getScheduleBtn();
  Button killBtn=executeJobComposite.getKillBtn();
  boolean isRunBtnEnabled=false;
  boolean isScheduleBtnEnabled=false;
  boolean isKillBtnEnabled=false;
  if (pathValue != null && !"String_Node_Str".equals(pathValue) && isSettingDone()) {
    if (jobIdInOozie != null && !"String_Node_Str".equals(jobIdInOozie)) {
      try {
        JobSubmission.Status status=checkJobSubmissionStaus(jobIdInOozie);
switch (status) {
case RUNNING:
          isRunBtnEnabled=false;
        isScheduleBtnEnabled=false;
      isKillBtnEnabled=true;
    break;
case PREP:
case SUCCEEDED:
case KILLED:
  isRunBtnEnabled=true;
isScheduleBtnEnabled=true;
isKillBtnEnabled=false;
break;
case FAILED:
case SUSPENDED:
isKillBtnEnabled=true;
isScheduleBtnEnabled=true;
isRunBtnEnabled=true;
}
}
 catch (JobSubmissionException e) {
isRunBtnEnabled=true;
isScheduleBtnEnabled=true;
isKillBtnEnabled=false;
org.talend.commons.exception.ExceptionHandler.process(e);
}
}
 else {
isRunBtnEnabled=true;
isScheduleBtnEnabled=true;
isKillBtnEnabled=false;
}
}
updateBtn(runBtn,isRunBtnEnabled);
updateBtn(scheduleBtn,isScheduleBtnEnabled);
updateBtn(killBtn,isKillBtnEnabled);
updatePathTxtEnabledOrNot();
updateOutputTxtEnabledOrNot();
}

Fixed version (ground truth):
/** 
 * Updates all buttons status, enabled or not.
 */
public void updateAllEnabledOrNot(){
  String jobIdInOozie=getJobIdInOozie();
  String pathValue=executeJobComposite.getPathValue();
  Button runBtn=executeJobComposite.getRunBtn();
  Button scheduleBtn=executeJobComposite.getScheduleBtn();
  Button killBtn=executeJobComposite.getKillBtn();
  boolean isRunBtnEnabled=false;
  boolean isScheduleBtnEnabled=false;
  boolean isKillBtnEnabled=false;
  if (pathValue != null && !"String_Node_Str".equals(pathValue) && isSettingDone()) {
    if (jobIdInOozie != null && !"String_Node_Str".equals(jobIdInOozie)) {
      try {
        JobSubmission.Status status=checkJobSubmissionStaus(jobIdInOozie);
switch (status) {
case RUNNING:
          isRunBtnEnabled=false;
        isScheduleBtnEnabled=false;
      isKillBtnEnabled=true;
    break;
case PREP:
case SUCCEEDED:
case KILLED:
  isRunBtnEnabled=true;
isScheduleBtnEnabled=true;
isKillBtnEnabled=false;
break;
case FAILED:
case SUSPENDED:
isKillBtnEnabled=true;
isScheduleBtnEnabled=true;
isRunBtnEnabled=true;
}
}
 catch (JobSubmissionException e) {
isRunBtnEnabled=true;
isScheduleBtnEnabled=true;
isKillBtnEnabled=false;
org.talend.commons.exception.ExceptionHandler.process(e);
}
}
 else {
isRunBtnEnabled=true;
isScheduleBtnEnabled=true;
isKillBtnEnabled=false;
}
}
updateBtn(runBtn,isRunBtnEnabled);
updateBtn(scheduleBtn,isScheduleBtnEnabled);
updateBtn(killBtn,isKillBtnEnabled);
updatePathEnabledOrNot();
updateOutputTxtEnabledOrNot();
}
Program: 124953
Project: 124953
Buggy source:
public void setSelectedNodePart(TableEntityPart selectedNode){
  IContentProposalProvider[] contentProposalProviders=new IContentProposalProvider[0];
  contentProposalProviders=new IContentProposalProvider[]{new PigProposalProvider(mapperManager.getMapperComponent().getProcess(),mapperManager.getMapperComponent().getOriginalNode())};
  ExpressionProposalProvider provider=new ExpressionProposalProvider(mapperManager,contentProposalProviders);
  provider.init();
  getContentProposalAdapter().setContentProposalProvider(provider);
}

Fixed version (ground truth):
public void setSelectedNodePart(TableEntityPart selectedNode){
  this.selectedNodePart=selectedNode;
  this.selectedNode=(AbstractNode)selectedNodePart.getModel();
  IContentProposalProvider[] contentProposalProviders=new IContentProposalProvider[0];
  contentProposalProviders=new IContentProposalProvider[]{new PigProposalProvider(mapperManager.getMapperComponent().getProcess(),mapperManager.getMapperComponent().getOriginalNode())};
  ExpressionProposalProvider provider=new ExpressionProposalProvider(mapperManager,contentProposalProviders);
  provider.init();
  getContentProposalAdapter().setContentProposalProvider(provider);
}
Program: 124955
Project: 124955
Buggy source:
public void loadHDFSFolderChildren(HDFSConnectionBean connection,Object fileSystem,ClassLoader classLoader,HDFSPath parent,String path) throws HadoopServerException {
  if (connection == null || fileSystem == null || classLoader == null || parent == null || path == null) {
    return;
  }
  try {
    Object pathObj=ReflectionUtils.newInstance("String_Node_Str",classLoader,new Object[]{path});
    Object[] statusList=(Object[])ReflectionUtils.invokeMethod(fileSystem,"String_Node_Str",new Object[]{pathObj});
    if (statusList == null) {
      return;
    }
    for (    Object status : statusList) {
      if (!canAccess(connection,status)) {
        continue;
      }
      HDFSPath content=null;
      Object statusPath=ReflectionUtils.invokeMethod(status,"String_Node_Str",new Object[0]);
      String pathName=(String)ReflectionUtils.invokeMethod(statusPath,"String_Node_Str",new Object[0]);
      String absolutePath=(String)ReflectionUtils.invokeMethod(statusPath,"String_Node_Str",new Object[0]);
      String relativePath=getRelativePath(connection,absolutePath);
      if ((Boolean)ReflectionUtils.invokeMethod(status,"String_Node_Str",new Object[0])) {
        content=new HDFSFolder(parent);
      }
 else {
        content=new HDFSFile(parent);
        content.setTable(createTable(trimFileExtention(pathName)));
      }
      content.setPath(relativePath);
      content.setValue(pathName);
      parent.addChild(content);
    }
  }
 catch (  Exception e) {
    throw new HadoopServerException(e);
  }
}

Fixed version (ground truth):
public void loadHDFSFolderChildren(HDFSConnectionBean connection,Object fileSystem,ClassLoader classLoader,HDFSPath parent,String path) throws HadoopServerException {
  if (connection == null || fileSystem == null || classLoader == null || parent == null || path == null) {
    return;
  }
  try {
    Object pathObj=ReflectionUtils.newInstance("String_Node_Str",classLoader,new Object[]{path});
    Object[] statusList=(Object[])ReflectionUtils.invokeMethod(fileSystem,"String_Node_Str",new Object[]{pathObj});
    if (statusList == null) {
      return;
    }
    for (    Object status : statusList) {
      if (!canAccess(connection,status)) {
        continue;
      }
      HDFSPath content=null;
      Object statusPath=ReflectionUtils.invokeMethod(status,"String_Node_Str",new Object[0]);
      String pathName=(String)ReflectionUtils.invokeMethod(statusPath,"String_Node_Str",new Object[0]);
      String absolutePath=((URI)ReflectionUtils.invokeMethod(statusPath,"String_Node_Str",new Object[0])).toString();
      String relativePath=URI.create(absolutePath).getPath();
      if ((Boolean)ReflectionUtils.invokeMethod(status,"String_Node_Str",new Object[0])) {
        content=new HDFSFolder(parent);
      }
 else {
        content=new HDFSFile(parent);
        content.setTable(createTable(trimFileExtention(pathName)));
      }
      content.setPath(relativePath);
      content.setValue(pathName);
      parent.addChild(content);
    }
  }
 catch (  Exception e) {
    throw new HadoopServerException(e);
  }
}
Program: 124956
Project: 124956
Buggy source:
public void doModifyPathAction(){
  if (OozieJobTrackerListener.getProcess() != null) {
    String path=executeJobComposite.getPathValue();
    IProcess2 process=OozieJobTrackerListener.getProcess();
    process.getElementParameter(EOozieParameterName.HADOOP_APP_PATH.getName()).setValue(path);
  }
  updateAllEnabledOrNot();
}

Fixed version (ground truth):
public void doModifyPathAction(){
  if (OozieJobTrackerListener.getProcess() != null) {
    String path=executeJobComposite.getPathValue();
    IProcess2 process=OozieJobTrackerListener.getProcess();
    process.getElementParameter(EOozieParameterName.HADOOP_APP_PATH.getName()).setValue(path);
    Button runBtn=executeJobComposite.getRunBtn();
    Button scheduleBtn=executeJobComposite.getScheduleBtn();
    Button killBtn=executeJobComposite.getKillBtn();
    if (path != null && !StringUtils.isEmpty(path)) {
      updateBtn(runBtn,true);
      updateBtn(scheduleBtn,true);
      updateBtn(killBtn,false);
    }
 else {
      updateBtn(runBtn,false);
      updateBtn(scheduleBtn,false);
      updateBtn(killBtn,false);
    }
  }
}
Program: 124960
Project: 124960
Buggy source:
@Override public void execute(){
  AbstractInOutTable targetTable=(AbstractInOutTable)targetEditPart.getModel();
  String expression=targetTable.getExpressionFilter();
  if (objects.getToTransfer() != null) {
    for (    Object obj : objects.getToTransfer()) {
      AbstractNode sourceNode=null;
      if (objects.getType() == TransferdType.INPUT) {
        PigMapTableNodePart part=(PigMapTableNodePart)obj;
        sourceNode=(TableNode)part.getModel();
      }
      if (sourceNode != null) {
        targetTable.setExpressionFilter(expression);
        FilterConnection connection=PigmapFactory.eINSTANCE.createFilterConnection();
        connection.setSource(sourceNode);
        connection.setTarget(targetTable);
        targetTable.getFilterIncomingConnections().add(connection);
        sourceNode.getFilterOutGoingConnections().add(connection);
        pigMapData.getConnections().add(connection);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void execute(){
  AbstractInOutTable targetTable=(AbstractInOutTable)targetEditPart.getModel();
  String expression=targetTable.getExpressionFilter();
  if (objects.getToTransfer() != null) {
    for (    Object obj : objects.getToTransfer()) {
      AbstractNode sourceNode=null;
      if (objects.getType() == TransferdType.INPUT) {
        PigMapTableNodePart part=(PigMapTableNodePart)obj;
        sourceNode=(TableNode)part.getModel();
        String tableName="String_Node_Str";
        if (sourceNode != null && sourceNode.eContainer() instanceof InputTable) {
          InputTable table=(InputTable)sourceNode.eContainer();
          tableName=table.getName();
        }
        if (expression == null || expression.equals("String_Node_Str")) {
          expression=tableName + "String_Node_Str" + sourceNode.getName();
        }
 else {
          expression=expression + "String_Node_Str" + tableName+ "String_Node_Str"+ sourceNode.getName();
        }
      }
      if (sourceNode != null) {
        targetTable.setExpressionFilter(expression);
        FilterConnection connection=PigmapFactory.eINSTANCE.createFilterConnection();
        connection.setSource(sourceNode);
        connection.setTarget(targetTable);
        targetTable.getFilterIncomingConnections().add(connection);
        sourceNode.getFilterOutGoingConnections().add(connection);
        pigMapData.getConnections().add(connection);
      }
    }
  }
}