jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r156325 - in incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: LazyItemIterator.java NodeImpl.java state/SharedItemStateManager.java version/persistence/InternalVersionHistoryImpl.java version/persistence/InternalVersionImpl.java version/persistence/NativePVM.java
Date Sun, 06 Mar 2005 16:39:26 GMT
Author: stefan
Date: Sun Mar  6 08:39:23 2005
New Revision: 156325

URL: http://svn.apache.org/viewcvs?view=rev&rev=156325
Log:
changing javadoc pattern for implementation of interface methods
from  @see ... style to {@inheritDoc}

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/LazyItemIterator.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionHistoryImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/NativePVM.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/LazyItemIterator.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/LazyItemIterator.java?view=diff&r1=156324&r2=156325
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/LazyItemIterator.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/LazyItemIterator.java Sun
Mar  6 08:39:23 2005
@@ -16,11 +16,17 @@
  */
 package org.apache.jackrabbit.core;
 
-import javax.jcr.*;
-import java.util.List;
-import java.util.NoSuchElementException;
+import org.apache.log4j.Logger;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
+import javax.jcr.RepositoryException;
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
 
 /**
  * <code>LazyItemIterator</code> is an id-based iterator that instantiates
@@ -28,6 +34,8 @@
  */
 class LazyItemIterator implements NodeIterator, PropertyIterator {
 
+    private static Logger log = Logger.getLogger(LazyItemIterator.class);
+
     /**
      * the item manager that is used to fetch the items
      */
@@ -56,13 +64,19 @@
     /**
      * Creates a new <code>LazyItemIterator</code> instance.
      *
-     * @param itemMgr item manager
-     * @param idList  list of item id's
+     * @param itemMgr        item manager
+     * @param idList         list of item id's
+     * @param skipInexistent if <code>true</code> the id's of those items
+     *                       that appear to be non-existent will be filtered
+     *                       out silently; otherwise such entries will cause
+     *                       a <code>NoSuchElementException</code> on
+     *                       <code>{@link #next()}</code> .
      */
-    public LazyItemIterator(ItemManager itemMgr, List idList, boolean skipInexistent) {
+    public LazyItemIterator(ItemManager itemMgr, List idList,
+                            boolean skipInexistent) {
         this.itemMgr = itemMgr;
         if (skipInexistent) {
-            // check all items first
+            // check existence of all items first
             this.idList = new ArrayList();
             Iterator iter = idList.iterator();
             while (iter.hasNext()) {
@@ -76,7 +90,7 @@
         }
     }
 
-    //-------------------------------------------------------< NodeIterator >---
+    //---------------------------------------------------------< NodeIterator >
     /**
      * {@inheritDoc}
      */
@@ -84,7 +98,7 @@
         return (Node) next();
     }
 
-    //---------------------------------------------------< PropertyIterator >---
+    //-----------------------------------------------------< PropertyIterator >
     /**
      * {@inheritDoc}
      */
@@ -120,7 +134,7 @@
         pos += skipNum;
     }
 
-    //-----------------------------------------------------------< Iterator >---
+    //-------------------------------------------------------------< Iterator >
     /**
      * {@inheritDoc}
      */
@@ -135,9 +149,11 @@
         if (pos >= idList.size()) {
             throw new NoSuchElementException();
         }
+        ItemId id = (ItemId) idList.get(pos++);
         try {
-            return itemMgr.getItem((ItemId) idList.get(pos++));
+            return itemMgr.getItem(id);
         } catch (RepositoryException e) {
+            log.debug("failed to fetch item " + id, e);
             throw new NoSuchElementException(e.getMessage());
         }
     }
@@ -145,7 +161,7 @@
     /**
      * {@inheritDoc}
      *
-     * @throws UnsupportedOperationException allways, since not implemented
+     * @throws UnsupportedOperationException always since not implemented
      */
     public void remove() {
         throw new UnsupportedOperationException("remove");

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java?view=diff&r1=156324&r2=156325
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java Sun Mar 
6 08:39:23 2005
@@ -874,6 +874,28 @@
     }
 
     /**
+     * Same as <code>{@link Node#getReferences()}</code> except that
+     * this method also filters out the references that appear to non-existent
+     * in this workspace if <code>skipInexistent</code> is set to <code>true</code>.
+     *
+     * @param skipInexistent if set to <code>true</code> inexistent items are
skipped
+     */
+    protected PropertyIterator getReferences(boolean skipInexistent)
+            throws RepositoryException {
+        try {
+            NodeReferencesId targetId = new NodeReferencesId(((NodeId) id).getUUID());
+            NodeReferences refs = stateMgr.getNodeReferences(targetId);
+            // refs.getReferences returns a list of PropertyId's
+            List idList = refs.getReferences();
+            return new LazyItemIterator(itemMgr, idList, skipInexistent);
+        } catch (ItemStateException e) {
+            String msg = "Unable to retrieve node references for: " + id;
+            log.debug(msg);
+            throw new RepositoryException(msg, e);
+        }
+    }
+
+    /**
      * Same as {@link Node#addMixin(String)}, but takes a <code>QName</code>
      * instad of a <code>String</code>.
      *
@@ -2420,30 +2442,6 @@
      */
     public PropertyIterator getReferences() throws RepositoryException {
         return getReferences(false);
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * In addition to the normal behaviour, this method also filters out the
-     * references that do not exist in this workspace if <code>skipExistent</code>
-     * is set to <code>true</code>.
-     *
-     * @param skipInexistent if set to <code>true</code> inexistent items are
skipped
-     */
-    protected PropertyIterator getReferences(boolean skipInexistent)
-            throws RepositoryException {
-        try {
-            NodeReferencesId targetId = new NodeReferencesId(((NodeId) id).getUUID());
-            NodeReferences refs = stateMgr.getNodeReferences(targetId);
-            // refs.getReferences returns a list of PropertyId's
-            List idList = refs.getReferences();
-            return new LazyItemIterator(itemMgr, idList, skipInexistent);
-        } catch (ItemStateException e) {
-            String msg = "Unable to retrieve node references for: " + id;
-            log.debug(msg);
-            throw new RepositoryException(msg, e);
-        }
     }
 
     /**

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java?view=diff&r1=156324&r2=156325
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
Sun Mar  6 08:39:23 2005
@@ -33,8 +33,8 @@
 import javax.jcr.PropertyType;
 import javax.jcr.nodetype.NoSuchNodeTypeException;
 import java.io.PrintStream;
-import java.util.Iterator;
 import java.util.ArrayList;
+import java.util.Iterator;
 
 /**
  * Shared <code>ItemStateManager</code>. Caches objects returned from a
@@ -403,7 +403,7 @@
             NodeReferences refs = (NodeReferences) iter.next();
             NodeId id = new NodeId(refs.getUUID());
             // if targetid is in virtual provider, transfer to its modified set
-            for (int i=0; i<virtualProviders.length; i++) {
+            for (int i = 0; i < virtualProviders.length; i++) {
                 VirtualItemStateProvider provider = virtualProviders[i];
                 if (provider.hasItemState(id)) {
                     virtualRefs.add(refs);
@@ -472,7 +472,7 @@
         while (iter.hasNext()) {
             NodeReferences refs = (NodeReferences) iter.next();
             // if targetid is in virtual provider, transfer to its modified set
-            for (int i=0; i<virtualProviders.length; i++) {
+            for (int i = 0; i < virtualProviders.length; i++) {
                 if (virtualProviders[i].setNodeReferences(refs)) {
                     break;
                 }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionHistoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionHistoryImpl.java?view=diff&r1=156324&r2=156325
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionHistoryImpl.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionHistoryImpl.java
Sun Mar  6 08:39:23 2005
@@ -16,7 +16,10 @@
  */
 package org.apache.jackrabbit.core.version.persistence;
 
-import org.apache.jackrabbit.core.*;
+import org.apache.jackrabbit.core.Constants;
+import org.apache.jackrabbit.core.InternalValue;
+import org.apache.jackrabbit.core.NodeImpl;
+import org.apache.jackrabbit.core.QName;
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.UpdatableItemStateManager;
 import org.apache.jackrabbit.core.util.uuid.UUID;
@@ -159,14 +162,14 @@
     }
 
     /**
-     * @see javax.jcr.version.VersionHistory#getRootVersion()
+     * {@inheritDoc}
      */
     public InternalVersion getRootVersion() {
         return rootVersion;
     }
 
     /**
-     * @see javax.jcr.version.VersionHistory#getVersion(java.lang.String)
+     * {@inheritDoc}
      */
     public InternalVersion getVersion(QName versionName) throws VersionException {
         // maybe add cache by name?
@@ -181,8 +184,7 @@
     }
 
     /**
-     * @param versionName
-     * @return
+     * {@inheritDoc}
      */
     public boolean hasVersion(QName versionName) {
         // maybe add cache?
@@ -218,7 +220,7 @@
     }
 
     /**
-     * @see javax.jcr.version.VersionHistory#getVersionByLabel(java.lang.String)
+     * {@inheritDoc}
      */
     public InternalVersion getVersionByLabel(QName label) {
         return (InternalVersion) labelCache.get(label);
@@ -276,7 +278,7 @@
     }
 
     /**
-     * @see InternalVersionHistory#addVersionLabel(QName, QName, boolean)
+     * {@inheritDoc}
      */
     public InternalVersion addVersionLabel(QName versionName, QName label, boolean move)
             throws VersionException {
@@ -317,7 +319,7 @@
     }
 
     /**
-     * @see InternalVersionHistory#removeVersionLabel(QName)
+     * {@inheritDoc}
      */
     public InternalVersion removeVersionLabel(QName label) throws VersionException {
 
@@ -411,14 +413,14 @@
     }
 
     /**
-     * @see org.apache.jackrabbit.core.version.InternalVersionHistory#getVersionableUUID()
+     * {@inheritDoc}
      */
     public String getVersionableUUID() {
         return versionableId;
     }
 
     /**
-     * @see org.apache.jackrabbit.core.version.InternalVersionHistory#getVersionLabels()
+     * {@inheritDoc}
      */
     public QName[] getVersionLabels() {
         return (QName[]) labelCache.keySet().toArray(new QName[labelCache.size()]);

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionImpl.java?view=diff&r1=156324&r2=156325
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionImpl.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionImpl.java
Sun Mar  6 08:39:23 2005
@@ -181,21 +181,21 @@
     }
 
     /**
-     * @see javax.jcr.version.Version#getCreated()
+     * {@inheritDoc}
      */
     public Calendar getCreated() {
         return created;
     }
 
     /**
-     * @see javax.jcr.version.Version#getSuccessors()
+     * {@inheritDoc}
      */
     public InternalVersion[] getSuccessors() {
         return (InternalVersionImpl[]) successors.toArray(new InternalVersionImpl[successors.size()]);
     }
 
     /**
-     * @see javax.jcr.version.Version#getSuccessors()
+     * {@inheritDoc}
      */
     public InternalVersion[] getPredecessors() {
         return (InternalVersionImpl[]) predecessors.toArray(new InternalVersionImpl[predecessors.size()]);
@@ -346,7 +346,7 @@
     }
 
     /**
-     * @see InternalVersion#hasLabel(QName)
+     * {@inheritDoc}
      */
     public boolean hasLabel(QName label) {
         return internalHasLabel(label);
@@ -362,7 +362,7 @@
     }
 
     /**
-     * @see InternalVersionImpl#getLabels()
+     * {@inheritDoc}
      */
     public QName[] getLabels() {
         return internalGetLabels();

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/NativePVM.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/NativePVM.java?view=diff&r1=156324&r2=156325
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/NativePVM.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/NativePVM.java
Sun Mar  6 08:39:23 2005
@@ -544,7 +544,7 @@
     }
 
     /**
-     * @see PersistentVersionManager#getItemStateMgr()
+     * {@inheritDoc}
      */
     public UpdatableItemStateManager getItemStateMgr() {
         return stateMgr;



Mime
View raw message