You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2016/05/20 12:55:58 UTC

svn commit: r1744728 - in /commons/proper/codec/trunk/src/main/java/org/apache/commons/codec: cli/Digest.java digest/MessageDigestAlgorithms.java digest/PureJavaCrc32.java digest/PureJavaCrc32C.java

Author: sebb
Date: Fri May 20 12:55:58 2016
New Revision: 1744728

URL: http://svn.apache.org/viewvc?rev=1744728&view=rev
Log:
Checkstyle

Modified:
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/cli/Digest.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/PureJavaCrc32.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/PureJavaCrc32C.java

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/cli/Digest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/cli/Digest.java?rev=1744728&r1=1744727&r2=1744728&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/cli/Digest.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/cli/Digest.java Fri May 20 12:55:58 2016
@@ -44,8 +44,8 @@ public class Digest {
      * </p>
      *
      * @param args
-     *            {@code args[0]} is one of {@link MessageDigestAlgorithms} name, {@link MessageDigest} name, {@code ALL}
-     *            , or {@code *}.
+     *            {@code args[0]} is one of {@link MessageDigestAlgorithms} name,
+     *            {@link MessageDigest} name, {@code ALL}, or {@code *}.
      *            {@code args[1+]} is a FILE/DIRECTORY/String.
      * @throws IOException if an error occurs
      */

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java?rev=1744728&r1=1744727&r2=1744728&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java Fri May 20 12:55:58 2016
@@ -136,7 +136,9 @@ public class MessageDigestAlgorithms {
      */
     public static String[] values() {
         // N.B. do not use a constant array here as that can be changed externally by accident or design
-        return new String[] { MD2, MD5, SHA_1, SHA_224, SHA_256, SHA_384, SHA_512, SHA3_224, SHA3_256, SHA3_384, SHA3_512 };
+        return new String[] {
+            MD2, MD5, SHA_1, SHA_224, SHA_256, SHA_384, SHA_512, SHA3_224, SHA3_256, SHA3_384, SHA3_512
+        };
     }
 
     private MessageDigestAlgorithms() {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/PureJavaCrc32.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/PureJavaCrc32.java?rev=1744728&r1=1744727&r2=1744728&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/PureJavaCrc32.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/PureJavaCrc32.java Fri May 20 12:55:58 2016
@@ -1,13 +1,12 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -72,14 +71,14 @@ public class PureJavaCrc32 implements Ch
     final int remainder = len & 0x7;
     int i = offset;
     for(final int end = offset + len - remainder; i < end; i += 8) {
-      final int x = localCrc
-          ^ ((((b[i  ] << 24) >>> 24) + ((b[i+1] << 24) >>> 16))
-           + (((b[i+2] << 24) >>> 8 ) +  (b[i+3] << 24)));
-
-      localCrc = ((T[((x << 24) >>> 24) + 0x700] ^ T[((x << 16) >>> 24) + 0x600])
-                ^ (T[((x <<  8) >>> 24) + 0x500] ^ T[ (x        >>> 24) + 0x400]))
-               ^ ((T[((b[i+4] << 24) >>> 24) + 0x300] ^ T[((b[i+5] << 24) >>> 24) + 0x200])
-                ^ (T[((b[i+6] << 24) >>> 24) + 0x100] ^ T[((b[i+7] << 24) >>> 24)]));
+      final int x = localCrc ^
+          ((((b[i  ] << 24) >>> 24) + ((b[i+1] << 24) >>> 16)) +
+          (((b[i+2] << 24) >>> 8 ) +  (b[i+3] << 24)));
+
+      localCrc = ((T[((x << 24) >>> 24) + 0x700] ^ T[((x << 16) >>> 24) + 0x600]) ^
+                 (T[((x <<  8) >>> 24) + 0x500] ^ T[ (x        >>> 24) + 0x400])) ^
+                 ((T[((b[i+4] << 24) >>> 24) + 0x300] ^ T[((b[i+5] << 24) >>> 24) + 0x200]) ^
+                 (T[((b[i+6] << 24) >>> 24) + 0x100] ^ T[((b[i+7] << 24) >>> 24)]));
     }
 
     /* loop unroll - duff's device style */

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/PureJavaCrc32C.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/PureJavaCrc32C.java?rev=1744728&r1=1744727&r2=1744728&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/PureJavaCrc32C.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/PureJavaCrc32C.java Fri May 20 12:55:58 2016
@@ -1,20 +1,20 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
+ */
+/*
  * Some portions of this file Copyright (c) 2004-2006 Intel Corportation
  * and licensed under the BSD license.
  */
@@ -65,16 +65,16 @@ public class PureJavaCrc32C implements C
       final int c1 =(b[off+1] ^ (localCrc >>>= 8)) & 0xff;
       final int c2 =(b[off+2] ^ (localCrc >>>= 8)) & 0xff;
       final int c3 =(b[off+3] ^ (localCrc >>>= 8)) & 0xff;
-      localCrc = (T[T8_7_start + c0] ^ T[T8_6_start + c1])
-          ^ (T[T8_5_start + c2] ^ T[T8_4_start + c3]);
+      localCrc = (T[T8_7_start + c0] ^ T[T8_6_start + c1]) ^
+                 (T[T8_5_start + c2] ^ T[T8_4_start + c3]);
 
       final int c4 = b[off+4] & 0xff;
       final int c5 = b[off+5] & 0xff;
       final int c6 = b[off+6] & 0xff;
       final int c7 = b[off+7] & 0xff;
 
-      localCrc ^= (T[T8_3_start + c4] ^ T[T8_2_start + c5])
-           ^ (T[T8_1_start + c6] ^ T[T8_0_start + c7]);
+      localCrc ^= (T[T8_3_start + c4] ^ T[T8_2_start + c5]) ^
+                  (T[T8_1_start + c6] ^ T[T8_0_start + c7]);
 
       off += 8;
       len -= 8;