Program: 125687
Project: 125687
Buggy source:
private ClassLoader getClassLoader(IMetadataConnection metadataConn){
  IHadoopDistributionService hadoopService=getHadoopDistributionService();
  if (hadoopService != null) {
    String distribution=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_IMPALA_DISTRIBUTION);
    String version=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_IMPALA_VERSION);
    IHDistribution impalaDistribution=hadoopService.getImpalaDistributionManager().getDistribution(distribution,false);
    if (impalaDistribution != null) {
      String impalaIndex=EDatabaseTypeName.IMPALA.getProduct() + ':' + impalaDistribution.getName();
      if (impalaDistribution.useCustom()) {
        String jarsStr=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_HADOOP_CUSTOM_JARS);
        String index="String_Node_Str" + impalaIndex + ':'+ metadataConn.getId();
        DynamicClassLoader classLoader=ClassLoaderFactory.getCustomClassLoader(index,jarsStr);
        if (classLoader != null) {
          return classLoader;
        }
      }
 else {
        IHDistributionVersion impalaVersion=impalaDistribution.getHDVersion(version,false);
        if (impalaVersion != null) {
          DynamicClassLoader classLoader=ClassLoaderFactory.getClassLoader(impalaIndex + ':' + impalaVersion.getVersion());
          if (classLoader != null) {
            return classLoader;
          }
        }
      }
    }
  }
  return this.getClass().getClassLoader();
}

Fixed version (ground truth):
private ClassLoader getClassLoader(IMetadataConnection metadataConn){
  IHadoopDistributionService hadoopService=getHadoopDistributionService();
  if (hadoopService != null) {
    String distribution=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_IMPALA_DISTRIBUTION);
    String version=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_IMPALA_VERSION);
    IHDistribution impalaDistribution=hadoopService.getImpalaDistributionManager().getDistribution(distribution,false);
    if (impalaDistribution != null) {
      String impalaIndex=EDatabaseTypeName.IMPALA.getProduct() + ClassLoaderFactory.KEY_SEPARATOR + impalaDistribution.getName();
      if (impalaDistribution.useCustom()) {
        String jarsStr=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_HADOOP_CUSTOM_JARS);
        String index="String_Node_Str" + ClassLoaderFactory.KEY_SEPARATOR + impalaIndex+ ClassLoaderFactory.KEY_SEPARATOR+ metadataConn.getId();
        DynamicClassLoader classLoader=ClassLoaderFactory.getCustomClassLoader(index,jarsStr);
        if (classLoader != null) {
          return classLoader;
        }
      }
 else {
        IHDistributionVersion impalaVersion=impalaDistribution.getHDVersion(version,false);
        if (impalaVersion != null) {
          DynamicClassLoader classLoader=ClassLoaderFactory.getClassLoader(impalaIndex + ClassLoaderFactory.KEY_SEPARATOR + impalaVersion.getVersion());
          if (classLoader == null) {
            classLoader=ClassLoaderFactory.getClassLoader(impalaVersion);
          }
          if (classLoader != null) {
            return classLoader;
          }
        }
      }
    }
  }
  return this.getClass().getClassLoader();
}