Skip to content

Commit e37d10f

Browse files
committed
Reuse ArrayUtils.contains()
1 parent d296a19 commit e37d10f

2 files changed

Lines changed: 3 additions & 16 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,9 +1555,9 @@ void testUrlSafe() {
15551555
final byte[] decoded = randomData[0];
15561556
final byte[] result = Base64.decodeBase64(encoded);
15571557
assertArrayEquals(decoded, result, "url-safe i=" + i);
1558-
assertFalse(BaseNTestData.bytesContain(encoded, (byte) '='), "url-safe i=" + i + " no '='");
1559-
assertFalse(BaseNTestData.bytesContain(encoded, (byte) '\\'), "url-safe i=" + i + " no '\\'");
1560-
assertFalse(BaseNTestData.bytesContain(encoded, (byte) '+'), "url-safe i=" + i + " no '+'");
1558+
assertFalse(ArrayUtils.contains(encoded, (byte) '='), "url-safe i=" + i + " no '='");
1559+
assertFalse(ArrayUtils.contains(encoded, (byte) '\\'), "url-safe i=" + i + " no '\\'");
1560+
assertFalse(ArrayUtils.contains(encoded, (byte) '+'), "url-safe i=" + i + " no '+'");
15611561
}
15621562

15631563
}

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
import java.io.InputStream;
2222
import java.util.Random;
2323

24-
import org.apache.commons.lang3.ArrayUtils;
25-
2624
/**
2725
* Data and functions common to BaseN tests.
2826
*/
@@ -80,17 +78,6 @@ public class BaseNTestData {
8078

8179
private static final int LAST_READ_KEY = 1;
8280

83-
/**
84-
* Tests the supplied byte[] array to see if it contains the specified byte c.
85-
*
86-
* @param bytes byte[] array to test
87-
* @param c byte to look for
88-
* @return true if bytes contains c, false otherwise
89-
*/
90-
static boolean bytesContain(final byte[] bytes, final byte c) {
91-
return ArrayUtils.contains(bytes, c);
92-
}
93-
9481
private static int[] fill(final byte[] buf, final int offset, final InputStream in)
9582
throws IOException {
9683
int read = in.read(buf, offset, buf.length - offset);

0 commit comments

Comments
 (0)