jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r816292 - in /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation: AbstractOperation.java AddNode.java Merge.java Operation.java SetPropertyValue.java
Date Thu, 17 Sep 2009 17:24:21 GMT
Author: reschke
Date: Thu Sep 17 17:24:21 2009
New Revision: 816292

URL: http://svn.apache.org/viewvc?rev=816292&view=rev
Log:
JCR-2087: parametrize generic types

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java?rev=816292&r1=816291&r2=816292&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java
Thu Sep 17 17:24:21 2009
@@ -33,9 +33,9 @@
 public abstract class AbstractOperation implements Operation {
 
     /**
-     * The collection of affected ItemIds.
+     * The collection of affected ItemStates.
      */
-    private final Collection affectedStates = new ArrayList();
+    private final Collection<ItemState> affectedStates = new ArrayList<ItemState>();
     protected int status;
 
     /**
@@ -51,8 +51,13 @@
     /**
      * @inheritDoc
      */
-    public Collection getAffectedItemStates() {
-        return (affectedStates.isEmpty()) ? Collections.EMPTY_LIST : Collections.unmodifiableCollection(affectedStates);
+    public Collection<ItemState> getAffectedItemStates() {
+    	if (affectedStates.isEmpty()) {
+    		return Collections.emptySet();
+    	}
+    	else {
+    		return Collections.unmodifiableCollection(affectedStates);
+    	}
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java?rev=816292&r1=816291&r2=816292&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java
Thu Sep 17 17:24:21 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi.operation;
 
+import org.apache.jackrabbit.jcr2spi.state.ItemState;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NodeId;
@@ -46,7 +47,7 @@
     private final Name nodeTypeName;
     private final String uuid;
 
-    private List addedStates = new ArrayList();
+    private List<ItemState> addedStates = new ArrayList<ItemState>();
 
     private AddNode(NodeState parentState, Name nodeName, Name nodeTypeName, String uuid)
             throws RepositoryException {
@@ -110,11 +111,11 @@
         return uuid;
     }
 
-    public void addedState(List newStates) {
+    public void addedState(List<ItemState> newStates) {
         addedStates.addAll(newStates);
     }
 
-    public List getAddedStates() {
+    public List<ItemState> getAddedStates() {
         return addedStates;
     }
 

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java?rev=816292&r1=816291&r2=816292&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java
Thu Sep 17 17:24:21 2009
@@ -20,6 +20,7 @@
 import org.apache.jackrabbit.jcr2spi.version.VersionManager;
 import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
 import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry;
+import org.apache.jackrabbit.spi.ItemId;
 import org.apache.jackrabbit.spi.NodeId;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -46,7 +47,7 @@
     private final boolean isShallow;
     private final VersionManager mgr;
 
-    private Iterator failedIds = null;
+    private Iterator<ItemId> failedIds = null;
 
     private Merge(NodeState nodeState, String srcWorkspaceName, boolean bestEffort, boolean
isShallow, VersionManager mgr) {
         this.nodeState = nodeState;
@@ -117,7 +118,7 @@
         return srcWorkspaceName == null;
     }
 
-    public void setFailedIds(Iterator failedIds) {
+    public void setFailedIds(Iterator<ItemId> failedIds) {
         if (failedIds == null) {
             throw new IllegalArgumentException("IdIterator must not be null.");
         }
@@ -127,7 +128,7 @@
         this.failedIds = failedIds;
     }
 
-    public Iterator getFailedIds() {
+    public Iterator<ItemId> getFailedIds() {
         if (failedIds == null) {
             throw new IllegalStateException("Merge operation has not been executed yet.");
         }

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java?rev=816292&r1=816291&r2=816292&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java
Thu Sep 17 17:24:21 2009
@@ -56,7 +56,7 @@
      *
      * @return collection of affected <code>ItemState</code>s.
      */
-    public Collection getAffectedItemStates();
+    public Collection<ItemState> getAffectedItemStates();
 
     /**
      * Informs this Operation that it has been successfully executed.

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java?rev=816292&r1=816291&r2=816292&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java
Thu Sep 17 17:24:21 2009
@@ -106,13 +106,13 @@
     public static Operation create(PropertyState propState, QValue[] qValues,
                                    int valueType) throws RepositoryException {
         // compact array (purge null entries)
-        List list = new ArrayList();
+        List<QValue> list = new ArrayList<QValue>();
         for (int i = 0; i < qValues.length; i++) {
             if (qValues[i] != null) {
                 list.add(qValues[i]);
             }
         }
-        QValue[] cleanValues = (QValue[]) list.toArray(new QValue[list.size()]);
+        QValue[] cleanValues = list.toArray(new QValue[list.size()]);
         SetPropertyValue sv = new SetPropertyValue(propState, valueType, cleanValues);
         return sv;
     }



Mime
View raw message