jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r608382 - /jackrabbit/trunk/jackrabbit-ocm/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerImpl.java
Date Thu, 03 Jan 2008 08:56:08 GMT
Author: fmeschbe
Date: Thu Jan  3 00:56:08 2008
New Revision: 608382

URL: http://svn.apache.org/viewvc?rev=608382&view=rev
Log:
JCR-1285 Return null for getObject(query) if no object matches the query

Modified:
    jackrabbit/trunk/jackrabbit-ocm/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerImpl.java

Modified: jackrabbit/trunk/jackrabbit-ocm/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-ocm/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerImpl.java?rev=608382&r1=608381&r2=608382&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-ocm/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-ocm/src/main/java/org/apache/jackrabbit/ocm/manager/impl/ObjectContentManagerImpl.java
Thu Jan  3 00:56:08 2008
@@ -47,7 +47,6 @@
 import org.apache.jackrabbit.ocm.exception.ObjectContentManagerException;
 import org.apache.jackrabbit.ocm.exception.VersionException;
 import org.apache.jackrabbit.ocm.lock.Lock;
-import org.apache.jackrabbit.ocm.manager.ManagerConstant;
 import org.apache.jackrabbit.ocm.manager.ObjectContentManager;
 import org.apache.jackrabbit.ocm.manager.atomictypeconverter.impl.DefaultAtomicTypeConverterProvider;
 import org.apache.jackrabbit.ocm.manager.cache.ObjectCache;
@@ -535,7 +534,7 @@
             throw new ObjectContentManagerException("Impossible to get the object - the query
returns more than one object");
         }
 
-        return result.iterator().next();
+        return result.isEmpty() ? null : result.iterator().next();
     }
 
     /**



Mime
View raw message