Program: 166562
Project: 166562
Buggy source:
@Override public void update(final Handler handler,final Item item,final boolean with_filedata) throws CloudsyncException, FileIOException {
  initService(handler);
  int retryCount=0;
  do {
    try {
      refreshCredential();
      if (item.isType(ItemType.FILE)) {
        final File _parentDriveItem=_getHistoryFolder(item);
        if (_parentDriveItem != null) {
          final File copyOfdriveItem=new File();
          final ParentReference _parentReference=new ParentReference();
          _parentReference.setId(_parentDriveItem.getId());
          copyOfdriveItem.setParents(Arrays.asList(_parentReference));
          final File _copyOfDriveItem=service.files().copy(item.getRemoteIdentifier(),copyOfdriveItem).execute();
          if (_copyOfDriveItem == null) {
            throw new CloudsyncException("String_Node_Str" + item.getPath() + "String_Node_Str");
          }
        }
      }
      File driveItem=new File();
      final LocalStreamData data=_prepareDriveItem(driveItem,item,handler,with_filedata);
      if (data == null) {
        driveItem=service.files().update(item.getRemoteIdentifier(),driveItem).execute();
      }
 else {
        final InputStreamContent params=new InputStreamContent(FILE,data.getStream());
        params.setLength(data.getLength());
        Update updater=service.files().update(item.getRemoteIdentifier(),driveItem,params);
        MediaHttpUploader uploader=updater.getMediaHttpUploader();
        prepareUploader(uploader,data.getLength());
        driveItem=updater.execute();
      }
      if (driveItem == null) {
        throw new CloudsyncException("String_Node_Str" + item.getPath() + "String_Node_Str");
      }
 else       if (driveItem.getLabels().getTrashed()) {
        throw new CloudsyncException("String_Node_Str" + item.getPath() + "String_Node_Str"+ driveItem.getId()+ "String_Node_Str");
      }
      _addToCache(driveItem,null);
      return;
    }
 catch (    final IOException e) {
      retryCount=validateException("String_Node_Str",item,e,retryCount);
    }
  }
 while (true);
}

Fixed version (ground truth):
@Override public void update(final Handler handler,final Item item,final boolean with_filedata) throws CloudsyncException, FileIOException {
  initService(handler);
  int retryCount=0;
  do {
    try {
      refreshCredential();
      if (item.isType(ItemType.FILE)) {
        final File _parentDriveItem=_getHistoryFolder(item);
        if (_parentDriveItem != null) {
          final File copyOfdriveItem=new File();
          final ParentReference _parentReference=new ParentReference();
          _parentReference.setId(_parentDriveItem.getId());
          copyOfdriveItem.setParents(Arrays.asList(_parentReference));
          final File _copyOfDriveItem=service.files().copy(item.getRemoteIdentifier(),copyOfdriveItem).execute();
          if (_copyOfDriveItem == null) {
            throw new CloudsyncException("String_Node_Str" + item.getPath() + "String_Node_Str");
          }
        }
      }
      File driveItem=new File();
      final LocalStreamData data=_prepareDriveItem(driveItem,item,handler,with_filedata);
      if (data == null) {
        driveItem=service.files().update(item.getRemoteIdentifier(),driveItem).execute();
      }
 else {
        final InputStreamContent params=new InputStreamContent(FILE,data.getStream());
        params.setLength(data.getLength());
        Update updater=service.files().update(item.getRemoteIdentifier(),driveItem,params);
        MediaHttpUploader uploader=updater.getMediaHttpUploader();
        prepareUploader(uploader,data.getLength());
        driveItem=updater.execute();
      }
      if (driveItem == null) {
        throw new CloudsyncException("String_Node_Str" + item.getPath() + "String_Node_Str");
      }
 else       if (driveItem.getLabels().getTrashed()) {
        throw new CloudsyncException("String_Node_Str" + item.getPath() + "String_Node_Str"+ driveItem.getId()+ "String_Node_Str");
      }
      _addToCache(driveItem,null);
      return;
    }
 catch (    final IOException e) {
      retryCount=validateException("String_Node_Str",item,e,retryCount);
      if (retryCount < 0)       retryCount=0;
    }
  }
 while (true);
}