Skip to content

Commit e7f5f10

Browse files
committed
Use Java-style parameter names
1 parent 729bdc8 commit e7f5f10

File tree

3 files changed

+36
-36
lines changed

3 files changed

+36
-36
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,13 @@ public static byte[] decodeBase64(final String base64String) {
220220
/**
221221
* Decodes a byte64-encoded integer according to crypto standards such as W3C's XML-Signature.
222222
*
223-
* @param pArray
223+
* @param array
224224
* a byte array containing base64 character data
225225
* @return A BigInteger
226226
* @since 1.4
227227
*/
228-
public static BigInteger decodeInteger(final byte[] pArray) {
229-
return new BigInteger(1, decodeBase64(pArray));
228+
public static BigInteger decodeInteger(final byte[] array) {
229+
return new BigInteger(1, decodeBase64(array));
230230
}
231231

232232
/**

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

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -527,18 +527,18 @@ protected boolean containsAlphabetOrPad(final byte[] arrayOctet) {
527527
/**
528528
* Decodes a byte[] containing characters in the Base-N alphabet.
529529
*
530-
* @param pArray
530+
* @param array
531531
* A byte array containing Base-N character data
532532
* @return a byte array containing binary data
533533
*/
534534
@Override
535-
public byte[] decode(final byte[] pArray) {
536-
if (BinaryCodec.isEmpty(pArray)) {
537-
return pArray;
535+
public byte[] decode(final byte[] array) {
536+
if (BinaryCodec.isEmpty(array)) {
537+
return array;
538538
}
539539
final Context context = new Context();
540-
decode(pArray, 0, pArray.length, context);
541-
decode(pArray, 0, EOF, context); // Notify decoder of EOF.
540+
decode(array, 0, array.length, context);
541+
decode(array, 0, EOF, context); // Notify decoder of EOF.
542542
final byte[] result = new byte[context.pos];
543543
readResults(result, 0, result.length, context);
544544
return result;
@@ -583,23 +583,23 @@ public byte[] decode(final String pArray) {
583583
/**
584584
* Encodes a byte[] containing binary data, into a byte[] containing characters in the alphabet.
585585
*
586-
* @param pArray
586+
* @param array
587587
* a byte array containing binary data
588588
* @return A byte array containing only the base N alphabetic character data
589589
*/
590590
@Override
591-
public byte[] encode(final byte[] pArray) {
592-
if (BinaryCodec.isEmpty(pArray)) {
593-
return pArray;
591+
public byte[] encode(final byte[] array) {
592+
if (BinaryCodec.isEmpty(array)) {
593+
return array;
594594
}
595-
return encode(pArray, 0, pArray.length);
595+
return encode(array, 0, array.length);
596596
}
597597

598598
/**
599599
* Encodes a byte[] containing binary data, into a byte[] containing
600600
* characters in the alphabet.
601601
*
602-
* @param pArray
602+
* @param array
603603
* a byte array containing binary data
604604
* @param offset
605605
* initial offset of the subarray.
@@ -608,20 +608,20 @@ public byte[] encode(final byte[] pArray) {
608608
* @return A byte array containing only the base N alphabetic character data
609609
* @since 1.11
610610
*/
611-
public byte[] encode(final byte[] pArray, final int offset, final int length) {
612-
if (BinaryCodec.isEmpty(pArray)) {
613-
return pArray;
611+
public byte[] encode(final byte[] array, final int offset, final int length) {
612+
if (BinaryCodec.isEmpty(array)) {
613+
return array;
614614
}
615615
final Context context = new Context();
616-
encode(pArray, offset, length, context);
617-
encode(pArray, offset, EOF, context); // Notify encoder of EOF.
616+
encode(array, offset, length, context);
617+
encode(array, offset, EOF, context); // Notify encoder of EOF.
618618
final byte[] buf = new byte[context.pos - context.readPos];
619619
readResults(buf, 0, buf.length, context);
620620
return buf;
621621
}
622622

623623
// package protected for access from I/O streams
624-
abstract void encode(byte[] pArray, int i, int length, Context context);
624+
abstract void encode(byte[] array, int i, int length, Context context);
625625

626626
/**
627627
* Encodes an Object using the Base-N algorithm. This method is provided in order to satisfy the requirements of
@@ -648,24 +648,24 @@ public Object encode(final Object obj) throws EncoderException {
648648
* This is a duplicate of {@link #encodeToString(byte[])}; it was merged during refactoring.
649649
* </p>
650650
*
651-
* @param pArray a byte array containing binary data
651+
* @param array a byte array containing binary data
652652
* @return String containing only character data in the appropriate alphabet.
653653
* @since 1.5
654654
*/
655-
public String encodeAsString(final byte[] pArray) {
656-
return StringUtils.newStringUtf8(encode(pArray));
655+
public String encodeAsString(final byte[] array) {
656+
return StringUtils.newStringUtf8(encode(array));
657657
}
658658

659659
/**
660660
* Encodes a byte[] containing binary data, into a String containing characters in the Base-N alphabet.
661661
* Uses UTF8 encoding.
662662
*
663-
* @param pArray
663+
* @param array
664664
* a byte array containing binary data
665665
* @return A String containing only Base-N character data
666666
*/
667-
public String encodeToString(final byte[] pArray) {
668-
return StringUtils.newStringUtf8(encode(pArray));
667+
public String encodeToString(final byte[] array) {
668+
return StringUtils.newStringUtf8(encode(array));
669669
}
670670

671671
/**
@@ -716,14 +716,14 @@ protected int getDefaultBufferSize() {
716716
/**
717717
* Gets the amount of space needed to encode the supplied array.
718718
*
719-
* @param pArray byte[] array which will later be encoded
719+
* @param array byte[] array which will later be encoded
720720
* @return amount of space needed to encode the supplied array.
721721
* Returns a long since a max-len array will require &gt; Integer.MAX_VALUE
722722
*/
723-
public long getEncodedLength(final byte[] pArray) {
723+
public long getEncodedLength(final byte[] array) {
724724
// Calculate non-chunked size - rounded up to allow for padding
725725
// cast to long is needed to avoid possibility of overflow
726-
long len = (pArray.length + unencodedBlockSize - 1) / unencodedBlockSize * (long) encodedBlockSize;
726+
long len = (array.length + unencodedBlockSize - 1) / unencodedBlockSize * (long) encodedBlockSize;
727727
if (lineLength > 0) { // We're using chunking
728728
// Round up to nearest multiple
729729
len += (len + lineLength - 1) / lineLength * chunkSeparatorLength;

src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ private static final class NoOpBaseNCodec extends BaseNCodec {
4141
}
4242

4343
@Override
44-
void decode(final byte[] pArray, final int i, final int length, final Context context) {
44+
void decode(final byte[] array, final int i, final int length, final Context context) {
4545
// no-op
4646
}
4747

4848
@Override
49-
void encode(final byte[] pArray, final int i, final int length, final Context context) {
49+
void encode(final byte[] array, final int i, final int length, final Context context) {
5050
// no-op
5151
}
5252

@@ -143,11 +143,11 @@ static long getPresumableFreeMemory() {
143143
public void setUp() {
144144
codec = new BaseNCodec(0, 0, 0, 0) {
145145
@Override
146-
void decode(final byte[] pArray, final int i, final int length, final Context context) {
146+
void decode(final byte[] array, final int i, final int length, final Context context) {
147147
}
148148

149149
@Override
150-
void encode(final byte[] pArray, final int i, final int length, final Context context) {
150+
void encode(final byte[] array, final int i, final int length, final Context context) {
151151
}
152152

153153
@Override
@@ -381,12 +381,12 @@ public void testProvidePaddingByte() {
381381
// Given
382382
codec = new BaseNCodec(0, 0, 0, 0, (byte) 0x25) {
383383
@Override
384-
void decode(final byte[] pArray, final int i, final int length, final Context context) {
384+
void decode(final byte[] array, final int i, final int length, final Context context) {
385385
// no-op
386386
}
387387

388388
@Override
389-
void encode(final byte[] pArray, final int i, final int length, final Context context) {
389+
void encode(final byte[] array, final int i, final int length, final Context context) {
390390
// no-op
391391
}
392392

0 commit comments

Comments
 (0)