Skip to content

Commit 55a865b

Browse files
committed
Fix checkstyle warnings.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1435550 13f79535-47bb-0310-9956-ffa450edef68
1 parent ecec1c4 commit 55a865b

15 files changed

Lines changed: 66 additions & 39 deletions

src/main/java/org/apache/commons/codec/StringEncoderComparator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
*
2929
* @version $Id$
3030
*/
31+
@SuppressWarnings("rawtypes")
3132
public class StringEncoderComparator implements Comparator {
3233

3334
/**
@@ -69,6 +70,7 @@ public StringEncoderComparator(final StringEncoder stringEncoder) {
6970
* @return the Comparable.compareTo() return code or 0 if an encoding error was caught.
7071
* @see Comparable
7172
*/
73+
@SuppressWarnings("unchecked")
7274
@Override
7375
public int compare(final Object o1, final Object o2) {
7476

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,9 @@ public Base32(final int lineLength, final byte[] lineSeparator, final boolean us
281281
* Output is written to {@link Context#buffer} as 8-bit octets, using {@link Context#pos} as the buffer position
282282
*/
283283
@Override
284-
void decode(final byte[] in, int inPos, final int inAvail, final Context context) { // package protected for access from I/O streams
284+
void decode(final byte[] in, int inPos, final int inAvail, final Context context) {
285+
// package protected for access from I/O streams
286+
285287
if (context.eof) {
286288
return;
287289
}
@@ -375,7 +377,9 @@ void decode(final byte[] in, int inPos, final int inAvail, final Context context
375377
* @param context the context to be used
376378
*/
377379
@Override
378-
void encode(final byte[] in, int inPos, final int inAvail, final Context context) { // package protected for access from I/O streams
380+
void encode(final byte[] in, int inPos, final int inAvail, final Context context) {
381+
// package protected for access from I/O streams
382+
379383
if (context.eof) {
380384
return;
381385
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ public Base32InputStream(final InputStream in, final boolean doEncode) {
7777
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
7878
* If lineLength <= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
7979
*/
80-
public Base32InputStream(final InputStream in, final boolean doEncode, final int lineLength, final byte[] lineSeparator) {
80+
public Base32InputStream(final InputStream in, final boolean doEncode,
81+
final int lineLength, final byte[] lineSeparator) {
8182
super(in, new Base32(lineLength, lineSeparator), doEncode);
8283
}
8384

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ public Base32OutputStream(final OutputStream out, final boolean doEncode) {
7777
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
7878
* If lineLength <= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
7979
*/
80-
public Base32OutputStream(final OutputStream out, final boolean doEncode, final int lineLength, final byte[] lineSeparator) {
80+
public Base32OutputStream(final OutputStream out, final boolean doEncode,
81+
final int lineLength, final byte[] lineSeparator) {
8182
super(out, new Base32(lineLength, lineSeparator), doEncode);
8283
}
8384

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,8 @@ public static byte[] encodeBase64(final byte[] binaryData, final boolean isChunk
654654
* Thrown when the input array needs an output array bigger than maxResultSize
655655
* @since 1.4
656656
*/
657-
public static byte[] encodeBase64(final byte[] binaryData, final boolean isChunked, final boolean urlSafe, final int maxResultSize) {
657+
public static byte[] encodeBase64(final byte[] binaryData, final boolean isChunked,
658+
final boolean urlSafe, final int maxResultSize) {
658659
if (binaryData == null || binaryData.length == 0) {
659660
return binaryData;
660661
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public Base64InputStream(final InputStream in, final boolean doEncode) {
8181
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
8282
* If lineLength <= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
8383
*/
84-
public Base64InputStream(final InputStream in, final boolean doEncode, final int lineLength, final byte[] lineSeparator) {
84+
public Base64InputStream(final InputStream in, final boolean doEncode,
85+
final int lineLength, final byte[] lineSeparator) {
8586
super(in, new Base64(lineLength, lineSeparator), doEncode);
8687
}
8788
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public Base64OutputStream(final OutputStream out, final boolean doEncode) {
8181
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
8282
* If lineLength <= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
8383
*/
84-
public Base64OutputStream(final OutputStream out, final boolean doEncode, final int lineLength, final byte[] lineSeparator) {
84+
public Base64OutputStream(final OutputStream out, final boolean doEncode,
85+
final int lineLength, final byte[] lineSeparator) {
8586
super(out, new Base64(lineLength, lineSeparator), doEncode);
8687
}
8788
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ public String toString() {
179179
* @param lineLength if &gt; 0, use chunking with a length <code>lineLength</code>
180180
* @param chunkSeparatorLength the chunk separator length, if relevant
181181
*/
182-
protected BaseNCodec(final int unencodedBlockSize, final int encodedBlockSize, final int lineLength, final int chunkSeparatorLength) {
182+
protected BaseNCodec(final int unencodedBlockSize, final int encodedBlockSize,
183+
final int lineLength, final int chunkSeparatorLength) {
183184
this.unencodedBlockSize = unencodedBlockSize;
184185
this.encodedBlockSize = encodedBlockSize;
185186
final boolean useChunking = lineLength > 0 && chunkSeparatorLength > 0;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ public static byte[] getBytesUtf8(final String string) {
192192
return getBytes(string, Charsets.UTF_8);
193193
}
194194

195-
private static IllegalStateException newIllegalStateException(final String charsetName, final UnsupportedEncodingException e) {
195+
private static IllegalStateException newIllegalStateException(final String charsetName,
196+
final UnsupportedEncodingException e) {
196197
return new IllegalStateException(charsetName + ": " + e);
197198
}
198199

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ class B64 {
5151
* @param buffer
5252
* Where the output chars is appended to.
5353
*/
54-
static void b64from24bit(final byte b2, final byte b1, final byte b0, final int outLen, final StringBuilder buffer) {
54+
static void b64from24bit(final byte b2, final byte b1, final byte b0, final int outLen,
55+
final StringBuilder buffer) {
5556
// The bit masking is necessary because the JVM byte type is signed!
5657
int w = ((b2 << 16) & 0x00ffffff) | ((b1 << 8) & 0x00ffff) | (b0 & 0xff);
5758
// It's effectively a "for" loop but kept to resemble the original C code.

0 commit comments

Comments
 (0)