polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [1/6] zest-qi4j git commit: Fix for ZEST-38. A scheduler bug.
Date Wed, 08 Jul 2015 08:15:11 GMT
Repository: zest-qi4j
Updated Branches:
  refs/heads/develop 79b32908a -> 746d6205c


Fix for ZEST-38. A scheduler bug.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/8f89de58
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/8f89de58
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/8f89de58

Branch: refs/heads/develop
Commit: 8f89de588ebeb2e551fcc8b917565f8db2af7f7b
Parents: 5bb6dbf
Author: Niclas Hedhman <hedmann@betfair.com>
Authored: Wed Jul 8 09:33:45 2015 +0300
Committer: Niclas Hedhman <hedmann@betfair.com>
Committed: Wed Jul 8 09:33:45 2015 +0300

----------------------------------------------------------------------
 .../java/org/qi4j/library/scheduler/SchedulerMixin.java  | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/8f89de58/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/SchedulerMixin.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/SchedulerMixin.java
b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/SchedulerMixin.java
index 6650573..c2b81b5 100644
--- a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/SchedulerMixin.java
+++ b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/SchedulerMixin.java
@@ -180,7 +180,10 @@ public class SchedulerMixin
                 {
                     // We need to restart the managementThread, which is currently waiting
for a 'later' event to
                     // occur than the one that was just scheduled.
-                    scheduleHandler.future.cancel( true );
+                    if( scheduleHandler != null && scheduleHandler.future != null
)
+                    {
+                        scheduleHandler.future.cancel( true );
+                    }
                     dispatchHandler();
                 }
             }
@@ -220,9 +223,9 @@ public class SchedulerMixin
         }
         // Throws IllegalArgument if corePoolSize or keepAliveTime less than zero, or if
workersCount less than or equal to zero, or if corePoolSize greater than workersCount.
         taskExecutor = new ThreadPoolExecutor( corePoolSize, workersCount,
-                                               0, TimeUnit.MILLISECONDS,
-                                               new LinkedBlockingQueue<Runnable>( workQueueSize
),
-                                               threadFactory, rejectionHandler );
+            0, TimeUnit.MILLISECONDS,
+            new LinkedBlockingQueue<Runnable>( workQueueSize ),
+            threadFactory, rejectionHandler );
         taskExecutor.prestartAllCoreThreads();
         managementExecutor = new ScheduledThreadPoolExecutor( 2, threadFactory, rejectionHandler
);
         loadSchedules();


Mime
View raw message