Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Use verbose messages for null parameters in Adapters.
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosalberto committed Dec 6, 2017
1 parent 9110201 commit 91c999e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private Adapters() {}
*/
public static Binary injectBinary(OutputStream stream) {
if (stream == null) {
throw new IllegalArgumentException("stream");
throw new IllegalArgumentException("stream cannot be null");
}

return new BinaryAdapter(Channels.newChannel(stream));
Expand All @@ -49,7 +49,7 @@ public static Binary injectBinary(OutputStream stream) {
*/
public static Binary injectBinary(WritableByteChannel channel) {
if (channel == null) {
throw new IllegalArgumentException("channel");
throw new IllegalArgumentException("channel cannot be null");
}

return new BinaryAdapter(channel);
Expand All @@ -65,7 +65,7 @@ public static Binary injectBinary(WritableByteChannel channel) {
*/
public static Binary extractBinary(InputStream stream) {
if (stream == null) {
throw new IllegalArgumentException("stream");
throw new IllegalArgumentException("stream cannot be null");
}

return new BinaryAdapter(Channels.newChannel(stream));
Expand All @@ -81,7 +81,7 @@ public static Binary extractBinary(InputStream stream) {
*/
public static Binary extractBinary(ReadableByteChannel channel) {
if (channel == null) {
throw new IllegalArgumentException("channel");
throw new IllegalArgumentException("channel cannot be null");
}

return new BinaryAdapter(channel);
Expand Down

0 comments on commit 91c999e

Please sign in to comment.