Program: 5557
Project: 5557
Buggy source:
/** 
 * Setup the environment needed by the embedded HiveServer2.
 */
private void setupHive(){
  File tmpDir=new File(System.getProperty("String_Node_Str")).getAbsoluteFile();
  File localScratchFile=new File(tmpDir,"String_Node_Str" + System.getProperty("String_Node_Str"));
  System.setProperty(HiveConf.ConfVars.LOCALSCRATCHDIR.toString(),localScratchFile.getAbsolutePath());
  LOG.info("String_Node_Str",HiveConf.ConfVars.LOCALSCRATCHDIR.toString(),System.getProperty(HiveConf.ConfVars.LOCALSCRATCHDIR.toString()));
  ClassLoader classLoader=Objects.firstNonNull(Thread.currentThread().getContextClassLoader(),getClass().getClassLoader());
  if (!(classLoader instanceof URLClassLoader)) {
    LOG.warn("String_Node_Str" + "String_Node_Str",classLoader);
    return;
  }
  List<URL> urls=Arrays.asList(((URLClassLoader)classLoader).getURLs());
  LOG.debug("String_Node_Str",urls);
  Map<String,URL> hiveExtraJars=new LinkedHashMap<>();
  String userDir=System.getProperty("String_Node_Str");
  for (  URL url : urls) {
    String path=url.getPath();
    if (!path.endsWith("String_Node_Str") || !path.startsWith(userDir) || new File(path).getParent().equals(userDir)) {
      continue;
    }
    String fileName=getFileName(url);
    if (!hiveExtraJars.containsKey(fileName)) {
      hiveExtraJars.put(fileName,url);
    }
 else {
      LOG.info("String_Node_Str",fileName,url);
    }
  }
  System.setProperty(HiveConf.ConfVars.HIVEAUXJARS.toString(),Joiner.on(',').join(Iterables.transform(hiveExtraJars.values(),Functions.toStringFunction())));
  LOG.debug("String_Node_Str",HiveConf.ConfVars.HIVEAUXJARS.toString(),System.getProperty(HiveConf.ConfVars.HIVEAUXJARS.toString()));
  System.setProperty(BaseHiveExploreService.SPARK_YARN_DIST_FILES,Joiner.on(',').join(Iterables.transform(hiveExtraJars.values(),URL_TO_PATH)));
  LOG.debug("String_Node_Str",BaseHiveExploreService.SPARK_YARN_DIST_FILES,System.getProperty(BaseHiveExploreService.SPARK_YARN_DIST_FILES));
  String extraClassPath=Joiner.on(',').join(Iterables.transform(hiveExtraJars.keySet(),new Function<String,String>(){
    @Override public String apply(    String name){
      return "String_Node_Str" + name;
    }
  }
));
  extraClassPath+="String_Node_Str";
  rewriteConfigClasspath("String_Node_Str",YarnConfiguration.YARN_APPLICATION_CLASSPATH,Joiner.on("String_Node_Str").join(YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH),extraClassPath);
  rewriteConfigClasspath("String_Node_Str",MRJobConfig.MAPREDUCE_APPLICATION_CLASSPATH,MRJobConfig.DEFAULT_MAPREDUCE_APPLICATION_CLASSPATH,extraClassPath);
  rewriteConfigClasspath("String_Node_Str",TezConfiguration.TEZ_CLUSTER_ADDITIONAL_CLASSPATH_PREFIX,null,extraClassPath);
  rewriteHiveConfig();
  String hiveExecJar=new JobConf(org.apache.hadoop.hive.ql.exec.Task.class).getJar();
  Preconditions.checkNotNull(hiveExecJar,"String_Node_Str" + "String_Node_Str");
  LOG.debug("String_Node_Str",hiveExecJar);
  try {
    setupHadoopBin(Iterables.concat(hiveExtraJars.values(),Collections.singleton(new File(hiveExecJar).toURI().toURL())));
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
/** 
 * Setup the environment needed by the embedded HiveServer2.
 */
private void setupHive(){
  File tmpDir=new File(System.getProperty("String_Node_Str")).getAbsoluteFile();
  File localScratchFile=new File(tmpDir,"String_Node_Str" + System.getProperty("String_Node_Str"));
  System.setProperty(HiveConf.ConfVars.LOCALSCRATCHDIR.toString(),localScratchFile.getAbsolutePath());
  LOG.info("String_Node_Str",HiveConf.ConfVars.LOCALSCRATCHDIR.toString(),System.getProperty(HiveConf.ConfVars.LOCALSCRATCHDIR.toString()));
  ClassLoader classLoader=Objects.firstNonNull(Thread.currentThread().getContextClassLoader(),getClass().getClassLoader());
  if (!(classLoader instanceof URLClassLoader)) {
    LOG.warn("String_Node_Str" + "String_Node_Str",classLoader);
    return;
  }
  List<URL> urls=Arrays.asList(((URLClassLoader)classLoader).getURLs());
  LOG.debug("String_Node_Str",urls);
  Map<String,URL> hiveExtraJars=new LinkedHashMap<>();
  String userDir=System.getProperty("String_Node_Str");
  for (  URL url : urls) {
    String path=url.getPath();
    if (!path.endsWith("String_Node_Str") || !path.startsWith(userDir) || new File(path).getParent().equals(userDir)) {
      continue;
    }
    String fileName=getFileName(url);
    if (!hiveExtraJars.containsKey(fileName)) {
      hiveExtraJars.put(fileName,url);
    }
 else {
      LOG.info("String_Node_Str",fileName,url);
    }
  }
  System.setProperty(HiveConf.ConfVars.HIVEAUXJARS.toString(),Joiner.on(',').join(Iterables.transform(hiveExtraJars.values(),Functions.toStringFunction())));
  LOG.debug("String_Node_Str",HiveConf.ConfVars.HIVEAUXJARS.toString(),System.getProperty(HiveConf.ConfVars.HIVEAUXJARS.toString()));
  System.setProperty(BaseHiveExploreService.SPARK_YARN_DIST_FILES,Joiner.on(',').join(Iterables.transform(hiveExtraJars.values(),URL_TO_PATH)));
  LOG.debug("String_Node_Str",BaseHiveExploreService.SPARK_YARN_DIST_FILES,System.getProperty(BaseHiveExploreService.SPARK_YARN_DIST_FILES));
  Iterable<String> extraClassPath=Iterables.concat(Iterables.transform(hiveExtraJars.keySet(),new Function<String,String>(){
    @Override public String apply(    String name){
      return "String_Node_Str" + name;
    }
  }
),Collections.singleton("String_Node_Str"));
  rewriteConfigClasspath("String_Node_Str",YarnConfiguration.YARN_APPLICATION_CLASSPATH,Joiner.on("String_Node_Str").join(YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH),Joiner.on("String_Node_Str").join(extraClassPath));
  rewriteConfigClasspath("String_Node_Str",MRJobConfig.MAPREDUCE_APPLICATION_CLASSPATH,MRJobConfig.DEFAULT_MAPREDUCE_APPLICATION_CLASSPATH,Joiner.on("String_Node_Str").join(extraClassPath));
  rewriteConfigClasspath("String_Node_Str",TezConfiguration.TEZ_CLUSTER_ADDITIONAL_CLASSPATH_PREFIX,null,Joiner.on(File.pathSeparatorChar).join(extraClassPath));
  rewriteHiveConfig();
  String hiveExecJar=new JobConf(org.apache.hadoop.hive.ql.exec.Task.class).getJar();
  Preconditions.checkNotNull(hiveExecJar,"String_Node_Str" + "String_Node_Str");
  LOG.debug("String_Node_Str",hiveExecJar);
  try {
    setupHadoopBin(Iterables.concat(hiveExtraJars.values(),Collections.singleton(new File(hiveExecJar).toURI().toURL())));
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
    throw Throwables.propagate(e);
  }
}