jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1502178 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/
Date Thu, 11 Jul 2013 10:16:34 GMT
Author: mduerig
Date: Thu Jul 11 10:16:33 2013
New Revision: 1502178

URL: http://svn.apache.org/r1502178
Log:
Cleanup: use @code, typo, remove unnecessary modifiers, make utility class final,

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/DateVersionSelector.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/Utils.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionExceptionCode.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionSelector.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/DateVersionSelector.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/DateVersionSelector.java?rev=1502178&r1=1502177&r2=1502178&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/DateVersionSelector.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/DateVersionSelector.java
Thu Jul 11 10:16:33 2013
@@ -30,8 +30,8 @@ import org.apache.jackrabbit.oak.spi.sta
  * <p/>
  * This Class implements a version selector that selects a version by creation
  * date. The selected version is the latest that is older or equal than the
- * given date. If no version could be found <code>null</code> is returned
- * unless the <code>returnLatest</code> flag is set to <code>true</code>,
where
+ * given date. If no version could be found {@code null} is returned
+ * unless the {@code returnLatest} flag is set to {@code true}, where
  * the latest version is returned.
  * <pre>
  * V1.0 - 02-Sep-2006
@@ -53,7 +53,7 @@ public class DateVersionSelector impleme
     private final long timestamp;
 
     /**
-     * Creates a <code>DateVersionSelector</code> that will select the latest
+     * Creates a {@code DateVersionSelector} that will select the latest
      * version of all those that are older than the given timestamp.
      *
      * @param timestamp reference timestamp

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java?rev=1502178&r1=1502177&r2=1502178&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java
Thu Jul 11 10:16:33 2013
@@ -134,7 +134,7 @@ class ReadWriteVersionManager extends Re
         // use jcr:rootVersion node to detect if we need to initialize the
         // version history
         if (!node.hasChildNode(JCR_ROOTVERSION)) {
-            // jcr:versionableUuuid property
+            // jcr:versionableUuid property
             node.setProperty(JCR_VERSIONABLEUUID, vUUID, Type.STRING);
             node.setProperty(JCR_UUID,
                     IdentifierManager.generateUUID(), Type.STRING);
@@ -188,8 +188,8 @@ class ReadWriteVersionManager extends Re
     }
 
     /**
-     * Restores a version from the history identified by <code>historyIdentifier</code>
-     * using the given version <code>selector</code>.
+     * Restores a version from the history identified by {@code historyIdentifier}
+     * using the given version {@code selector}.
      *
      * @param historyIdentifier identifier of the version history node.
      * @param selector the version selector.
@@ -224,7 +224,7 @@ class ReadWriteVersionManager extends Re
     //------------------------------< internal >--------------------------------
 
     /**
-     * Resolves the <code>relPath</code> based on the given <code>node</code>
+     * Resolves the {@code relPath} based on the given {@code node}
      * and returns the resulting node, possibly non-existing.
      *
      * @param node the resolved node.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/Utils.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/Utils.java?rev=1502178&r1=1502177&r2=1502178&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/Utils.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/Utils.java
Thu Jul 11 10:16:33 2013
@@ -18,23 +18,25 @@
  */
 package org.apache.jackrabbit.oak.plugins.version;
 
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.apache.jackrabbit.JcrConstants.JCR_PRIMARYTYPE;
+import static org.apache.jackrabbit.JcrConstants.JCR_UUID;
+
 import javax.annotation.Nonnull;
 
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.apache.jackrabbit.JcrConstants.JCR_PRIMARYTYPE;
-import static org.apache.jackrabbit.JcrConstants.JCR_UUID;
-
 /**
- * <code>Utils</code> provide some utility methods.
+ * {@code Utils} provide some utility methods.
  */
-public class Utils {
+public final class Utils {
+    private Utils() {
+    }
 
     /**
-     * Returns the jcr:uuid value of given <code>node</code>.
+     * Returns the jcr:uuid value of given {@code node}.
      *
      * @param node a referenceable node.
      * @return the value of the jcr:uuid property.
@@ -51,12 +53,12 @@ public class Utils {
     }
 
     /**
-     * Returns the <code>jcr:primaryType</code> value of the given
-     * <code>node</code>.
+     * Returns the {@code jcr:primaryType} value of the given
+     * {@code node}.
      *
      * @param node a node.
-     * @return the <code>jcr:primaryType</code> value.
-     * @throws IllegalStateException if the node does not have a <code>jcr:primaryType</code>
+     * @return the {@code jcr:primaryType} value.
+     * @throws IllegalStateException if the node does not have a {@code jcr:primaryType}
      *                               property.
      */
     @Nonnull

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionEditor.java?rev=1502178&r1=1502177&r2=1502178&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionEditor.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionEditor.java
Thu Jul 11 10:16:33 2013
@@ -160,9 +160,9 @@ class VersionEditor implements Editor {
     }
 
     /**
-     * Returns <code>true</code> if the node of this VersionDiff is versionable;
-     * <code>false</code> otherwise.
-     * 
+     * Returns {@code true} if the node of this VersionDiff is versionable;
+     * {@code false} otherwise.
+     *
      * @return whether the node is versionable.
      */
     private boolean isVersionable() {
@@ -182,7 +182,7 @@ class VersionEditor implements Editor {
     }
 
     /**
-     * @return <code>true</code> if this node <b>was</b> checked
in. That is,
+     * @return {@code true} if this node <b>was</b> checked in. That is,
      *         this method checks the base state for the jcr:isCheckedOut
      *         property.
      */

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionExceptionCode.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionExceptionCode.java?rev=1502178&r1=1502177&r2=1502178&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionExceptionCode.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionExceptionCode.java
Thu Jul 11 10:16:33 2013
@@ -19,7 +19,7 @@
 package org.apache.jackrabbit.oak.plugins.version;
 
 /**
- * <code>VersionExceptionCode</code> contains the codes for version related
+ * {@code VersionExceptionCode} contains the codes for version related
  * commit failures.
  */
 public enum VersionExceptionCode {
@@ -32,7 +32,7 @@ public enum VersionExceptionCode {
 
     private final String desc;
 
-    private VersionExceptionCode(String desc) {
+    VersionExceptionCode(String desc) {
         this.desc = desc;
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionSelector.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionSelector.java?rev=1502178&r1=1502177&r2=1502178&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionSelector.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionSelector.java
Thu Jul 11 10:16:33 2013
@@ -35,12 +35,12 @@ import org.apache.jackrabbit.oak.spi.sta
  * the scope of this specification."</em>
  * <p/>
  * The version selection in jackrabbit works as follows:<br/>
- * The <code>Node.restore()</code> methods uses the
+ * The {@code Node.restore()} methods uses the
  * {@link DateVersionSelector} which is initialized with the creation date of
  * the parent version. This selector selects the latest version that is equal
  * or older than the given date. if no such version exists, the initial one
  * is restored.<br/>
- * The <code>Node.restoreByLabel()</code> uses the
+ * The {@code Node.restoreByLabel()} uses the
  * {@link LabelVersionSelector} which is initialized with the label of the
  * version to be restored. This selector selects the version with the same
  * label. if no such version exists, the initial one is restored.
@@ -54,11 +54,11 @@ public interface VersionSelector {
 
     /**
      * Selects a version of the given version history. If this VersionSelector
-     * is unable to select one, it can return <code>null</code>. Please note,
+     * is unable to select one, it can return {@code null}. Please note,
      * that a version selector is not allowed to return the root version.
      *
      * @param versionHistory version history to select a version from
-     * @return A version or <code>null</code>.
+     * @return A version or {@code null}.
      * @throws RepositoryException if an error occurs.
      */
     @CheckForNull

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java?rev=1502178&r1=1502177&r2=1502178&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java
Thu Jul 11 10:16:33 2013
@@ -68,7 +68,7 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.apache.jackrabbit.oak.util.TODO;
 
 /**
- * <code>VersionableState</code> provides methods to create a versionable state
+ * {@code VersionableState} provides methods to create a versionable state
  * for a version based on a versionable node.
  * <p>
  * The restore implementation of this class does not handle the removeExisting
@@ -227,8 +227,8 @@ class VersionableState {
     //--------------------------< internal >------------------------------------
 
     /**
-     * Restores the state from <code>src</code> to a child node of
-     * <code>destParent</code> with the same name as <code>src</code>.
+     * Restores the state from {@code src} to a child node of
+     * {@code destParent} with the same name as {@code src}.
      *
      * @param src the source node.
      * @param destParent the parent of the destination node.
@@ -353,7 +353,7 @@ class VersionableState {
     }
 
     /**
-     * Restores children of a <code>src</code>.
+     * Restores children of a {@code src}.
      */
     private void restoreChildren(NodeBuilder src,
                                  NodeBuilder dest,
@@ -534,9 +534,9 @@ class VersionableState {
 
     private interface OPVProvider {
 
-        public int getAction(NodeBuilder src,
-                             NodeBuilder dest,
-                             PropertyState prop)
+        int getAction(NodeBuilder src,
+                NodeBuilder dest,
+                PropertyState prop)
                 throws RepositoryException;
     }
 



Mime
View raw message