jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r638867 - /jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Timer.java
Date Wed, 19 Mar 2008 15:21:55 GMT
Author: mreutegg
Date: Wed Mar 19 08:21:43 2008
New Revision: 638867

URL: http://svn.apache.org/viewvc?rev=638867&view=rev
Log:
JCR-1486: Introduce Timer idle time
- NullPointerException may happen when idle checker task runs while Timer.cancel() is called.

Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Timer.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Timer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Timer.java?rev=638867&r1=638866&r2=638867&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Timer.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Timer.java
Wed Mar 19 08:21:43 2008
@@ -188,8 +188,10 @@
             synchronized (Timer.this) {
                 if (numScheduledTasks == 0 &&
                         System.currentTimeMillis() > lastTaskScheduled + IDLE_TIME) {
-                    delegatee.cancel();
-                    delegatee = null;
+                    if (delegatee != null) {
+                        delegatee.cancel();
+                        delegatee = null;
+                    }
                 }
             }
         }



Mime
View raw message