Skip to content

Commit 8ab0ecd

Browse files
committed
Checkstyle
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1744728 13f79535-47bb-0310-9956-ffa450edef68
1 parent ae70bfc commit 8ab0ecd

4 files changed

Lines changed: 34 additions & 33 deletions

File tree

src/main/java/org/apache/commons/codec/cli/Digest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public class Digest {
4444
* </p>
4545
*
4646
* @param args
47-
* {@code args[0]} is one of {@link MessageDigestAlgorithms} name, {@link MessageDigest} name, {@code ALL}
48-
* , or {@code *}.
47+
* {@code args[0]} is one of {@link MessageDigestAlgorithms} name,
48+
* {@link MessageDigest} name, {@code ALL}, or {@code *}.
4949
* {@code args[1+]} is a FILE/DIRECTORY/String.
5050
* @throws IOException if an error occurs
5151
*/

src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ public class MessageDigestAlgorithms {
136136
*/
137137
public static String[] values() {
138138
// N.B. do not use a constant array here as that can be changed externally by accident or design
139-
return new String[] { MD2, MD5, SHA_1, SHA_224, SHA_256, SHA_384, SHA_512, SHA3_224, SHA3_256, SHA3_384, SHA3_512 };
139+
return new String[] {
140+
MD2, MD5, SHA_1, SHA_224, SHA_256, SHA_384, SHA_512, SHA3_224, SHA3_256, SHA3_384, SHA3_512
141+
};
140142
}
141143

142144
private MessageDigestAlgorithms() {

src/main/java/org/apache/commons/codec/digest/PureJavaCrc32.java

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
/**
2-
* Licensed to the Apache Software Foundation (ASF) under one
3-
* or more contributor license agreements. See the NOTICE file
4-
* distributed with this work for additional information
5-
* regarding copyright ownership. The ASF licenses this file
6-
* to you under the Apache License, Version 2.0 (the
7-
* "License"); you may not use this file except in compliance
8-
* with the License. You may obtain a copy of the License at
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
98
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
9+
* http://www.apache.org/licenses/LICENSE-2.0
1110
*
1211
* Unless required by applicable law or agreed to in writing, software
1312
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -72,14 +71,14 @@ public void update(final byte[] b, final int offset, final int len) {
7271
final int remainder = len & 0x7;
7372
int i = offset;
7473
for(final int end = offset + len - remainder; i < end; i += 8) {
75-
final int x = localCrc
76-
^ ((((b[i ] << 24) >>> 24) + ((b[i+1] << 24) >>> 16))
77-
+ (((b[i+2] << 24) >>> 8 ) + (b[i+3] << 24)));
74+
final int x = localCrc ^
75+
((((b[i ] << 24) >>> 24) + ((b[i+1] << 24) >>> 16)) +
76+
(((b[i+2] << 24) >>> 8 ) + (b[i+3] << 24)));
7877

79-
localCrc = ((T[((x << 24) >>> 24) + 0x700] ^ T[((x << 16) >>> 24) + 0x600])
80-
^ (T[((x << 8) >>> 24) + 0x500] ^ T[ (x >>> 24) + 0x400]))
81-
^ ((T[((b[i+4] << 24) >>> 24) + 0x300] ^ T[((b[i+5] << 24) >>> 24) + 0x200])
82-
^ (T[((b[i+6] << 24) >>> 24) + 0x100] ^ T[((b[i+7] << 24) >>> 24)]));
78+
localCrc = ((T[((x << 24) >>> 24) + 0x700] ^ T[((x << 16) >>> 24) + 0x600]) ^
79+
(T[((x << 8) >>> 24) + 0x500] ^ T[ (x >>> 24) + 0x400])) ^
80+
((T[((b[i+4] << 24) >>> 24) + 0x300] ^ T[((b[i+5] << 24) >>> 24) + 0x200]) ^
81+
(T[((b[i+6] << 24) >>> 24) + 0x100] ^ T[((b[i+7] << 24) >>> 24)]));
8382
}
8483

8584
/* loop unroll - duff's device style */

src/main/java/org/apache/commons/codec/digest/PureJavaCrc32C.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
/**
2-
* Licensed to the Apache Software Foundation (ASF) under one
3-
* or more contributor license agreements. See the NOTICE file
4-
* distributed with this work for additional information
5-
* regarding copyright ownership. The ASF licenses this file
6-
* to you under the Apache License, Version 2.0 (the
7-
* "License"); you may not use this file except in compliance
8-
* with the License. You may obtain a copy of the License at
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
98
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
9+
* http://www.apache.org/licenses/LICENSE-2.0
1110
*
1211
* Unless required by applicable law or agreed to in writing, software
1312
* distributed under the License is distributed on an "AS IS" BASIS,
1413
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1514
* See the License for the specific language governing permissions and
1615
* limitations under the License.
17-
*
16+
*/
17+
/*
1818
* Some portions of this file Copyright (c) 2004-2006 Intel Corportation
1919
* and licensed under the BSD license.
2020
*/
@@ -65,16 +65,16 @@ public void update(byte[] b, int off, int len) {
6565
final int c1 =(b[off+1] ^ (localCrc >>>= 8)) & 0xff;
6666
final int c2 =(b[off+2] ^ (localCrc >>>= 8)) & 0xff;
6767
final int c3 =(b[off+3] ^ (localCrc >>>= 8)) & 0xff;
68-
localCrc = (T[T8_7_start + c0] ^ T[T8_6_start + c1])
69-
^ (T[T8_5_start + c2] ^ T[T8_4_start + c3]);
68+
localCrc = (T[T8_7_start + c0] ^ T[T8_6_start + c1]) ^
69+
(T[T8_5_start + c2] ^ T[T8_4_start + c3]);
7070

7171
final int c4 = b[off+4] & 0xff;
7272
final int c5 = b[off+5] & 0xff;
7373
final int c6 = b[off+6] & 0xff;
7474
final int c7 = b[off+7] & 0xff;
7575

76-
localCrc ^= (T[T8_3_start + c4] ^ T[T8_2_start + c5])
77-
^ (T[T8_1_start + c6] ^ T[T8_0_start + c7]);
76+
localCrc ^= (T[T8_3_start + c4] ^ T[T8_2_start + c5]) ^
77+
(T[T8_1_start + c6] ^ T[T8_0_start + c7]);
7878

7979
off += 8;
8080
len -= 8;

0 commit comments

Comments
 (0)