Author: markt
Date: Mon Dec  4 10:00:59 2017
New Revision: 1817078

URL: http://svn.apache.org/viewvc?rev=1817078&view=rev
Log:
offer() checks for parent==null so force should too

Modified:
    tomcat/trunk/java/org/apache/catalina/tribes/util/ExecutorFactory.java

Modified: tomcat/trunk/java/org/apache/catalina/tribes/util/ExecutorFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/util/ExecutorFactory.java?rev=1817078&r1=1817077&r2=1817078&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/util/ExecutorFactory.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/util/ExecutorFactory.java Mon 
Dec  4 10:00:59 2017
@@ -92,8 +92,11 @@ public class ExecutorFactory {
         }
 
         public boolean force(Runnable o) {
-            if ( parent.isShutdown() ) throw new 
RejectedExecutionException(sm.getString("executorFactory.not.running"));
-            return super.offer(o); //forces the item onto the queue, to be 
used if the task is rejected
+            if (parent != null && parent.isShutdown()) {
+                throw new 
RejectedExecutionException(sm.getString("executorFactory.not.running"));
+            }
+            // Forces the item onto the queue, to be used if the task is 
rejected
+            return super.offer(o);
         }
 
         @Override



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to