Program: 5046
Project: 5046
Buggy source:
/** 
 * this method attempts to perform an update --  getting the new jar file from the server, replacing it, and making the call to change the launch anywhere "LAX" file. 
 */
public void update() throws CantConnectException {
  StringBuffer newFileBuf=new StringBuffer("String_Node_Str");
  StringTokenizer fileTok=new StringTokenizer(_newVersion,"String_Node_Str");
  newFileBuf.append(fileTok.nextToken());
  newFileBuf.append(fileTok.nextToken());
  newFileBuf.append("String_Node_Str");
  String newFileName=newFileBuf.toString();
  String fullPath=_currentDirectory + newFileName;
  File jarFile=new File(fullPath);
  if (jarFile.exists()) {
    jarFile.delete();
  }
  try {
    String pathName="String_Node_Str" + newFileName;
    URL url=new URL("String_Node_Str","String_Node_Str",pathName);
    URLConnection conn=url.openConnection();
    conn.connect();
    _updateSize=conn.getContentLength();
    if (_updateSize == -1) {
      cancelUpdate("String_Node_Str");
    }
 else {
      _updateHandler.showProgressWindow(_updateSize);
      InputStream is=conn.getInputStream();
      ByteReader byteReader=new ByteReader(is);
      FileOutputStream fos=new FileOutputStream(fullPath,true);
      int percentRead=0;
      _amountRead=0;
      int newBytes=-1;
      byte[] buf=new byte[1024];
      while (true) {
        _updateHandler.update(_amountRead);
        if (_amountRead == _updateSize)         break;
        if (_amountRead > _updateSize) {
          break;
        }
        newBytes=byteReader.read(buf);
        if (newBytes == -1)         break;
        fos.write(buf,0,newBytes);
        _amountRead+=newBytes;
      }
      byteReader.close();
      fos.close();
      if (_amountRead == _updateSize) {
        _updateHandler.hideProgressWindow();
        if (updateLAXFile(newFileName)) {
          String message="String_Node_Str" + "String_Node_Str";
          Utilities.showMessage(message);
          _settings.setLastVersionChecked(_newVersion);
        }
        _settings.writeProperties();
        System.exit(0);
      }
    }
  }
 catch (  MalformedURLException mue) {
  }
catch (  IOException ioe) {
  }
}

Fixed version (ground truth):
/** 
 * Attempts to perform an update -- getting the new jar file from the server, replacing it, and making the call to change the launch anywhere "LAX" file.  If the update is succesful, terminates the JVM.  Throws CantConnectException if the update failed.  Note that this method should never return without an exception.  
 */
private void update() throws CantConnectException {
  StringBuffer newFileBuf=new StringBuffer("String_Node_Str");
  StringTokenizer fileTok=new StringTokenizer(_newVersion,"String_Node_Str");
  newFileBuf.append(fileTok.nextToken());
  newFileBuf.append(fileTok.nextToken());
  newFileBuf.append("String_Node_Str");
  String newFileName=newFileBuf.toString();
  String fullPath=_currentDirectory + newFileName;
  File jarFile=new File(fullPath);
  if (jarFile.exists()) {
    jarFile.delete();
  }
  try {
    String pathName="String_Node_Str" + newFileName;
    URL url=new URL("String_Node_Str","String_Node_Str",pathName);
    URLConnection conn=(new URLOpener(url)).connect(CONNECT_TIMEOUT);
    _updateSize=conn.getContentLength();
    if (_updateSize == -1) {
      cancelUpdate("String_Node_Str");
    }
 else {
      _updateHandler.showProgressWindow(_updateSize);
      InputStream is=conn.getInputStream();
      ByteReader byteReader=new ByteReader(is);
      FileOutputStream fos=new FileOutputStream(fullPath,true);
      int percentRead=0;
      _amountRead=0;
      int newBytes=-1;
      byte[] buf=new byte[1024];
      while (true) {
        _updateHandler.update(_amountRead);
        if (_amountRead == _updateSize)         break;
        if (_amountRead > _updateSize) {
          break;
        }
        newBytes=byteReader.read(buf);
        if (newBytes == -1)         break;
        fos.write(buf,0,newBytes);
        _amountRead+=newBytes;
      }
      byteReader.close();
      fos.close();
      if (_amountRead == _updateSize) {
        _updateHandler.hideProgressWindow();
        if (updateLAXFile(newFileName)) {
          String message="String_Node_Str" + "String_Node_Str";
          Utilities.showMessage(message);
          _settings.setLastVersionChecked(_newVersion);
        }
        _settings.writeProperties();
        System.exit(0);
      }
    }
  }
 catch (  IOException ioe) {
    throw new CantConnectException();
  }
}