Skip to content

Commit 09f58fb

Browse files
committed
Fix some Checkstyle issues.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1378201 13f79535-47bb-0310-9956-ffa450edef68
1 parent 53db319 commit 09f58fb

2 files changed

Lines changed: 30 additions & 28 deletions

File tree

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

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ public class Base32 extends BaseNCodec {
6060
private static final byte[] CHUNK_SEPARATOR = {'\r', '\n'};
6161

6262
/**
63-
* This array is a lookup table that translates Unicode characters drawn from the "Base32 Alphabet" (as specified in
64-
* Table 3 of RFC 2045) into their 5-bit positive integer equivalents. Characters that are not in the Base32
63+
* This array is a lookup table that translates Unicode characters drawn from the "Base32 Alphabet" (as specified
64+
* in Table 3 of RFC 2045) into their 5-bit positive integer equivalents. Characters that are not in the Base32
6565
* alphabet but fall within the bounds of the array are translated to -1.
66-
*
6766
*/
6867
private static final byte[] DECODE_TABLE = {
6968
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
@@ -86,10 +85,9 @@ public class Base32 extends BaseNCodec {
8685
};
8786

8887
/**
89-
* This array is a lookup table that translates Unicode characters drawn from the "Base32 |Hex Alphabet" (as specified in
90-
* Table 3 of RFC 2045) into their 5-bit positive integer equivalents. Characters that are not in the Base32 Hex
91-
* alphabet but fall within the bounds of the array are translated to -1.
92-
*
88+
* This array is a lookup table that translates Unicode characters drawn from the "Base32 |Hex Alphabet" (as
89+
* specified in Table 3 of RFC 2045) into their 5-bit positive integer equivalents. Characters that are not in the
90+
* Base32 Hex alphabet but fall within the bounds of the array are translated to -1.
9391
*/
9492
private static final byte[] HEX_DECODE_TABLE = {
9593
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
@@ -102,8 +100,8 @@ public class Base32 extends BaseNCodec {
102100
};
103101

104102
/**
105-
* This array is a lookup table that translates 5-bit positive integer index values into their "Base32 Hex Alphabet"
106-
* equivalents as specified in Table 3 of RFC 2045.
103+
* This array is a lookup table that translates 5-bit positive integer index values into their
104+
* "Base32 Hex Alphabet" equivalents as specified in Table 3 of RFC 2045.
107105
*/
108106
private static final byte[] HEX_ENCODE_TABLE = {
109107
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
@@ -122,6 +120,7 @@ public class Base32 extends BaseNCodec {
122120
* Place holder for the bytes we're dealing with for our based logic.
123121
* Bitwise operations store and extract the encoding or decoding from this variable.
124122
*/
123+
125124
/**
126125
* Convenience variable to help us determine when our buffer is going to run out of room and needs resizing.
127126
* <code>decodeSize = {@link #BYTES_PER_ENCODED_BLOCK} - 1 + lineSeparator.length;</code>
@@ -178,8 +177,9 @@ public Base32(boolean useHex) {
178177
* </p>
179178
*
180179
* @param lineLength
181-
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of 8).
182-
* If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when decoding.
180+
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
181+
* 8). If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when
182+
* decoding.
183183
*/
184184
public Base32(int lineLength) {
185185
this(lineLength, CHUNK_SEPARATOR);
@@ -195,8 +195,9 @@ public Base32(int lineLength) {
195195
* </p>
196196
*
197197
* @param lineLength
198-
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of 8).
199-
* If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when decoding.
198+
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
199+
* 8). If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when
200+
* decoding.
200201
* @param lineSeparator
201202
* Each line of encoded data will end with this sequence of bytes.
202203
* @throws IllegalArgumentException
@@ -216,14 +217,16 @@ public Base32(int lineLength, byte[] lineSeparator) {
216217
* </p>
217218
*
218219
* @param lineLength
219-
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of 8).
220-
* If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when decoding.
220+
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
221+
* 8). If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when
222+
* decoding.
221223
* @param lineSeparator
222224
* Each line of encoded data will end with this sequence of bytes.
223-
* @param useHex if {@code true}, then use Base32 Hex alphabet, otherwise use Base32 alphabet
225+
* @param useHex
226+
* if {@code true}, then use Base32 Hex alphabet, otherwise use Base32 alphabet
224227
* @throws IllegalArgumentException
225-
* The provided lineSeparator included some Base32 characters. That's not going to work!
226-
* Or the lineLength > 0 and lineSeparator is null.
228+
* The provided lineSeparator included some Base32 characters. That's not going to work! Or the
229+
* lineLength > 0 and lineSeparator is null.
227230
*/
228231
public Base32(int lineLength, byte[] lineSeparator, boolean useHex) {
229232
super(BYTES_PER_UNENCODED_BLOCK, BYTES_PER_ENCODED_BLOCK,
@@ -297,7 +300,8 @@ void decode(byte[] in, int inPos, int inAvail, Context context) { // package pro
297300
int result = this.decodeTable[b];
298301
if (result >= 0) {
299302
context.modulus = (context.modulus+1) % BYTES_PER_ENCODED_BLOCK;
300-
context.lbitWorkArea = (context.lbitWorkArea << BITS_PER_ENCODED_BYTE) + result; // collect decoded bytes
303+
// collect decoded bytes
304+
context.lbitWorkArea = (context.lbitWorkArea << BITS_PER_ENCODED_BYTE) + result;
301305
if (context.modulus == 0) { // we can output the 5 bytes
302306
context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 32) & MASK_8BITS);
303307
context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 24) & MASK_8BITS);

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,17 @@
2121
import org.apache.commons.codec.StringEncoder;
2222

2323
/**
24-
* Encodes a string into a double metaphone value.
25-
* This Implementation is based on the algorithm by <CITE>Lawrence Philips</CITE>.
24+
* Encodes a string into a double metaphone value. This Implementation is based on the algorithm by <CITE>Lawrence
25+
* Philips</CITE>.
26+
* <p>
27+
* This class is conditionally thread-safe. The instance field {@link #maxCodeLen} is mutable
28+
* {@link #setMaxCodeLen(int)} but is not volatile, and accesses are not synchronized. If an instance of the class is
29+
* shared between threads, the caller needs to ensure that suitable synchronization is used to ensure safe publication
30+
* of the value between threads, and must not invoke {@link #setMaxCodeLen(int)} after initial setup.
2631
*
2732
* @see <a href="http://drdobbs.com/184401251?pgno=2">Original Article</a>
2833
* @see <a href="http://en.wikipedia.org/wiki/Metaphone">http://en.wikipedia.org/wiki/Metaphone</a>
2934
*
30-
* This class is conditionally thread-safe.
31-
* The instance field {@link #maxCodeLen} is mutable {@link #setMaxCodeLen(int)}
32-
* but is not volatile, and accesses are not synchronized.
33-
* If an instance of the class is shared between threads, the caller needs to ensure that suitable synchronization
34-
* is used to ensure safe publication of the value between threads, and must not invoke {@link #setMaxCodeLen(int)}
35-
* after initial setup.
36-
*
3735
* @version $Id$
3836
*/
3937
public class DoubleMetaphone implements StringEncoder {

0 commit comments

Comments
 (0)