Skip to content

Commit

Permalink
fix Preconditions.checkArgumentNotNull to be given fieldName, not ent…
Browse files Browse the repository at this point in the history
…ire exception message
  • Loading branch information
davidmoten committed Apr 2, 2023
1 parent b08e87d commit 40faa78
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ public static <T> T checkNotNull(T t, String message) {
}

public static <T> T checkArgumentNotNull(T t) {
return checkArgumentNotNull(t, "argument cannot be null");
return checkArgumentNotNull(t, "argument");
}

public static <T> T checkArgumentNotNull(T t, String message) {
public static <T> T checkArgumentNotNull(T t, String parameterName) {
if (t == null) {
throw new IllegalArgumentException(message);
throw new IllegalArgumentException(parameterName + " cannot be null");
}
return t;
}
Expand Down

0 comments on commit 40faa78

Please sign in to comment.