You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2014/05/09 22:58:46 UTC

svn commit: r1593617 - /sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/helpers/Poller.java

Author: rombert
Date: Fri May  9 20:58:46 2014
New Revision: 1593617

URL: http://svn.apache.org/r1593617
Log:
SLING-3551 - Content sync does not propagate mixin types

The Poller now propagates the last caught throwable in all situations.

Modified:
    sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/helpers/Poller.java

Modified: sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/helpers/Poller.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/helpers/Poller.java?rev=1593617&r1=1593616&r2=1593617&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/helpers/Poller.java (original)
+++ sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/helpers/Poller.java Fri May  9 20:58:46 2014
@@ -33,7 +33,7 @@ public class Poller {
 
         long cutoff = System.currentTimeMillis() + DEFAULT_POLL_WAIT_MILLIS;
 
-        Error lastError = null;
+        Throwable lastError = null;
 
         while (true) {
 
@@ -41,6 +41,7 @@ public class Poller {
                 r.run();
                 break;
             } catch (RuntimeException e) {
+                lastError = e;
                 // skip
             } catch (AssertionFailedError e) {
                 lastError = e;
@@ -52,8 +53,10 @@ public class Poller {
 
             if (System.currentTimeMillis() >= cutoff) {
 
-                if (lastError != null) {
-                    throw lastError;
+                if (lastError instanceof RuntimeException) {
+                    throw (RuntimeException) lastError;
+                } else if (lastError instanceof Error) {
+                    throw (Error) lastError;
                 }
 
                 throw new AssertionFailedError("Runnable " + r + " did not succeed in the allocated "