Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.Arrays;
import java.util.IllegalFormatException;
import java.util.regex.Pattern;

import org.assertj.core.error.BasicErrorMessageFactory;
import org.assertj.core.internal.Failures;
import org.assertj.core.internal.Throwables;
Expand Down Expand Up @@ -125,7 +124,7 @@ public SELF hasCause(Throwable cause) {
}

/**
* Verifies that the actual {@code Throwable} has a cause that refers to the given one, i.e. using == comparison
* Verifies that the actual {@code Throwable} has a cause that refers to the given one, i.e., using == comparison
* <p>
* Example:
* <pre><code class='java'> Throwable invalidArgException = new IllegalArgumentException("invalid arg");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import java.util.Arrays;
import java.util.Objects;

import org.assertj.core.description.Description;
import org.assertj.core.presentation.Representation;
import org.assertj.core.util.VisibleForTesting;
Expand Down Expand Up @@ -110,13 +109,13 @@ public String create(Description d, Representation representation) {
/** {@inheritDoc} */
@Override
public String create(Description d) {
return formatter.format(d, CONFIGURATION_PROVIDER.representation(), format, arguments);
return create(d, CONFIGURATION_PROVIDER.representation());
}

/** {@inheritDoc} */
@Override
public String create() {
return formatter.format(emptyDescription(), CONFIGURATION_PROVIDER.representation(), format, arguments);
return create(emptyDescription());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ public BinaryDiffResult diff(Path actual, byte[] expected) throws IOException {

@VisibleForTesting
public BinaryDiffResult diff(InputStream actualStream, byte[] expected) throws IOException {
try (InputStream expectedStream = new ByteArrayInputStream(expected)) {
return diff(actualStream, expectedStream);
}
return diff(actualStream, new ByteArrayInputStream(expected));
}

@VisibleForTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package org.assertj.core.internal;

import static java.util.Objects.requireNonNull;
import static org.assertj.core.error.ShouldNotBeNull.shouldNotBeNull;
import static org.assertj.core.util.Hexadecimals.byteToHexString;

import java.io.IOException;
Expand All @@ -31,7 +32,7 @@ public final class Digests {
private Digests() {}

public static String toHex(byte[] digest) {
requireNonNull(digest, "The digest should not be null");
requireNonNull(digest, shouldNotBeNull("digest")::create);
StringBuilder hex = new StringBuilder(digest.length * 2);
for (byte b : digest) {
hex.append(byteToHexString(b));
Expand All @@ -40,7 +41,7 @@ public static String toHex(byte[] digest) {
}

public static byte[] fromHex(String digest) {
requireNonNull(digest, "The digest should not be null");
requireNonNull(digest, shouldNotBeNull("digest")::create);
byte[] bytes = new byte[digest.length() / 2];
for (int i = 0; i < bytes.length; i++) {
bytes[i] = Integer.valueOf(digest.substring(i * 2, (i + 1) * 2), 16).byteValue();
Expand Down
164 changes: 0 additions & 164 deletions assertj-core/src/main/java/org/assertj/core/internal/InputStreams.java

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
import java.io.IOException;
import java.io.LineNumberReader;
import java.io.StringReader;
import java.io.UncheckedIOException;
import java.text.Normalizer;
import java.util.Base64;
import java.util.Collections;
Expand Down Expand Up @@ -212,7 +213,7 @@ public void assertHasLineCount(AssertionInfo info, CharSequence actual, int expe
try {
while (reader.readLine() != null);
} catch (IOException e) {
throw new InputStreamsException(format("Unable to count lines in `%s`", actual), e);
throw new UncheckedIOException(format("Unable to count lines in `%s`", actual), e);
}
checkLineCounts(actual, reader.getLineNumber(), expectedLineCount, info);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import static org.mockito.Mockito.verify;

import java.io.File;

import org.assertj.core.api.FileAssert;
import org.assertj.core.api.FileAssertBaseTest;
import org.junit.jupiter.api.BeforeAll;
Expand Down Expand Up @@ -66,4 +65,5 @@ void should_allow_charset_to_be_specified_for_reading_expected_file_content() th
// WHEN/THEN
then(actual).hasSameTextualContentAs(expected, TURKISH_CHARSET);
}

}
Loading