incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r582122 - /incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java
Date Fri, 05 Oct 2007 08:32:50 GMT
Author: cziegeler
Date: Fri Oct  5 01:32:50 2007
New Revision: 582122

URL: http://svn.apache.org/viewvc?rev=582122&view=rev
Log:
Fix NPE if no cleanup period is configured.

Modified:
    incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java

Modified: incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java?rev=582122&r1=582121&r2=582122&view=diff
==============================================================================
--- incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java
(original)
+++ incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java
Fri Oct  5 01:32:50 2007
@@ -85,7 +85,7 @@
     protected String repositoryPath;
 
     /** We remove everything which is older than 30min by default. */
-    protected int cleanupPeriod;
+    protected int cleanupPeriod = 30;
 
     /** Is the background task still running? */
     protected boolean running;
@@ -102,7 +102,10 @@
     throws RepositoryException {
         this.applicationId = context.getBundleContext().getProperty(Constants.SLING_ID);
         this.repositoryPath = (String)context.getProperties().get(CONFIG_PROPERTY_REPO_PATH);
-        this.cleanupPeriod = (Integer)context.getProperties().get(CONFIG_PROPERTY_CLEANUP_PERIOD);
+        final Integer i = (Integer)context.getProperties().get(CONFIG_PROPERTY_CLEANUP_PERIOD);
+        if ( i != null ) {
+            this.cleanupPeriod = i;
+        }
         this.startSession();
         // start background thread
         this.running = true;



Mime
View raw message