jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r916056 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/retention/ test/java/org/apache/jackrabbit/core/retention/
Date Thu, 25 Feb 2010 00:21:01 GMT
Author: angela
Date: Thu Feb 25 00:21:01 2010
New Revision: 916056

URL: http://svn.apache.org/viewvc?rev=916056&view=rev
Log:
minor improvement

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/HoldImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionPolicyImpl.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/retention/AbstractRetentionTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/retention/HoldTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/HoldImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/HoldImpl.java?rev=916056&r1=916055&r2=916056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/HoldImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/HoldImpl.java
Thu Feb 25 00:21:01 2010
@@ -79,7 +79,7 @@
         return holds;
     }
 
-    //-----------------------------------------------------------< Hold >---
+    //---------------------------------------------------------------< Hold >---
     /**
      * @see javax.jcr.retention.Hold#isDeep()
      */
@@ -94,10 +94,11 @@
         return resolver.getJCRName(name);
     }
 
-    //---------------------------------------------------------< Object >---
+    //-------------------------------------------------------------< Object >---
     /**
      * @see Object#hashCode()
      */
+    @Override
     public int hashCode() {
         if (hashCode == 0) {
             int h = 17;
@@ -112,6 +113,7 @@
     /**
      * @see Object#equals(Object)
      */
+    @Override
     public boolean equals(Object obj) {
         if (obj == this) {
             return true;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionManagerImpl.java?rev=916056&r1=916055&r2=916056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionManagerImpl.java
Thu Feb 25 00:21:01 2010
@@ -16,13 +16,10 @@
  */
 package org.apache.jackrabbit.core.retention;
 
-import javax.jcr.retention.Hold;
-import javax.jcr.retention.RetentionManager;
-import javax.jcr.retention.RetentionPolicy;
 import org.apache.jackrabbit.core.NodeImpl;
-import org.apache.jackrabbit.core.SessionImpl;
-import org.apache.jackrabbit.core.ProtectedItemModifier;
 import org.apache.jackrabbit.core.PropertyImpl;
+import org.apache.jackrabbit.core.ProtectedItemModifier;
+import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.security.authorization.Permission;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NameFactory;
@@ -32,10 +29,13 @@
 
 import javax.jcr.AccessDeniedException;
 import javax.jcr.PathNotFoundException;
+import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
-import javax.jcr.PropertyType;
 import javax.jcr.lock.LockException;
+import javax.jcr.retention.Hold;
+import javax.jcr.retention.RetentionManager;
+import javax.jcr.retention.RetentionPolicy;
 import javax.jcr.version.VersionException;
 import java.util.ArrayList;
 import java.util.List;
@@ -100,8 +100,8 @@
         if (n.hasProperty(REP_HOLD)) {
             Value[] vs = n.getProperty(REP_HOLD).getValues();
             // check if the same hold already exists
-            for (int i = 0; i < vs.length; i++) {
-                if (hold.equals(HoldImpl.createFromValue(vs[i], n.getNodeId(), session)))
{
+            for (Value v : vs) {
+                if (hold.equals(HoldImpl.createFromValue(v, n.getNodeId(), session))) {
                     throw new RepositoryException("Hold already exists.");
                 }
             }
@@ -134,9 +134,9 @@
             Value[] vls = p.getValues();
 
             List<Value> newValues = new ArrayList<Value>(vls.length - 1);
-            for (int i = 0; i < vls.length; i++) {
-                if (!hold.equals(HoldImpl.createFromValue(vls[i], n.getNodeId(), session)))
{
-                    newValues.add(vls[i]);
+            for (Value v : vls) {
+                if (!hold.equals(HoldImpl.createFromValue(v, n.getNodeId(), session))) {
+                    newValues.add(v);
                 }
             }
             if (newValues.size() < vls.length) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionPolicyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionPolicyImpl.java?rev=916056&r1=916055&r2=916056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionPolicyImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionPolicyImpl.java
Thu Feb 25 00:21:01 2010
@@ -85,6 +85,7 @@
     /**
      * @see Object#hashCode()
      */
+    @Override
     public int hashCode() {
         if (hashCode == 0) {
             int h = 17;
@@ -98,6 +99,7 @@
     /**
      * @see Object#equals(Object)
      */
+    @Override
     public boolean equals(Object obj) {
         if (obj == this) {
             return true;

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/retention/AbstractRetentionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/retention/AbstractRetentionTest.java?rev=916056&r1=916055&r2=916056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/retention/AbstractRetentionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/retention/AbstractRetentionTest.java
Thu Feb 25 00:21:01 2010
@@ -26,6 +26,7 @@
  */
 public abstract class AbstractRetentionTest extends org.apache.jackrabbit.test.api.retention.AbstractRetentionTest
{
 
+    @Override
     protected RetentionPolicy getApplicableRetentionPolicy() throws NotExecutableException,
RepositoryException {
         return getApplicableRetentionPolicy("retentionPolicyName");
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/retention/HoldTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/retention/HoldTest.java?rev=916056&r1=916055&r2=916056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/retention/HoldTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/retention/HoldTest.java
Thu Feb 25 00:21:01 2010
@@ -30,12 +30,13 @@
 
     private static Logger log = LoggerFactory.getLogger(HoldTest.class);
 
+    @Override
     protected void tearDown() throws Exception {
         try {
             superuser.refresh(false);
             Hold[] holds = retentionMgr.getHolds(testNodePath);
-            for (int i = 0; i < holds.length; i++) {
-                retentionMgr.removeHold(testNodePath, holds[i]);
+            for (Hold hold : holds) {
+                retentionMgr.removeHold(testNodePath, hold);
             }
             superuser.save();
         } catch (RepositoryException e) {



Mime
View raw message