Skip to content

Commit

Permalink
Fix some warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Feb 14, 2021
1 parent 692de91 commit 77ddc3c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/edu/hm/hafner/util/Ensure.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ public static BooleanCondition that(final boolean value) {
* the additional values to check
*
* @return an object condition
* @param <T> type to check
*/
@CheckReturnValue
public static ObjectCondition that(@CheckForNull final Object value,
public static <T> ObjectCondition<T> that(@CheckForNull final T value,
@CheckForNull final Object... additionalValues) {
return new ObjectCondition(value, additionalValues);
return new ObjectCondition<>(value, additionalValues);
}

/**
Expand Down Expand Up @@ -560,6 +561,8 @@ public void isNotNull(final String explanation, final Object... args) {
}
}

@SuppressFBWarnings("NP")
@SuppressWarnings("PMD.AvoidThrowingNullPointerException")
T getValue() {
if (value == null) {
throw new NullPointerException("Value is null");
Expand Down

0 comments on commit 77ddc3c

Please sign in to comment.