Program: 103390
Project: 103390
Buggy source:
/** 
 * Implements the very update procedure on Windows which includes without being limited to: <ol> <li>Downloads the setup in a temporary directory.</li> <li>Warns that the update procedure will shut down the application.</li> <li>Executes the setup in a separate process and shuts down the application.</li> </ol>
 */
private static void windowsUpdate(){
  File delta=null;
  boolean deleteDelta=true;
  File msi=null;
  try {
    String deltaLink=downloadLink.replace(latestVersion,latestVersion + "String_Node_Str" + getCurrentVersion().getNightlyBuildID());
    if (!deltaLink.equalsIgnoreCase(downloadLink) && logger.isDebugEnabled())     delta=download(deltaLink);
    if (delta != null) {
      File[] deltaMsi=new File[1];
      createTempFileOutputStream(delta.toURI().toURL(),"String_Node_Str",true,deltaMsi);
      Process process=new ProcessBuilder(delta.getCanonicalPath(),"String_Node_Str",deltaMsi[0].getCanonicalPath()).start();
      int exitCode=1;
      while (true) {
        try {
          exitCode=process.waitFor();
          break;
        }
 catch (        InterruptedException ie) {
        }
      }
      if (0 == exitCode) {
        deleteDelta=false;
        msi=deltaMsi[0];
      }
    }
  }
 catch (  Exception e) {
  }
 finally {
    if (deleteDelta && (delta != null)) {
      delta.delete();
      delta=null;
    }
  }
  boolean deleteMsi=true;
  deleteDelta=true;
  try {
    if (msi == null)     msi=download(downloadLink);
    if (msi != null) {
      ResourceManagementService resources=Resources.getResources();
      if (UpdateActivator.getUIService().getPopupDialog().showConfirmPopupDialog(resources.getI18NString("String_Node_Str"),resources.getI18NString("String_Node_Str"),PopupDialog.YES_NO_OPTION,PopupDialog.QUESTION_MESSAGE) == PopupDialog.YES_OPTION) {
        List<String> command=new ArrayList<String>();
        command.add(((delta == null) ? msi : delta).getCanonicalPath());
        command.add("String_Node_Str");
        if (delta != null) {
          command.add("String_Node_Str");
          command.add(msi.getCanonicalPath());
        }
        command.add("String_Node_Str" + System.getProperty("String_Node_Str") + "String_Node_Str");
        deleteMsi=false;
        deleteDelta=false;
        new ProcessBuilder(command).start();
        UpdateActivator.getShutdownService().beginShutdown();
      }
    }
  }
 catch (  FileNotFoundException fnfe) {
    ResourceManagementService resources=Resources.getResources();
    UpdateActivator.getUIService().getPopupDialog().showMessagePopupDialog(resources.getI18NString("String_Node_Str"),resources.getI18NString("String_Node_Str"),PopupDialog.INFORMATION_MESSAGE);
  }
catch (  Exception e) {
    if (logger.isInfoEnabled())     logger.info("String_Node_Str",e);
  }
 finally {
    if (deleteMsi && (msi != null)) {
      msi.delete();
      msi=null;
    }
    if (deleteDelta && (delta != null)) {
      delta.delete();
      delta=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Implements the very update procedure on Windows which includes without being limited to: <ol> <li>Downloads the setup in a temporary directory.</li> <li>Warns that the update procedure will shut down the application.</li> <li>Executes the setup in a separate process and shuts down the application.</li> </ol>
 */
private static void windowsUpdate(){
  File delta=null;
  boolean deleteDelta=true;
  File msi=null;
  try {
    String deltaTarget=null;
    Version ver=getCurrentVersion();
    if (ver.isPreRelease())     deltaTarget=ver.getNightlyBuildID();
 else     deltaTarget=String.valueOf(ver.getVersionRevision());
    String deltaLink=downloadLink.replace(latestVersion,latestVersion + "String_Node_Str" + deltaTarget);
    if (!deltaLink.equalsIgnoreCase(downloadLink) && logger.isDebugEnabled())     delta=download(deltaLink);
    if (delta != null) {
      File[] deltaMsi=new File[1];
      createTempFileOutputStream(delta.toURI().toURL(),"String_Node_Str",true,deltaMsi);
      Process process=new ProcessBuilder(delta.getCanonicalPath(),"String_Node_Str",deltaMsi[0].getCanonicalPath()).start();
      int exitCode=1;
      while (true) {
        try {
          exitCode=process.waitFor();
          break;
        }
 catch (        InterruptedException ie) {
        }
      }
      if (0 == exitCode) {
        deleteDelta=false;
        msi=deltaMsi[0];
      }
    }
  }
 catch (  Exception e) {
  }
 finally {
    if (deleteDelta && (delta != null)) {
      delta.delete();
      delta=null;
    }
  }
  boolean deleteMsi=true;
  deleteDelta=true;
  try {
    if (msi == null)     msi=download(downloadLink);
    if (msi != null) {
      ResourceManagementService resources=Resources.getResources();
      if (UpdateActivator.getUIService().getPopupDialog().showConfirmPopupDialog(resources.getI18NString("String_Node_Str"),resources.getI18NString("String_Node_Str"),PopupDialog.YES_NO_OPTION,PopupDialog.QUESTION_MESSAGE) == PopupDialog.YES_OPTION) {
        List<String> command=new ArrayList<String>();
        command.add(((delta == null) ? msi : delta).getCanonicalPath());
        command.add("String_Node_Str");
        if (delta != null) {
          command.add("String_Node_Str");
          command.add(msi.getCanonicalPath());
        }
        command.add("String_Node_Str" + System.getProperty("String_Node_Str") + "String_Node_Str");
        deleteMsi=false;
        deleteDelta=false;
        new ProcessBuilder(command).start();
        UpdateActivator.getShutdownService().beginShutdown();
      }
    }
  }
 catch (  FileNotFoundException fnfe) {
    ResourceManagementService resources=Resources.getResources();
    UpdateActivator.getUIService().getPopupDialog().showMessagePopupDialog(resources.getI18NString("String_Node_Str"),resources.getI18NString("String_Node_Str"),PopupDialog.INFORMATION_MESSAGE);
  }
catch (  Exception e) {
    if (logger.isInfoEnabled())     logger.info("String_Node_Str",e);
  }
 finally {
    if (deleteMsi && (msi != null)) {
      msi.delete();
      msi=null;
    }
    if (deleteDelta && (delta != null)) {
      delta.delete();
      delta=null;
    }
  }
}