Program: 96354
Project: 96354
Buggy source:
public static void install(final String shellVersionString) throws IOException {
  ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream(8196);
  PrintStream outputStream=new PrintStream(byteArrayOutputStream);
  final ShellProcessBuilder gsettings=new ShellProcessBuilder(outputStream);
  gsettings.setExecutable("String_Node_Str");
  gsettings.addArgument("String_Node_Str");
  gsettings.addArgument("String_Node_Str");
  gsettings.addArgument("String_Node_Str");
  gsettings.start();
  String output=ShellProcessBuilder.getOutput(byteArrayOutputStream);
  boolean hasTopIcons=output.contains("String_Node_Str");
  boolean hasSystemTray=output.contains(UID);
  if (hasTopIcons) {
    return;
  }
  String userHome=System.getProperty("String_Node_Str");
  final File file=new File(userHome + "String_Node_Str" + UID);
  final File metaDatafile=new File(file,"String_Node_Str");
  final File extensionFile=new File(file,"String_Node_Str");
  String versionOutput=shellVersionString.replaceAll("String_Node_Str","String_Node_Str");
  final int indexOf=versionOutput.indexOf('.');
  final int nextIndexOf=versionOutput.indexOf('.',indexOf + 1);
  if (indexOf < nextIndexOf) {
    versionOutput=versionOutput.substring(0,nextIndexOf);
  }
  String metadata="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + versionOutput + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ UID+ "String_Node_Str"+ "String_Node_Str"+ SystemTray.getVersion()+ "String_Node_Str"+ "String_Node_Str";
  if (hasSystemTray) {
    if (SystemTray.DEBUG) {
      logger.debug("String_Node_Str");
    }
    StringBuilder builder=new StringBuilder(256);
    BufferedReader bin=null;
    try {
      bin=new BufferedReader(new FileReader(metaDatafile));
      String line;
      while ((line=bin.readLine()) != null) {
        builder.append(line).append("String_Node_Str");
      }
    }
  finally {
      IO.close(bin,logger);
    }
    if (metadata.equals(builder.toString())) {
      if (!SystemTray.DEBUG) {
        return;
      }
    }
 else {
      logger.debug("String_Node_Str");
    }
  }
  if (!file.isDirectory()) {
    final boolean mkdirs=file.mkdirs();
    if (!mkdirs) {
      final String msg="String_Node_Str" + file;
      logger.error(msg);
      throw new RuntimeException(msg);
    }
  }
  BufferedWriter outputWriter=null;
  try {
    outputWriter=new BufferedWriter(new FileWriter(metaDatafile,false));
    outputWriter.write(metadata);
    outputWriter.flush();
    outputWriter.close();
  }
  finally {
    IO.close(outputWriter,logger);
  }
  InputStream reader=null;
  FileOutputStream fileOutputStream=null;
  try {
    reader=GnomeShellExtension.class.getResourceAsStream("String_Node_Str");
    fileOutputStream=new FileOutputStream(extensionFile);
    IO.copyStream(reader,fileOutputStream);
  }
  finally {
    IO.close(reader,logger);
    IO.close(fileOutputStream,logger);
  }
  if (!hasSystemTray) {
    logger.debug("String_Node_Str");
    final StringBuilder stringBuilder=new StringBuilder(output);
    int extensionIndex=output.indexOf("String_Node_Str");
    if (extensionIndex > 0) {
      stringBuilder.delete(extensionIndex,stringBuilder.length());
    }
    extensionIndex=output.indexOf("String_Node_Str");
    if (extensionIndex > 0) {
      stringBuilder.delete(0,extensionIndex);
    }
    logger.info("String_Node_Str",stringBuilder.toString());
    if (stringBuilder.length() > 2) {
      stringBuilder.append("String_Node_Str");
    }
    stringBuilder.append("String_Node_Str").append(UID).append("String_Node_Str");
    stringBuilder.append("String_Node_Str");
    final ShellProcessBuilder setGsettings=new ShellProcessBuilder(outputStream);
    setGsettings.setExecutable("String_Node_Str");
    setGsettings.addArgument("String_Node_Str");
    setGsettings.addArgument("String_Node_Str");
    setGsettings.addArgument("String_Node_Str");
    setGsettings.addArgument(stringBuilder.toString());
    setGsettings.start();
  }
  if (ENABLE_SHELL_RESTART) {
    if (SystemTray.DEBUG) {
      logger.debug("String_Node_Str",SHELL_RESTART_COMMAND);
      return;
    }
    logger.info("String_Node_Str");
    final ShellProcessBuilder restartShell=new ShellProcessBuilder();
    restartShell.addArgument(SHELL_RESTART_COMMAND);
    restartShell.start();
  }
}

Fixed version (ground truth):
public static void install(final String shellVersionString) throws IOException {
  ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream(8196);
  PrintStream outputStream=new PrintStream(byteArrayOutputStream);
  final ShellProcessBuilder gsettings=new ShellProcessBuilder(outputStream);
  gsettings.setExecutable("String_Node_Str");
  gsettings.addArgument("String_Node_Str");
  gsettings.addArgument("String_Node_Str");
  gsettings.addArgument("String_Node_Str");
  gsettings.start();
  String output=ShellProcessBuilder.getOutput(byteArrayOutputStream);
  boolean hasTopIcons=output.contains("String_Node_Str");
  boolean hasSystemTray=output.contains(UID);
  if (hasTopIcons) {
    return;
  }
  String userHome=System.getProperty("String_Node_Str");
  final File file=new File(userHome + "String_Node_Str" + UID);
  final File metaDatafile=new File(file,"String_Node_Str");
  final File extensionFile=new File(file,"String_Node_Str");
  String versionOutput=shellVersionString.replaceAll("String_Node_Str","String_Node_Str");
  final int indexOf=versionOutput.indexOf('.');
  final int nextIndexOf=versionOutput.indexOf('.',indexOf + 1);
  if (indexOf < nextIndexOf) {
    versionOutput=versionOutput.substring(0,nextIndexOf);
  }
  String metadata="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + versionOutput + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ UID+ "String_Node_Str"+ "String_Node_Str"+ SystemTray.getVersion()+ "String_Node_Str"+ "String_Node_Str";
  if (hasSystemTray) {
    if (SystemTray.DEBUG) {
      logger.debug("String_Node_Str");
    }
    StringBuilder builder=new StringBuilder(256);
    BufferedReader bin=null;
    try {
      bin=new BufferedReader(new FileReader(metaDatafile));
      String line;
      while ((line=bin.readLine()) != null) {
        builder.append(line).append("String_Node_Str");
      }
    }
  finally {
      IO.close(bin,logger);
    }
    if (metadata.equals(builder.toString())) {
      if (!SystemTray.DEBUG) {
        return;
      }
    }
 else {
      logger.debug("String_Node_Str");
    }
  }
  if (!file.isDirectory()) {
    final boolean mkdirs=file.mkdirs();
    if (!mkdirs) {
      final String msg="String_Node_Str" + file;
      logger.error(msg);
      throw new RuntimeException(msg);
    }
  }
  BufferedWriter outputWriter=null;
  try {
    outputWriter=new BufferedWriter(new FileWriter(metaDatafile,false));
    outputWriter.write(metadata);
    outputWriter.flush();
    outputWriter.close();
  }
  finally {
    IO.close(outputWriter,logger);
  }
  InputStream reader=null;
  FileOutputStream fileOutputStream=null;
  try {
    reader=GnomeShellExtension.class.getResourceAsStream("String_Node_Str");
    fileOutputStream=new FileOutputStream(extensionFile);
    IO.copyStream(reader,fileOutputStream);
  }
  finally {
    IO.close(reader,logger);
    IO.close(fileOutputStream,logger);
  }
  if (!hasSystemTray) {
    logger.debug("String_Node_Str");
    final StringBuilder stringBuilder=new StringBuilder(output);
    int extensionIndex=output.indexOf("String_Node_Str");
    if (extensionIndex > 0) {
      stringBuilder.delete(extensionIndex,stringBuilder.length());
    }
    extensionIndex=output.indexOf("String_Node_Str");
    if (extensionIndex > 0) {
      stringBuilder.delete(0,extensionIndex);
    }
    if (SystemTray.DEBUG) {
      logger.debug("String_Node_Str",stringBuilder.toString());
    }
    if (stringBuilder.length() > 2) {
      stringBuilder.append("String_Node_Str");
    }
    stringBuilder.append("String_Node_Str").append(UID).append("String_Node_Str");
    stringBuilder.append("String_Node_Str");
    final ShellProcessBuilder setGsettings=new ShellProcessBuilder(outputStream);
    setGsettings.setExecutable("String_Node_Str");
    setGsettings.addArgument("String_Node_Str");
    setGsettings.addArgument("String_Node_Str");
    setGsettings.addArgument("String_Node_Str");
    setGsettings.addArgument(stringBuilder.toString());
    setGsettings.start();
  }
  if (ENABLE_SHELL_RESTART) {
    if (SystemTray.DEBUG) {
      logger.debug("String_Node_Str",SHELL_RESTART_COMMAND);
      return;
    }
    if (SystemTray.DEBUG) {
      logger.debug("String_Node_Str");
    }
    final ShellProcessBuilder restartShell=new ShellProcessBuilder();
    restartShell.addArgument(SHELL_RESTART_COMMAND);
    restartShell.start();
  }
}