Skip to content

Commit 4a1f7d7

Browse files
committed
Normalize array type declarations
1 parent 62d5869 commit 4a1f7d7

7 files changed

Lines changed: 17 additions & 17 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ public void testPairs() {
278278
assertEquals("0010", new String(new Base16().encode(new byte[] { (byte) 0, (byte) 16 })));
279279
assertEquals("0011", new String(new Base16().encode(new byte[] { (byte) 0, (byte) 17 })));
280280
for (int i = -128; i <= 127; i++) {
281-
final byte test[] = { (byte) i, (byte) i };
281+
final byte[] test = { (byte) i, (byte) i };
282282
assertArrayEquals(test, new Base16().decode(new Base16().encode(test)));
283283
}
284284
}
@@ -391,7 +391,7 @@ public void testSingletons() {
391391
assertEquals("67", new String(new Base16().encode(new byte[] { (byte) 103 })));
392392
assertEquals("68", new String(new Base16().encode(new byte[] { (byte) 104 })));
393393
for (int i = -128; i <= 127; i++) {
394-
final byte test[] = { (byte) i };
394+
final byte[] test = { (byte) i };
395395
assertArrayEquals(test, new Base16().decode(new Base16().encode(test)));
396396
}
397397
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,14 @@ public void testSingleCharEncoding() {
365365
for (int i = 0; i < 20; i++) {
366366
Base32 codec = new Base32();
367367
final BaseNCodec.Context context = new BaseNCodec.Context();
368-
final byte unencoded[] = new byte[i];
369-
final byte allInOne[] = codec.encode(unencoded);
368+
final byte[] unencoded = new byte[i];
369+
final byte[] allInOne = codec.encode(unencoded);
370370
codec = new Base32();
371371
for (int j=0; j< unencoded.length; j++) {
372372
codec.encode(unencoded, j, 1, context);
373373
}
374374
codec.encode(unencoded, 0, -1, context);
375-
final byte singly[] = new byte[allInOne.length];
375+
final byte[] singly = new byte[allInOne.length];
376376
codec.readResults(singly, 0, 100, context);
377377
if (!Arrays.equals(allInOne, singly)){
378378
fail();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ public void testObjectEncode() throws Exception {
588588
public void testPairs() {
589589
assertEquals("AAA=", new String(Base64.encodeBase64(new byte[] { 0, 0 })));
590590
for (int i = -128; i <= 127; i++) {
591-
final byte test[] = { (byte) i, (byte) i };
591+
final byte[] test = { (byte) i, (byte) i };
592592
assertArrayEquals(test, Base64.decodeBase64(Base64.encodeBase64(test)));
593593
}
594594
}
@@ -868,7 +868,7 @@ public void testSingletons() {
868868
assertEquals("Zw==", new String(Base64.encodeBase64(new byte[] { (byte) 103 })));
869869
assertEquals("aA==", new String(Base64.encodeBase64(new byte[] { (byte) 104 })));
870870
for (int i = -128; i <= 127; i++) {
871-
final byte test[] = { (byte) i };
871+
final byte[] test = { (byte) i };
872872
assertArrayEquals(test, Base64.decodeBase64(Base64.encodeBase64(test)));
873873
}
874874
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ public void testEncodeHex_ByteBufferWithLimit() {
530530

531531
@Test
532532
public void testEncodeHexPartialInput() {
533-
final byte data[] = "hello world".getBytes(StandardCharsets.UTF_8);
533+
final byte[] data = "hello world".getBytes(StandardCharsets.UTF_8);
534534

535535
char[] hex = Hex.encodeHex(data, 0, 0, true);
536536
assertArrayEquals(new char[0], hex);
@@ -556,14 +556,14 @@ public void testEncodeHexPartialInput() {
556556

557557
@Test
558558
public void testEncodeHexPartialInputUnderbounds() {
559-
final byte data[] = "hello world".getBytes(StandardCharsets.UTF_8);
559+
final byte[] data = "hello world".getBytes(StandardCharsets.UTF_8);
560560

561561
assertThrows(ArrayIndexOutOfBoundsException.class, () -> Hex.encodeHex(data, -2, 10, true));
562562
}
563563

564564
@Test
565565
public void testEncodeHexPartialInputOverbounds() {
566-
final byte data[] = "hello world".getBytes(StandardCharsets.UTF_8);
566+
final byte[] data = "hello world".getBytes(StandardCharsets.UTF_8);
567567

568568
assertThrows(ArrayIndexOutOfBoundsException.class, () -> Hex.encodeHex(data, 9, 10, true));
569569
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void testCorrectness() throws Exception {
6060
final Random random1 = new Random();
6161
final Random random2 = new Random();
6262
for (int i = 0; i < 10000; i++) {
63-
final byte randomBytes[] = new byte[random1.nextInt(2048)];
63+
final byte[] randomBytes = new byte[random1.nextInt(2048)];
6464
random2.nextBytes(randomBytes);
6565
checkOnBytes(randomBytes, false);
6666
}

src/test/java/org/apache/commons/codec/language/ColognePhoneticTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private static boolean hasTestCase(final String re) {
5050
}
5151

5252
// Character sequences to be tested by the code
53-
private static final String MATCHES[] = {
53+
private static final String[] MATCHES = {
5454
".*[AEIOUJY].*", // A, E, I, J, O, U, Y
5555
".*H.*", // H
5656
".*B.*", // B
@@ -229,19 +229,19 @@ public void testIsEncodeEquals() {
229229

230230
@Test
231231
public void testVariationsMella() throws EncoderException {
232-
final String data[] = {"mella", "milah", "moulla", "mellah", "muehle", "mule"};
232+
final String[] data = {"mella", "milah", "moulla", "mellah", "muehle", "mule"};
233233
this.checkEncodingVariations("65", data);
234234
}
235235

236236
@Test
237237
public void testVariationsMeyer() throws EncoderException {
238-
final String data[] = {"Meier", "Maier", "Mair", "Meyer", "Meyr", "Mejer", "Major"};
238+
final String[] data = {"Meier", "Maier", "Mair", "Meyer", "Meyr", "Mejer", "Major"};
239239
this.checkEncodingVariations("67", data);
240240
}
241241

242242
@Test
243243
public void testSpecialCharsBetweenSameLetters() throws EncoderException {
244-
final String data[] = {"Test test", "Testtest", "Test-test", "TesT#Test", "TesT?test"};
244+
final String[] data = {"Test test", "Testtest", "Test-test", "TesT#Test", "TesT?test"};
245245
this.checkEncodingVariations("28282", data);
246246
}
247247

src/test/java/org/apache/commons/codec/net/BCodecTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ public class BCodecTest {
4545
"=?ASCII?B?AB==?="
4646
};
4747

48-
static final int SWISS_GERMAN_STUFF_UNICODE[] =
48+
static final int[] SWISS_GERMAN_STUFF_UNICODE =
4949
{ 0x47, 0x72, 0xFC, 0x65, 0x7A, 0x69, 0x5F, 0x7A, 0xE4, 0x6D, 0xE4 };
5050

51-
static final int RUSSIAN_STUFF_UNICODE[] =
51+
static final int[] RUSSIAN_STUFF_UNICODE =
5252
{ 0x412, 0x441, 0x435, 0x43C, 0x5F, 0x43F, 0x440, 0x438, 0x432, 0x435, 0x442 };
5353

5454
private String constructString(final int[] unicodeChars) {

0 commit comments

Comments
 (0)