Skip to content

Commit ba34329

Browse files
committed
Merge if tests that do the same block
1 parent 09d901b commit ba34329

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,7 @@ public int read() throws IOException {
156156
@Override
157157
public int read(final byte[] array, final int offset, final int len) throws IOException {
158158
Objects.requireNonNull(array, "array");
159-
if (offset < 0 || len < 0) {
160-
throw new IndexOutOfBoundsException();
161-
}
162-
if (offset > array.length || offset + len > array.length) {
159+
if (offset < 0 || len < 0 || offset > array.length || offset + len > array.length) {
163160
throw new IndexOutOfBoundsException();
164161
}
165162
if (len == 0) {

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,7 @@ public boolean isStrictDecoding() {
166166
@Override
167167
public void write(final byte[] array, final int offset, final int len) throws IOException {
168168
Objects.requireNonNull(array, "array");
169-
if (offset < 0 || len < 0) {
170-
throw new IndexOutOfBoundsException();
171-
}
172-
if (offset > array.length || offset + len > array.length) {
169+
if (offset < 0 || len < 0 || offset > array.length || offset + len > array.length) {
173170
throw new IndexOutOfBoundsException();
174171
}
175172
if (len > 0) {

0 commit comments

Comments
 (0)