[jboss-cvs] JBossAS SVN: r112712 - branches/JBPAPP_5_1_2_GA_JBPAPP-8231/server/src/main/org/jboss/ejb/txtimer.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Feb 29 00:22:41 EST 2012


Author: bmaxwell
Date: 2012-02-29 00:22:40 -0500 (Wed, 29 Feb 2012)
New Revision: 112712

Modified:
   branches/JBPAPP_5_1_2_GA_JBPAPP-8231/server/src/main/org/jboss/ejb/txtimer/TimerImpl.java
Log:
[JBPAPP-8231] fix NPE when cancelling timer within same tx

Modified: branches/JBPAPP_5_1_2_GA_JBPAPP-8231/server/src/main/org/jboss/ejb/txtimer/TimerImpl.java
===================================================================
--- branches/JBPAPP_5_1_2_GA_JBPAPP-8231/server/src/main/org/jboss/ejb/txtimer/TimerImpl.java	2012-02-29 05:21:36 UTC (rev 112711)
+++ branches/JBPAPP_5_1_2_GA_JBPAPP-8231/server/src/main/org/jboss/ejb/txtimer/TimerImpl.java	2012-02-29 05:22:40 UTC (rev 112712)
@@ -259,7 +259,9 @@
       if (timerState != EXPIRED)
          setTimerState(CANCELED);
       timerService.removeTimer(this);
-      scheduledFuture.cancel(false);
+      // if started within a tx there is no future yet
+      if (scheduledFuture != null)
+         scheduledFuture.cancel(false);
    }
 
    /**



More information about the jboss-cvs-commits mailing list