Skip to content

Commit ef6023c

Browse files
committed
Fix Checkstyle issues.
1 parent e3b76c8 commit ef6023c

8 files changed

Lines changed: 55 additions & 46 deletions

File tree

src/main/java/org/apache/commons/codec/binary/Base32.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,17 +338,16 @@ public Base32(final int lineLength, final byte[] lineSeparator, final boolean us
338338
* silently ignored, but has implications for other bytes, too. This method subscribes to the garbage-in,
339339
* garbage-out philosophy: it will not check the provided data for validity.
340340
* </p>
341+
* <p>
342+
* Output is written to {@link org.apache.commons.codec.binary.BaseNCodec.Context#buffer Context#buffer} as 8-bit
343+
* octets, using {@link org.apache.commons.codec.binary.BaseNCodec.Context#pos Context#pos} as the buffer position
344+
* </p>
341345
*
342-
* @param in
343-
* byte[] array of ascii data to Base32 decode.
344-
* @param inPos
345-
* Position to start reading data from.
346-
* @param inAvail
347-
* Amount of bytes available from input for decoding.
346+
* @param in byte[] array of ascii data to Base32 decode.
347+
* @param inPos Position to start reading data from.
348+
* @param inAvail Amount of bytes available from input for decoding.
348349
* @param context the context to be used
349350
*
350-
* Output is written to {@link org.apache.commons.codec.binary.BaseNCodec.Context#buffer Context#buffer}
351-
* as 8-bit octets, using {@link org.apache.commons.codec.binary.BaseNCodec.Context#pos Context#pos} as the buffer position
352351
*/
353352
@Override
354353
void decode(final byte[] in, int inPos, final int inAvail, final Context context) {

src/main/java/org/apache/commons/codec/binary/BaseNCodecOutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class BaseNCodecOutputStream extends FilterOutputStream {
4949

5050
/**
5151
* TODO should this be protected?
52-
*
52+
*
5353
* @param out the underlying output or null.
5454
* @param basedCodec a BaseNCodec.
5555
* @param doEncode true to encode, false to decode, TODO should be an enum?

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ public static byte[] digest(final MessageDigest messageDigest, final InputStream
134134
* On error reading from the stream
135135
* @since 1.14
136136
*/
137-
public static byte[] digest(final MessageDigest messageDigest, final Path data, final OpenOption... options) throws IOException {
137+
public static byte[] digest(final MessageDigest messageDigest, final Path data, final OpenOption... options)
138+
throws IOException {
138139
return updateDigest(messageDigest, data, options).digest();
139140
}
140141

@@ -1195,7 +1196,7 @@ public static String sha512_224Hex(final byte[] data) {
11951196
* @param data
11961197
* Data to digest
11971198
* @return SHA-512/224 digest as a hex string
1198-
* @throws IOException
1199+
* @throws IOException
11991200
* On error reading from the stream
12001201
* @since 1.14
12011202
*/
@@ -1271,7 +1272,7 @@ public static String sha512_256Hex(final byte[] data) {
12711272
* @param data
12721273
* Data to digest
12731274
* @return SHA-512/256 digest as a hex string
1274-
* @throws IOException
1275+
* @throws IOException
12751276
* On error reading from the stream
12761277
* @since 1.14
12771278
*/
@@ -1452,7 +1453,8 @@ private static MessageDigest updateDigest(final MessageDigest digest, final File
14521453
* On error reading from the stream
14531454
* @since 1.8
14541455
*/
1455-
public static MessageDigest updateDigest(final MessageDigest digest, final InputStream inputStream) throws IOException {
1456+
public static MessageDigest updateDigest(final MessageDigest digest, final InputStream inputStream)
1457+
throws IOException {
14561458
final byte[] buffer = new byte[STREAM_BUFFER_LENGTH];
14571459
int read = inputStream.read(buffer, 0, STREAM_BUFFER_LENGTH);
14581460

@@ -1478,13 +1480,13 @@ public static MessageDigest updateDigest(final MessageDigest digest, final Input
14781480
* On error reading from the stream
14791481
* @since 1.14
14801482
*/
1481-
public static MessageDigest updateDigest(final MessageDigest digest, final Path path, final OpenOption... options) throws IOException {
1483+
public static MessageDigest updateDigest(final MessageDigest digest, final Path path, final OpenOption... options)
1484+
throws IOException {
14821485
try (final BufferedInputStream inputStream = new BufferedInputStream(Files.newInputStream(path, options))) {
14831486
return updateDigest(digest, inputStream);
14841487
}
14851488
}
14861489

1487-
14881490
/**
14891491
* Reads through a RandomAccessFile and updates the digest for the data using non-blocking-io (NIO)
14901492
*

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public class MessageDigestAlgorithms {
9898
* <p>
9999
* Included starting in Oracle Java 9.
100100
* </p>
101-
*
101+
*
102102
* @since 1.14
103103
*/
104104
public static final String SHA_512_224 = "SHA-512/224";
@@ -108,7 +108,7 @@ public class MessageDigestAlgorithms {
108108
* <p>
109109
* Included starting in Oracle Java 9.
110110
* </p>
111-
*
111+
*
112112
* @since 1.14
113113
*/
114114
public static final String SHA_512_256 = "SHA-512/256";

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

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,37 @@
2020
/**
2121
* Implementation of the MurmurHash3 32-bit and 128-bit hash functions.
2222
*
23-
* <p>MurmurHash is a non-cryptographic hash function suitable for general
24-
* hash-based lookup. The name comes from two basic operations, multiply (MU)
25-
* and rotate (R), used in its inner loop. Unlike cryptographic hash functions,
26-
* it is not specifically designed to be difficult to reverse by an adversary,
27-
* making it unsuitable for cryptographic purposes.</p>
23+
* <p>
24+
* MurmurHash is a non-cryptographic hash function suitable for general hash-based lookup. The name comes from two basic
25+
* operations, multiply (MU) and rotate (R), used in its inner loop. Unlike cryptographic hash functions, it is not
26+
* specifically designed to be difficult to reverse by an adversary, making it unsuitable for cryptographic purposes.
27+
* </p>
2828
*
29-
* <p>This contains a Java port of the 32-bit hash function {@code MurmurHash3_x86_32}
30-
* and the 128-bit hash function {@code MurmurHash3_x64_128} from Austin Applyby's
31-
* original {@code c++} code in SMHasher.</p>
29+
* <p>
30+
* This contains a Java port of the 32-bit hash function {@code MurmurHash3_x86_32} and the 128-bit hash function
31+
* {@code MurmurHash3_x64_128} from Austin Applyby's original {@code c++} code in SMHasher.
32+
* </p>
3233
*
33-
* <p>This is public domain code with no copyrights. From home page of
34-
* <a href="https://github.com/aappleby/smhasher">SMHasher</a>:</p>
34+
* <p>
35+
* This is public domain code with no copyrights. From home page of
36+
* <a href="https://github.com/aappleby/smhasher">SMHasher</a>:
37+
* </p>
3538
*
36-
* <blockquote>
37-
* "All MurmurHash versions are public domain software, and the author
38-
* disclaims all copyright to their code."
39-
* </blockquote>
39+
* <blockquote> "All MurmurHash versions are public domain software, and the author disclaims all copyright to their
40+
* code." </blockquote>
4041
*
41-
* <p>Original adaption from Apache Hive. That adaption contains a {@code hash64} method
42-
* that is not part of the original MurmurHash3 code. It is not recommended to use these methods.
43-
* They will be removed in a future release. To obtain a 64-bit hash use half of the bits
44-
* from the {@code hash128x64} methods using the input data converted to bytes.<p>
42+
* <p>
43+
* Original adaption from Apache Hive. That adaption contains a {@code hash64} method that is not part of the original
44+
* MurmurHash3 code. It is not recommended to use these methods. They will be removed in a future release. To obtain a
45+
* 64-bit hash use half of the bits from the {@code hash128x64} methods using the input data converted to bytes.
46+
* <p>
4547
*
4648
* @see <a href="https://en.wikipedia.org/wiki/MurmurHash">MurmurHash</a>
47-
* @see <a href="https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp">
48-
* Original MurmurHash3 c++ code</a>
49-
* @see <a href="https://github.com/apache/hive/blob/master/storage-api/src/java/org/apache/hive/common/util/Murmur3.java">
50-
* Apache Hive Murmer3</a>
49+
* @see <a href="https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp"> Original MurmurHash3 c++
50+
* code</a>
51+
* @see <a href=
52+
* "https://github.com/apache/hive/blob/master/storage-api/src/java/org/apache/hive/common/util/Murmur3.java">
53+
* Apache Hive Murmer3</a>
5154
* @since 1.13
5255
*/
5356
public final class MurmurHash3 {

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,14 @@
2424
/**
2525
* Implementation of the xxhash32 hash algorithm.
2626
*
27-
* <p>Copied from Commons Compress 1.14
28-
* <a href="https://git-wip-us.apache.org/repos/asf?p=commons-compress.git;a=blob;f=src/main/java/org/apache/commons/compress/compressors/lz4/XXHash32.java;h=a406ffc197449be594d46f0d2712b2d4786a1e68;hb=HEAD">https://git-wip-us.apache.org/repos/asf?p=commons-compress.git;a=blob;f=src/main/java/org/apache/commons/compress/compressors/lz4/XXHash32.java;h=a406ffc197449be594d46f0d2712b2d4786a1e68;hb=HEAD</a></p>
29-
* <p>NotThreadSafe</p>
27+
* <p>
28+
* Copied from Commons Compress 1.14 <a href=
29+
* "https://git-wip-us.apache.org/repos/asf?p=commons-compress.git;a=blob;f=src/main/java/org/apache/commons/compress/compressors/lz4/XXHash32.java;h=a406ffc197449be594d46f0d2712b2d4786a1e68;hb=HEAD">https://git-wip-us.apache.org/repos/asf?p=commons-compress.git;a=blob;f=src/main/java/org/apache/commons/compress/compressors/lz4/XXHash32.java;h=a406ffc197449be594d46f0d2712b2d4786a1e68;hb=HEAD</a>
30+
* </p>
31+
* <p>
32+
* NotThreadSafe
33+
* </p>
34+
*
3035
* @see <a href="http://cyan4973.github.io/xxHash/">xxHash</a>
3136
* @since 1.11
3237
*/

src/main/java/org/apache/commons/codec/language/ColognePhonetic.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ public CologneOutputBuffer(final int buffSize) {
241241
* '0' is only stored if it is the first entry.
242242
* Ignored chars are never stored.
243243
* If the code is the same as the last code (whether stored or not) it is not stored.
244-
*
245-
* @param code the code to store.
244+
*
245+
* @param code the code to store.
246246
*/
247247
public void put(final char code) {
248248
if (code != CHAR_IGNORE && lastCode != code && (code != '0' || length == 0)) {
@@ -404,7 +404,7 @@ public String encode(final String text) {
404404

405405
/**
406406
* Compares the first encoded string to the second encoded string.
407-
*
407+
*
408408
* @param text1 source text to encode before testing for equality.
409409
* @param text2 source text to encode before testing for equality.
410410
* @return {@code true} if the encoding the first string equals the encoding of the second string, {@code false}

src/test/java/org/apache/commons/codec/digest/DigestUtilsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public void testMd2Length() {
198198
hash = DigestUtils.md2(getBytesUtf8(hashMe));
199199
assertEquals(16, hash.length);
200200
}
201-
201+
202202
@Test
203203
public void testMd5Hex() throws IOException {
204204
// Examples from RFC 1321

0 commit comments

Comments
 (0)