jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1330861 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
Date Thu, 26 Apr 2012 14:05:51 GMT
Author: angela
Date: Thu Apr 26 14:05:50 2012
New Revision: 1330861

URL: http://svn.apache.org/viewvc?rev=1330861&view=rev
Log:
OAK-72 - Implement JCR API

- delegate Item#save and Item#refresh to the session methods and log warning.

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java?rev=1330861&r1=1330860&r2=1330861&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
Thu Apr 26 14:05:50 2012
@@ -25,7 +25,6 @@ import javax.jcr.Item;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
-import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.ValueFactory;
 
 /**
@@ -117,16 +116,18 @@ abstract class ItemImpl implements Item 
      * @see javax.jcr.Item#save()
      */
     @Override
-    public void save() throws UnsupportedRepositoryOperationException {
-        throw new UnsupportedRepositoryOperationException("Use Session#save");
+    public void save() throws RepositoryException {
+        log.warn("Item#save is no longer supported. Please use Session#save instead.");
+        getSession().save();
     }
 
     /**
      * @see Item#refresh(boolean)
      */
     @Override
-    public void refresh(boolean keepChanges) throws UnsupportedRepositoryOperationException
{
-        throw new UnsupportedRepositoryOperationException("Use Session#refresh");
+    public void refresh(boolean keepChanges) throws RepositoryException {
+        log.warn("Item#refresh is no longer supported. Please use Session#refresh");
+        getSession().refresh(keepChanges);
     }
 
     //--------------------------------------------------------------------------



Mime
View raw message