Skip to content

Commit

Permalink
api: Correct nullability on Pointered.getOrDefault
Browse files Browse the repository at this point in the history
  • Loading branch information
zml2008 committed Sep 6, 2021
1 parent 0fd4a86 commit ce69e32
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public interface Pointered {
* @return the value
* @since 4.8.0
*/
@Contract("_, null -> null; _, !null -> !null")
@Contract("_, null -> _; _, !null -> !null")
@SuppressWarnings("checkstyle:MethodName")
default <T> @Nullable T getOrDefault(final @NotNull Pointer<T> pointer, final @Nullable T defaultValue) {
return this.pointers().getOrDefault(pointer, defaultValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public interface Pointers extends Buildable<Pointers, Pointers.Builder> {
* @return the value
* @since 4.8.0
*/
@Contract("_, !null -> !null; _, null -> null")
@Contract("_, null -> _; _, !null -> !null")
@SuppressWarnings("checkstyle:MethodName")
default <T> @Nullable T getOrDefault(final @NotNull Pointer<T> pointer, final @Nullable T defaultValue) {
return this.get(pointer).orElse(defaultValue);
Expand Down

0 comments on commit ce69e32

Please sign in to comment.