Bug 783659 - Fix Android Sync integration tests by initializing exception cause correctly. r=rnewman
authorNick Alexander <nalexander@mozilla.com>
Wed, 22 Aug 2012 11:01:36 -0700
changeset 103036 e8289a629cd44b6720aa8fb93e47861cfc7bf25c
parent 103035 236d384dc4f98ab74e5bdece2a9da58eac7c1fdd
child 103037 98fc3d40910c19cbc1ab131488f81546ac089b06
push id13788
push usernalexander@mozilla.com
push dateWed, 22 Aug 2012 18:05:21 +0000
treeherdermozilla-inbound@e8289a629cd4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs783659
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 783659 - Fix Android Sync integration tests by initializing exception cause correctly. r=rnewman
mobile/android/base/sync/repositories/RepositorySession.java
--- a/mobile/android/base/sync/repositories/RepositorySession.java
+++ b/mobile/android/base/sync/repositories/RepositorySession.java
@@ -235,19 +235,17 @@ public abstract class RepositorySession 
    * @throws InactiveSessionException
    */
   public void finish(final RepositorySessionFinishDelegate delegate) throws InactiveSessionException {
     try {
       this.transitionFrom(SessionStatus.ACTIVE, SessionStatus.DONE);
       delegate.deferredFinishDelegate(delegateQueue).onFinishSucceeded(this, this.getBundle(null));
     } catch (InvalidSessionTransitionException e) {
       Logger.error(LOG_TAG, "Tried to finish() an unstarted or already finished session");
-      InactiveSessionException ex = new InactiveSessionException(null);
-      ex.initCause(e);
-      throw ex;
+      throw new InactiveSessionException(e);
     }
 
     Logger.trace(LOG_TAG, "Shutting down work queues.");
     storeWorkQueue.shutdown();
     delegateQueue.shutdown();
   }
 
   /**