jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1360122 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: kernel/ plugins/lucene/ plugins/name/ spi/commit/ spi/security/user/
Date Wed, 11 Jul 2012 11:03:34 GMT
Author: mduerig
Date: Wed Jul 11 11:03:34 2012
New Revision: 1360122

URL: http://svn.apache.org/viewvc?rev=1360122&view=rev
Log:
minor: Javadoc, static,  new style for loop, isEmpty, replace C style array declaration

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/CoreValueMapper.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/OakDirectory.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NameValidator.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/PasswordUtility.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/CoreValueMapper.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/CoreValueMapper.java?rev=1360122&r1=1360121&r2=1360122&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/CoreValueMapper.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/CoreValueMapper.java
Wed Jul 11 11:03:34 2012
@@ -146,7 +146,7 @@ public class CoreValueMapper {
      * {@link CoreValue}s. This method takes type-hint prefixes into account.
      *
      * @param reader The JSON reader.
-     * @param valueFactory The factory used to create the values.
+     * @param kernel The Microkernel instance from which the values originate
      * @return A list of values such as defined by the reader.
      */
     public static List<CoreValue> listFromJsopReader(JsopReader reader, MicroKernel
kernel) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java?rev=1360122&r1=1360121&r2=1360122&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
Wed Jul 11 11:03:34 2012
@@ -18,6 +18,15 @@
  */
 package org.apache.jackrabbit.oak.kernel;
 
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.annotation.Nonnull;
+
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.json.JsopReader;
 import org.apache.jackrabbit.mk.json.JsopTokenizer;
@@ -31,14 +40,6 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.apache.jackrabbit.oak.util.Iterators;
 import org.apache.jackrabbit.oak.util.PagedIterator;
 
-import javax.annotation.Nonnull;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
 /**
  * Basic {@link NodeState} implementation based on the {@link MicroKernel}
  * interface. This class makes an attempt to load data lazily.
@@ -60,7 +61,7 @@ final class KernelNodeState extends Abst
 
     private long childNodeCount = -1;
 
-    private String hash = null;
+    private String hash;
 
     // TODO: WeakReference?
     private Map<String, NodeState> childNodes;
@@ -71,7 +72,6 @@ final class KernelNodeState extends Abst
      * underlying Microkernel does not contain such a node.
      *
      * @param kernel
-     * @param valueFactory
      * @param path
      * @param revision
      */

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java?rev=1360122&r1=1360121&r2=1360122&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java
Wed Jul 11 11:03:34 2012
@@ -168,7 +168,7 @@ class KernelNodeStoreBranch implements N
         return jsop.toString();
     }
 
-    private void diffToJsop(NodeState before, NodeState after, final String path,
+    private static void diffToJsop(NodeState before, NodeState after, final String path,
             final StringBuilder jsop) {
         after.compareAgainstBaseState(before, new NodeStateDiff() {
             @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/OakDirectory.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/OakDirectory.java?rev=1360122&r1=1360121&r2=1360122&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/OakDirectory.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/OakDirectory.java
Wed Jul 11 11:03:34 2012
@@ -52,8 +52,8 @@ class OakDirectory extends Directory {
         this.rootBuilder = store.getBuilder(root);
 
         NodeStateBuilder builder = rootBuilder;
-        for (int i = 0; i < path.length; i++) {
-            builder = builder.getChildBuilder(path[i]);
+        for (String name : path) {
+            builder = builder.getChildBuilder(name);
         }
         this.directoryBuilder = builder;
         this.directory = null;
@@ -144,7 +144,7 @@ class OakDirectory extends Directory {
 
             private final byte[] data = readFile(name);
 
-            private int position = 0;
+            private int position;
 
             @Override
             public void readBytes(byte[] b, int offset, int len)
@@ -186,7 +186,7 @@ class OakDirectory extends Directory {
             }
 
             @Override
-            public void close() throws IOException {
+            public void close() {
                 // do nothing
             }
 
@@ -250,7 +250,7 @@ class OakDirectory extends Directory {
         }
 
         @Override
-        public long length() throws IOException {
+        public long length() {
             return size;
         }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NameValidator.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NameValidator.java?rev=1360122&r1=1360121&r2=1360122&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NameValidator.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NameValidator.java
Wed Jul 11 11:03:34 2012
@@ -16,16 +16,16 @@
  */
 package org.apache.jackrabbit.oak.plugins.name;
 
+import java.util.Set;
+
+import javax.jcr.PropertyType;
+
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.spi.commit.Validator;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
-import java.util.Set;
-
-import javax.jcr.PropertyType;
-
 class NameValidator implements Validator {
 
     private final Set<String> prefixes;
@@ -38,7 +38,7 @@ class NameValidator implements Validator
         int colon = name.indexOf(':');
         if (colon != -1) {
             String prefix = name.substring(0, colon);
-            if (prefix.length() == 0 || !prefixes.contains(prefix)) {
+            if (prefix.isEmpty() || !prefixes.contains(prefix)) {
                 throw new CommitFailedException(
                         "Invalid namespace prefix: " + name);
             }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingEditor.java?rev=1360122&r1=1360121&r2=1360122&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingEditor.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingEditor.java
Wed Jul 11 11:03:34 2012
@@ -68,7 +68,6 @@ public class ValidatingEditor implements
          * Validates the given subtree by diffing and recursing through it.
          *
          * @param validator validator for the root of the subtree
-         * @param store store to where the subtree lives
          * @param before state of the original subtree
          * @param after state of the modified subtree
          * @throws CommitFailedException if validation failed

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/PasswordUtility.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/PasswordUtility.java?rev=1360122&r1=1360121&r2=1360122&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/PasswordUtility.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/PasswordUtility.java
Wed Jul 11 11:03:34 2012
@@ -16,16 +16,17 @@
  */
 package org.apache.jackrabbit.oak.spi.security.user;
 
-import org.apache.jackrabbit.util.Text;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.annotation.Nullable;
 import java.io.UnsupportedEncodingException;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
 
+import javax.annotation.Nullable;
+
+import org.apache.jackrabbit.util.Text;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * Utility to generate and compare password hashes.
  */
@@ -156,7 +157,7 @@ public class PasswordUtility {
 
     private static String generateSalt(int saltSize) {
         SecureRandom random = new SecureRandom();
-        byte salt[] = new byte[saltSize];
+        byte[] salt = new byte[saltSize];
         random.nextBytes(salt);
 
         StringBuilder res = new StringBuilder(salt.length * 2);



Mime
View raw message