Buggy code:
public class SynchronizeFolderOperation extends SyncOperation { private static final String TAG = SynchronizeFolderOperation . class . getSimpleName ( ) ; private long mCurrentSyncTime ; private OCFile mLocalFolder ; private Account mAccount ; private Context mContext ; private List < OCFile > mChildren ; private int mConflictsFound ; private int mFailsInFavouritesFound ; private Map < String , String > mForgottenLocalFiles ; private boolean mRemoteFolderChanged ; public SynchronizeFolderOperation ( Context context , String remotePath , Account account , long currentSyncTime ) { } public int getConflictsFound ( ) { } public int getFailsInFavouritesFound ( ) { } public Map < String , String > getForgottenLocalFiles ( ) { } public List < OCFile > getChildren ( ) { } @ Override protected RemoteOperationResult run ( OwnCloudClient client ) { } private RemoteOperationResult checkForChanges ( OwnCloudClient client ) { } private RemoteOperationResult fetchAndSyncRemoteFolder ( OwnCloudClient client ) { } private void removeLocalFolder ( ) { } private void synchronizeData ( ArrayList < Object > folderAndFiles , OwnCloudClient client ) { FileDataStorageManager storageManager = getStorageManager ( ) ; mLocalFolder = storageManager . getFileByPath ( mLocalFolder . getRemotePath ( ) ) ; OCFile remoteFolder = fillOCFile ( ( ( RemoteFile ) ( folderAndFiles . get ( 0 ) ) ) ) ; remoteFolder . setParentId ( mLocalFolder . getParentId ( ) ) ; remoteFolder . setFileId ( mLocalFolder . getFileId ( ) ) ; Log_OC . d ( SynchronizeFolderOperation . TAG , ( ( "Remote<seq2seq4repair_space>folder<seq2seq4repair_space>" + ( mLocalFolder . getRemotePath ( ) ) ) + "<seq2seq4repair_space>changed<seq2seq4repair_space>-<seq2seq4repair_space>starting<seq2seq4repair_space>update<seq2seq4repair_space>of<seq2seq4repair_space>local<seq2seq4repair_space>data<seq2seq4repair_space>" ) ) ; List < OCFile > updatedFiles = new Vector < OCFile > ( ( ( folderAndFiles . size ( ) ) - 1 ) ) ; List < SynchronizeFileOperation > filesToSyncContents = new Vector < SynchronizeFileOperation > ( ) ; List < OCFile > localFiles = storageManager . getFolderContent ( mLocalFolder ) ; Map < String , OCFile > localFilesMap = new HashMap < String , OCFile > ( localFiles . size ( ) ) ; for ( OCFile file : localFiles ) { localFilesMap . put ( file . getRemotePath ( ) , file ) ; } OCFile remoteFile = null ; OCFile localFile = null ; for ( int i = 1 ; i < ( folderAndFiles . size ( ) ) ; i ++ ) { remoteFile = fillOCFile ( ( ( RemoteFile ) ( folderAndFiles . get ( i ) ) ) ) ; remoteFile . setParentId ( mLocalFolder . getFileId ( ) ) ; localFile = localFilesMap . remove ( remoteFile . getRemotePath ( ) ) ; remoteFile . setLastSyncDateForProperties ( mCurrentSyncTime ) ; if ( localFile != null ) { remoteFile . setFileId ( localFile . getFileId ( ) ) ; remoteFile . setKeepInSync ( localFile . keepInSync ( ) ) ; remoteFile . setLastSyncDateForData ( localFile . getLastSyncDateForData ( ) ) ; remoteFile . setModificationTimestampAtLastSyncForData ( localFile . getModificationTimestampAtLastSyncForData ( ) ) ; remoteFile . setStoragePath ( localFile . getStoragePath ( ) ) ; remoteFile . setEtag ( localFile . getEtag ( ) ) ; if ( remoteFile . isFolder ( ) ) { remoteFile . setFileLength ( localFile . getFileLength ( ) ) ; } else if ( ( ( mRemoteFolderChanged ) && ( remoteFile . isImage ( ) ) ) && ( ( remoteFile . getModificationTimestamp ( ) ) != ( localFile . getModificationTimestamp ( ) ) ) ) { remoteFile . setNeedsUpdateThumbnail ( true ) ; Log . d ( SynchronizeFolderOperation . TAG , ( ( "Image<seq2seq4repair_space>" + ( remoteFile . getFileName ( ) ) ) + "<seq2seq4repair_space>updated<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>server" ) ) ; } remoteFile . setPublicLink ( localFile . getPublicLink ( ) ) ; remoteFile . setShareByLink ( localFile . isShareByLink ( ) ) ; } else { remoteFile . setEtag ( "" ) ; } checkAndFixForeignStoragePath ( remoteFile ) ; searchForLocalFileInDefaultPath ( remoteFile ) ; if ( remoteFile . keepInSync ( ) ) { SynchronizeFileOperation operation = new SynchronizeFileOperation ( localFile , remoteFile , mAccount , true , mContext ) ; filesToSyncContents . add ( operation ) ; } if ( ! ( remoteFile . isFolder ( ) ) ) { requestForDownloadFile ( remoteFile ) ; } else { <START_BUG> RemoteOperation synchFolderOp = new SyncFolderOperation ( mContext , remoteFile . getRemotePath ( ) , mAccount , mCurrentSyncTime ) ; <END_BUG> synchFolderOp . execute ( mAccount , mContext , null , null ) ; } updatedFiles . add ( remoteFile ) ; } storageManager . saveFolder ( remoteFolder , updatedFiles , localFilesMap . values ( ) ) ; startContentSynchronizations ( filesToSyncContents , client ) ; mChildren = updatedFiles ; } private void startContentSynchronizations ( List < SynchronizeFileOperation > filesToSyncContents , OwnCloudClient client ) { } public boolean isMultiStatus ( int status ) { } private OCFile fillOCFile ( RemoteFile remote ) { } private void checkAndFixForeignStoragePath ( OCFile file ) { } private void searchForLocalFileInDefaultPath ( OCFile file ) { } private void requestForDownloadFile ( OCFile file ) { } public boolean getRemoteFolderChanged ( ) { } }

Fix:
SynchronizeFolderOperation synchFolderOp = new SynchronizeFolderOperation ( mContext , remoteFile . getRemotePath ( ) , mAccount , mCurrentSyncTime ) ;