From b24044ddd1f7fc0b0a1cf4088c22ff0d487155a9 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Fri, 30 Mar 2012 16:15:18 -0700 Subject: [PATCH] Fixed a deadlock, made errors more descriptive --- .../com/todoroo/astrid/actfm/sync/ActFmSyncService.java | 4 ++-- .../com/todoroo/astrid/actfm/sync/ActFmSyncV2Provider.java | 4 ++-- .../todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java index b229618f4..f27f0f032 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java @@ -117,7 +117,7 @@ public final class ActFmSyncService { private Thread pushRetryThread = null; private Runnable pushRetryRunnable; private final AtomicInteger taskPushThreads = new AtomicInteger(0); - private final ConditionVariable waitUntilEmpty = new ConditionVariable(); + private final ConditionVariable waitUntilEmpty = new ConditionVariable(true); public void initialize() { initializeRetryRunnable(); @@ -1099,7 +1099,7 @@ public final class ActFmSyncService { } catch (IOException e) { if (handler != null) - handler.handleException("io-exception-list-" + model, e, e.getMessage()); + handler.handleException("io-exception-list-" + model, e, e.toString()); else handleException("io-exception-list-" + model, e); } catch (JSONException e) { diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncV2Provider.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncV2Provider.java index b2567c1f8..3912c4107 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncV2Provider.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncV2Provider.java @@ -140,9 +140,9 @@ public class ActFmSyncV2Provider extends SyncV2Provider { time = actFmSyncService.fetchTags(time); Preferences.setInt(LAST_TAG_FETCH_TIME, time); } catch (JSONException e) { - handler.handleException("actfm-sync", e, e.getMessage()); //$NON-NLS-1$ + handler.handleException("actfm-sync", e, e.toString()); //$NON-NLS-1$ } catch (IOException e) { - handler.handleException("actfm-sync", e, e.getMessage()); //$NON-NLS-1$ + handler.handleException("actfm-sync", e, e.toString()); //$NON-NLS-1$ } finally { callback.incrementProgress(20); if(finisher.decrementAndGet() == 0) { diff --git a/astrid/plugin-src/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java b/astrid/plugin-src/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java index 5d1f2885b..309a6e69a 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java +++ b/astrid/plugin-src/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java @@ -115,7 +115,7 @@ public class GtasksSyncV2Provider extends SyncV2Provider { } catch (GoogleTasksException e) { handler.handleException("gtasks-sync=io", e, e.getType()); //$NON-NLS-1$ } catch (IOException e) { - handler.handleException("gtasks-sync=io", e, e.getMessage()); //$NON-NLS-1$ + handler.handleException("gtasks-sync=io", e, e.toString()); //$NON-NLS-1$ } StoreObject[] lists = gtasksListService.getLists(); @@ -158,7 +158,7 @@ public class GtasksSyncV2Provider extends SyncV2Provider { } catch (GoogleTasksException e) { handler.handleException("gtasks-sync-io", e, e.getType()); //$NON-NLS-1$ } catch (IOException e) { - handler.handleException("gtasks-sync-io", e, e.getMessage()); //$NON-NLS-1$ + handler.handleException("gtasks-sync-io", e, e.toString()); //$NON-NLS-1$ } finally { callback.incrementProgress(10); } @@ -262,7 +262,7 @@ public class GtasksSyncV2Provider extends SyncV2Provider { errorHandler.handleException("gtasks-sync-io", e, e.getType()); //$NON-NLS-1$ } catch (IOException e) { if (errorHandler != null) - errorHandler.handleException("gtasks-sync-io", e, e.getMessage()); //$NON-NLS-1$ + errorHandler.handleException("gtasks-sync-io", e, e.toString()); //$NON-NLS-1$ } }