jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r807517 - in /jackrabbit/trunk: jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/ jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/
Date Tue, 25 Aug 2009 08:14:59 GMT
Author: mduerig
Date: Tue Aug 25 08:14:58 2009
New Revision: 807517

URL: http://svn.apache.org/viewvc?rev=807517&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/EventFilterImpl.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ChangeLogImpl.java
    jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/EventFilterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/EventFilterImpl.java?rev=807517&r1=807516&r2=807517&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/EventFilterImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/EventFilterImpl.java
Tue Aug 25 08:14:58 2009
@@ -16,18 +16,20 @@
  */
 package org.apache.jackrabbit.spi.commons;
 
-import org.apache.jackrabbit.spi.EventFilter;
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.jcr.RepositoryException;
+
 import org.apache.jackrabbit.spi.Event;
+import org.apache.jackrabbit.spi.EventFilter;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.Path;
 
-import javax.jcr.RepositoryException;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Arrays;
-import java.util.Collections;
-import java.io.Serializable;
-
 /**
  * <code>EventFilterImpl</code> is the simple bean style implementation of an
  * {@link EventFilter}.
@@ -40,9 +42,9 @@
 
     private final Path absPath;
 
-    private final Set uuids;
+    private final Set<String> uuids;
 
-    private final Set nodeTypeNames;
+    private final Set<Name> nodeTypeNames;
 
     private final boolean noLocal;
 
@@ -61,13 +63,13 @@
                     Path absPath,
                     boolean isDeep,
                     String[] uuids,
-                    Set nodeTypeNames,
+                    Set<Name> nodeTypeNames,
                     boolean noLocal) {
         this.eventTypes = eventTypes;
         this.absPath = absPath;
         this.isDeep = isDeep;
-        this.uuids = uuids != null ? new HashSet(Arrays.asList(uuids)) : null;
-        this.nodeTypeNames = nodeTypeNames != null ? new HashSet(nodeTypeNames) : null;
+        this.uuids = uuids != null ? new HashSet<String>(Arrays.asList(uuids)) : null;
+        this.nodeTypeNames = nodeTypeNames != null ? new HashSet<Name>(nodeTypeNames)
: null;
         this.noLocal = noLocal;
     }
 
@@ -100,7 +102,7 @@
 
         // check node types
         if (nodeTypeNames != null) {
-            Set eventTypes = new HashSet();
+            Set<Name> eventTypes = new HashSet<Name>();
             eventTypes.addAll(Arrays.asList(event.getMixinTypeNames()));
             eventTypes.add(event.getPrimaryNodeTypeName());
             // create intersection
@@ -154,7 +156,7 @@
         if (uuids == null) {
             return null;
         } else {
-            return (String[]) uuids.toArray(new String[uuids.size()]);
+            return uuids.toArray(new String[uuids.size()]);
         }
     }
 
@@ -162,7 +164,7 @@
      * @return an unmodifiable set of node type names or <code>null</code> if
      *         this filter does not care about node types.
      */
-    public Set getNodeTypeNames() {
+    public Set<Name> getNodeTypeNames() {
         if (nodeTypeNames == null) {
             return null;
         } else {
@@ -181,6 +183,7 @@
      * Returns a string representation of this EventFilter instance.
      * {@inheritDoc}
      */
+    @Override
     public String toString() {
         return new StringBuffer(getClass().getName())
             .append("[")

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ChangeLogImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ChangeLogImpl.java?rev=807517&r1=807516&r2=807517&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ChangeLogImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ChangeLogImpl.java
Tue Aug 25 08:14:58 2009
@@ -40,7 +40,7 @@
     /**
      * {@link Operation}s kept in this change log.
      */
-    protected final List operations = new LinkedList();
+    protected final List<Operation> operations = new LinkedList<Operation>();
 
     public void addNode(NodeId parentId, Name nodeName, Name nodetypeName, String uuid)
             throws RepositoryException {
@@ -92,8 +92,8 @@
         if (batch == null) {
             throw new IllegalArgumentException("Batch must not be null");
         }
-        for (Iterator it = operations.iterator(); it.hasNext(); ) {
-            Operation op = (Operation) it.next();
+        for (Iterator<Operation> it = operations.iterator(); it.hasNext(); ) {
+            Operation op = it.next();
             op.apply(batch);
         }
         return batch;
@@ -111,9 +111,10 @@
 
     // -----------------------------------------------------< Object >---
 
+    @Override
     public String toString() {
         StringBuffer b = new StringBuffer();
-        for (Iterator it = operations.iterator(); it.hasNext(); ) {
+        for (Iterator<Operation> it = operations.iterator(); it.hasNext(); ) {
             b.append(it.next());
             if (it.hasNext()) {
                 b.append(", ");
@@ -122,6 +123,7 @@
         return b.toString();
     }
 
+    @Override
     public boolean equals(Object other) {
         if (null == other) {
             return false;
@@ -139,6 +141,7 @@
         return operations.equals(other.operations);
     }
 
+    @Override
     public int hashCode() {
         throw new IllegalArgumentException("Not hashable");
     }

Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java?rev=807517&r1=807516&r2=807517&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
Tue Aug 25 08:14:58 2009
@@ -37,9 +37,9 @@
 import javax.jcr.ValueFormatException;
 import javax.jcr.lock.LockException;
 import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.InvalidNodeTypeDefinitionException;
 import javax.jcr.nodetype.NoSuchNodeTypeException;
 import javax.jcr.nodetype.NodeTypeExistsException;
-import javax.jcr.nodetype.InvalidNodeTypeDefinitionException;
 import javax.jcr.query.InvalidQueryException;
 import javax.jcr.version.Version;
 import javax.jcr.version.VersionException;
@@ -857,7 +857,7 @@
      * @throws UnsupportedRepositoryOperationException
      * @throws RepositoryException
      */
-    public Iterator mergeActivity(SessionInfo sessionInfo, NodeId activityId) throws UnsupportedRepositoryOperationException,
RepositoryException;
+    public Iterator<NodeId> mergeActivity(SessionInfo sessionInfo, NodeId activityId)
throws UnsupportedRepositoryOperationException, RepositoryException;
 
     /**
      *
@@ -1210,7 +1210,7 @@
 
     /**
      * Unregisters the node types with the specified <code>names</code>.
-     * 
+     *
      * @param sessionInfo
      * @param nodeTypeNames
      * @throws UnsupportedRepositoryOperationException If unregistering node types



Mime
View raw message