Program: 126547
Project: 126547
Buggy source:
public Map<ECustomVersionGroup,Set<LibraryFile>> getImportLibLibraries(){
  Map<ECustomVersionGroup,Set<LibraryFile>> libMap=new HashMap<ECustomVersionGroup,Set<LibraryFile>>();
  if (isFromExistVersion) {
    IHadoopService hadoopService=null;
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopService.class)) {
      hadoopService=(IHadoopService)GlobalServiceRegister.getDefault().getService(IHadoopService.class);
    }
    if (hadoopService != null) {
      for (      ECustomVersionGroup group : existVersionSelectionMap.keySet()) {
        if (existVersionSelectionMap.get(group)) {
          if (types != null) {
            HashSet libInSameGroup=new HashSet<LibraryFile>();
            boolean commonGroupCalculated=false;
            for (            ECustomVersionType type : types) {
              if (type.getGroup() == group) {
                Set<String> hadoopLibraries=new HashSet<String>();
                if (ECustomVersionType.PIG == type || ECustomVersionType.PIG_HBASE == type || ECustomVersionType.PIG_HCATALOG == type) {
                  hadoopLibraries=getLibrariesForPig(type);
                }
 else {
                  if (!commonGroupCalculated && (ECustomVersionType.HCATALOG == type || ECustomVersionType.OOZIE == type)) {
                    type=ECustomVersionType.HDFS;
                  }
                  if (type == ECustomVersionType.HDFS) {
                    commonGroupCalculated=true;
                  }
                  hadoopLibraries=hadoopService.getHadoopLibrariesByType(type,getDistribution(),getVersion());
                }
                Set<LibraryFile> convertToLibraryFile=customLibUtil.convertToLibraryFile(hadoopLibraries);
                libInSameGroup.addAll(convertToLibraryFile);
              }
            }
            libMap.put(group,libInSameGroup);
          }
        }
      }
    }
  }
 else   if (isFromZip) {
    Set<ECustomVersionGroup> groups=new HashSet<ECustomVersionGroup>();
    for (    ECustomVersionGroup group : fromZipSelectionMap.keySet()) {
      if (fromZipSelectionMap.get(group)) {
        groups.add(group);
      }
    }
    return customLibUtil.readZipFile(zipLocation,groups);
  }
  return libMap;
}

Fixed version (ground truth):
public Map<ECustomVersionGroup,Set<LibraryFile>> getImportLibLibraries(){
  Map<ECustomVersionGroup,Set<LibraryFile>> libMap=new HashMap<ECustomVersionGroup,Set<LibraryFile>>();
  if (isFromExistVersion) {
    IHadoopService hadoopService=null;
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopService.class)) {
      hadoopService=(IHadoopService)GlobalServiceRegister.getDefault().getService(IHadoopService.class);
    }
    if (hadoopService != null) {
      for (      ECustomVersionGroup group : existVersionSelectionMap.keySet()) {
        if (existVersionSelectionMap.get(group)) {
          if (types != null) {
            HashSet libInSameGroup=new HashSet<LibraryFile>();
            boolean commonGroupCalculated=false;
            for (            ECustomVersionType type : types) {
              if (type.getGroup() == group) {
                Set<String> hadoopLibraries=new HashSet<String>();
                if (ECustomVersionType.PIG == type || ECustomVersionType.PIG_HBASE == type || ECustomVersionType.PIG_HCATALOG == type) {
                  hadoopLibraries=getLibrariesForPig(type);
                }
 else                 if (ECustomVersionType.MAP_REDUCE == type) {
                  hadoopLibraries=getLibrariesForMapReduce(type);
                }
 else {
                  if (!commonGroupCalculated && (ECustomVersionType.HCATALOG == type || ECustomVersionType.OOZIE == type)) {
                    type=ECustomVersionType.HDFS;
                  }
                  if (type == ECustomVersionType.HDFS) {
                    commonGroupCalculated=true;
                  }
                  hadoopLibraries=hadoopService.getHadoopLibrariesByType(type,getDistribution(),getVersion());
                }
                Set<LibraryFile> convertToLibraryFile=customLibUtil.convertToLibraryFile(hadoopLibraries);
                libInSameGroup.addAll(convertToLibraryFile);
              }
            }
            libMap.put(group,libInSameGroup);
          }
        }
      }
    }
  }
 else   if (isFromZip) {
    Set<ECustomVersionGroup> groups=new HashSet<ECustomVersionGroup>();
    for (    ECustomVersionGroup group : fromZipSelectionMap.keySet()) {
      if (fromZipSelectionMap.get(group)) {
        groups.add(group);
      }
    }
    return customLibUtil.readZipFile(zipLocation,groups);
  }
  return libMap;
}