jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r745534 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: SessionImpl.java data/GarbageCollector.java
Date Wed, 18 Feb 2009 15:08:24 GMT
Author: thomasm
Date: Wed Feb 18 15:08:23 2009
New Revision: 745534

URL: http://svn.apache.org/viewvc?rev=745534&view=rev
Log:
JCR-1985 NullPointerException in GarbageCollector.scan() if no DataStore configured

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java?rev=745534&r1=745533&r2=745534&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
Wed Feb 18 15:08:23 2009
@@ -38,7 +38,6 @@
 import org.apache.jackrabbit.api.jsr283.security.AccessControlManager;
 import org.apache.jackrabbit.api.jsr283.retention.RetentionManager;
 import org.apache.jackrabbit.core.security.authentication.AuthContext;
-import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.LocalItemStateManager;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.SessionItemStateManager;
@@ -419,7 +418,7 @@
         if (workspaceName == null) {
             workspaceName = rep.getConfig().getDefaultWorkspaceName();
         }
-        if (loginContext!=null) {
+        if (loginContext != null) {
             return rep.createSession(loginContext, workspaceName);
         } else {
             return rep.createSession(getSubject(), workspaceName);
@@ -667,10 +666,9 @@
     /**
      * Create a data store garbage collector for this repository.
      *
-     * @throws ItemStateException
      * @throws RepositoryException
      */
-    public GarbageCollector createDataStoreGarbageCollector() throws RepositoryException,
ItemStateException {
+    public GarbageCollector createDataStoreGarbageCollector() throws RepositoryException
{
         ArrayList pmList = new ArrayList();
         VersionManagerImpl vm = (VersionManagerImpl) rep.getVersionManager();
         PersistenceManager pm = vm.getPersistenceManager();

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java?rev=745534&r1=745533&r2=745534&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java
Wed Feb 18 15:08:23 2009
@@ -147,6 +147,9 @@
      */
     public void scan() throws RepositoryException,
             IllegalStateException, IOException, ItemStateException {
+        if (store == null) {
+            throw new RepositoryException("No DataStore configured.");
+        }
         long now = System.currentTimeMillis();
         if (startScanTimestamp == 0) {
             startScanTimestamp = now;



Mime
View raw message