jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r807583 - in /jackrabbit/trunk/jackrabbit-spi-commons/src: main/java/org/apache/jackrabbit/spi/commons/ main/java/org/apache/jackrabbit/spi/commons/batch/ test/java/org/apache/jackrabbit/spi/commons/batch/
Date Tue, 25 Aug 2009 12:42:42 GMT
Author: mduerig
Date: Tue Aug 25 12:42:42 2009
New Revision: 807583

URL: http://svn.apache.org/viewvc?rev=807583&view=rev
Log:
JCR-2087: Upgrade to Java 5 as the base platform - use generics, annotations 

Modified:
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractReadableRepositoryService.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatingChangeLog.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/Operations.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatedBatchTest.java

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractReadableRepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractReadableRepositoryService.java?rev=807583&r1=807582&r2=807583&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractReadableRepositoryService.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractReadableRepositoryService.java
Tue Aug 25 12:42:42 2009
@@ -733,7 +733,7 @@
     /**
      * @throws UnsupportedRepositoryOperationException always.
      */
-    public Iterator mergeActivity(SessionInfo sessionInfo, NodeId activityId) throws UnsupportedRepositoryOperationException,
RepositoryException {
+    public Iterator<NodeId> mergeActivity(SessionInfo sessionInfo, NodeId activityId)
throws UnsupportedRepositoryOperationException, RepositoryException {
         throw new UnsupportedRepositoryOperationException();
 
     }

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatingChangeLog.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatingChangeLog.java?rev=807583&r1=807582&r2=807583&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatingChangeLog.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatingChangeLog.java
Tue Aug 25 12:42:42 2009
@@ -81,44 +81,54 @@
 
     // -----------------------------------------------------< ChangeLog >---
 
+    @Override
     public void addNode(NodeId parentId, Name nodeName, Name nodetypeName, String uuid)
             throws RepositoryException {
 
         addOperation(CancelableOperations.addNode(parentId, nodeName, nodetypeName, uuid));
     }
 
+    @Override
     public void addProperty(NodeId parentId, Name propertyName, QValue value) throws RepositoryException
{
         addOperation(CancelableOperations.addProperty(parentId, propertyName, value));
     }
 
+    @Override
     public void addProperty(NodeId parentId, Name propertyName, QValue[] values) throws RepositoryException
{
         addOperation(CancelableOperations.addProperty(parentId, propertyName, values));
     }
 
+    @Override
     public void move(NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws RepositoryException
{
         addOperation(CancelableOperations.move(srcNodeId, destParentNodeId, destName));
     }
 
+    @Override
     public void remove(ItemId itemId) throws RepositoryException {
         addOperation(CancelableOperations.remove(itemId));
     }
 
+    @Override
     public void reorderNodes(NodeId parentId, NodeId srcNodeId, NodeId beforeNodeId) throws
RepositoryException {
         addOperation(CancelableOperations.reorderNodes(parentId, srcNodeId, beforeNodeId));
     }
 
+    @Override
     public void setMixins(NodeId nodeId, Name[] mixinNodeTypeNames) throws RepositoryException
{
         addOperation(CancelableOperations.setMixins(nodeId, mixinNodeTypeNames));
     }
 
+    @Override
     public void setPrimaryType(NodeId nodeId, Name primaryNodeTypeName) throws RepositoryException
{
         addOperation(CancelableOperations.setPrimaryType(nodeId, primaryNodeTypeName));
     }
 
+    @Override
     public void setValue(PropertyId propertyId, QValue value) throws RepositoryException
{
         addOperation(CancelableOperations.setValue(propertyId, value));
     }
 
+    @Override
     public void setValue(PropertyId propertyId, QValue[] values) throws RepositoryException
{
         addOperation(CancelableOperations.setValue(propertyId, values));
     }
@@ -136,6 +146,7 @@
      * <li>Otherwise add the current operation to the list of operations.</li>
      * </ul>
      */
+    @Override
     protected void addOperation(Operation op) throws RepositoryException {
         if (!(op instanceof CancelableOperation)) {
             throw new IllegalArgumentException("Operation not instance of "
@@ -143,7 +154,7 @@
         }
 
         CancelableOperation otherOp = (CancelableOperation) op;
-        for (Iterator it = new OperationsBackwardWithSentinel(); it.hasNext(); ) {
+        for (Iterator<Operation> it = new OperationsBackwardWithSentinel(); it.hasNext();
) {
             CancelableOperation thisOp = (CancelableOperation) it.next();
             switch (thisOp.cancel(otherOp)) {
                 case CancelableOperation.CANCEL_THIS:
@@ -165,8 +176,8 @@
 
     // -----------------------------------------------------< private >---
 
-    private class OperationsBackwardWithSentinel implements Iterator {
-        private final ListIterator it = operations.listIterator(operations.size());
+    private class OperationsBackwardWithSentinel implements Iterator<Operation> {
+        private final ListIterator<Operation> it = operations.listIterator(operations.size());
         private boolean last = !it.hasPrevious();
         private boolean done;
 
@@ -174,13 +185,13 @@
             return it.hasPrevious() || last;
         }
 
-        public Object next() {
+        public Operation next() {
             if (last) {
                 done = true;
                 return CancelableOperations.empty();
             }
             else {
-                Object o = it.previous();
+                Operation o = it.previous();
                 last = !it.hasPrevious();
                 return o;
             }

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/Operations.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/Operations.java?rev=807583&r1=807582&r2=807583&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/Operations.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/Operations.java
Tue Aug 25 12:42:42 2009
@@ -56,10 +56,12 @@
          */
         public void apply(Batch batch) throws RepositoryException { /* nothing to do */ }
 
+        @Override
         public String toString() {
             return "Empty[]";
         }
 
+        @Override
         public boolean equals(Object other) {
             if (null == other) {
                 return false;
@@ -67,6 +69,7 @@
             return other instanceof Empty;
         }
 
+        @Override
         public int hashCode() {
             return Empty.class.hashCode();
         }
@@ -115,10 +118,12 @@
             batch.addNode(parentId, nodeName, nodetypeName, uuid);
         }
 
+        @Override
         public String toString() {
             return "AddNode[" + parentId + ", " + nodeName + ", " + nodetypeName + ", " +
uuid + "]";
         }
 
+        @Override
         public boolean equals(Object other) {
             if (null == other) {
                 return false;
@@ -139,6 +144,7 @@
                 && Operations.equals(uuid, other.uuid);
         }
 
+        @Override
         public int hashCode() {
             return 41 * (
                       41 * (
@@ -221,10 +227,12 @@
             }
         }
 
+        @Override
         public String toString() {
             return "AddProperty[" + parentId + ", " + propertyName + ", " + values + "]";
         }
 
+        @Override
         public boolean equals(Object other) {
             if (null == other) {
                 return false;
@@ -245,6 +253,7 @@
                 && Arrays.equals(values, other.values);
         }
 
+        @Override
         public int hashCode() {
             return 41 * (
                        41 * (
@@ -312,10 +321,12 @@
             batch.move(srcNodeId, destParentNodeId, destName);
         }
 
+        @Override
         public String toString() {
             return "Move[" + srcNodeId + ", " + destParentNodeId + ", " + destName + "]";
         }
 
+        @Override
         public boolean equals(Object other) {
             if (null == other) {
                 return false;
@@ -335,6 +346,7 @@
                 && Operations.equals(destName, other.destName);
         }
 
+        @Override
         public int hashCode() {
             return 41 * (
                         41 * (
@@ -383,10 +395,12 @@
             batch.remove(itemId);
         }
 
+        @Override
         public String toString() {
             return "Remove[" + itemId + "]";
         }
 
+        @Override
         public boolean equals(Object other) {
             if (null == other) {
                 return false;
@@ -404,6 +418,7 @@
             return Operations.equals(itemId, other.itemId);
         }
 
+        @Override
         public int hashCode() {
             return 41 + Operations.hashCode(itemId);
         }
@@ -452,10 +467,12 @@
             batch.reorderNodes(parentId, srcNodeId, beforeNodeId);
         }
 
+        @Override
         public String toString() {
             return "ReorderNodes[" + parentId + ", " + srcNodeId + ", " + beforeNodeId +
"]";
         }
 
+        @Override
         public boolean equals(Object other) {
             if (null == other) {
                 return false;
@@ -475,6 +492,7 @@
                 && Operations.equals(beforeNodeId, other.beforeNodeId);
         }
 
+        @Override
         public int hashCode() {
             return 41 * (
                         41 * (
@@ -526,10 +544,12 @@
             batch.setMixins(nodeId, mixinNodeTypeNames);
         }
 
+        @Override
         public String toString() {
             return "SetMixins[" + nodeId + ", " + mixinNodeTypeNames + "]";
         }
 
+        @Override
         public boolean equals(Object other) {
             if (null == other) {
                 return false;
@@ -548,6 +568,7 @@
                 && Arrays.equals(mixinNodeTypeNames, other.mixinNodeTypeNames);
         }
 
+        @Override
         public int hashCode() {
             return 41 * (
                         41 + Operations.hashCode(nodeId))
@@ -596,10 +617,12 @@
             batch.setPrimaryType(nodeId, primaryTypeName);
         }
 
+        @Override
         public String toString() {
             return "SetPrimaryType[" + nodeId + ", " + primaryTypeName + "]";
         }
 
+        @Override
         public boolean equals(Object other) {
             if (null == other) {
                 return false;
@@ -618,6 +641,7 @@
                 && primaryTypeName.equals(other.primaryTypeName);
         }
 
+        @Override
         public int hashCode() {
             return 41 * (
                     41 + Operations.hashCode(nodeId))
@@ -689,10 +713,12 @@
             }
         }
 
+        @Override
         public String toString() {
             return "SetValue[" + propertyId + ", " + values + "]";
         }
 
+        @Override
         public boolean equals(Object other) {
             if (null == other) {
                 return false;
@@ -712,6 +738,7 @@
                 && Arrays.equals(values, other.values);
         }
 
+        @Override
         public int hashCode() {
             return 41 * (
                         41 + Operations.hashCode(propertyId))

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatedBatchTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatedBatchTest.java?rev=807583&r1=807582&r2=807583&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatedBatchTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/batch/ConsolidatedBatchTest.java
Tue Aug 25 12:42:42 2009
@@ -418,11 +418,6 @@
             return this;
         }
 
-        public ChangeLog removeProperty(String propertyId) throws RepositoryException {
-            remove(createPropertyId(propertyId));
-            return this;
-        }
-
         public TestChangeLog ordNode(String nodeId) throws RepositoryException {
             NodeId srcNodeId = createNodeId(nodeId);
             NodeId parentId = createNodeId(srcNodeId.getPath());



Mime
View raw message