From 0bd923b0a77f5da1d98018dc0c1301a1242e5f56 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 1 Sep 2022 14:37:20 -0700 Subject: [PATCH] Polishing --- .../java/org/springframework/aot/hint/ExecutableHint.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/aot/hint/ExecutableHint.java b/spring-core/src/main/java/org/springframework/aot/hint/ExecutableHint.java index de51e2160e7..8ce01cb68c0 100644 --- a/spring-core/src/main/java/org/springframework/aot/hint/ExecutableHint.java +++ b/spring-core/src/main/java/org/springframework/aot/hint/ExecutableHint.java @@ -22,6 +22,7 @@ import java.lang.reflect.Method; import java.util.List; import org.springframework.lang.Nullable; +import org.springframework.util.Assert; /** * A hint that describes the need for reflection on a {@link Method} or @@ -73,7 +74,7 @@ public final class ExecutableHint extends MemberHint { /** * Return the {@linkplain ExecutableMode mode} that apply to this hint. - * @return the modes + * @return the mode */ public ExecutableMode getMode() { return this.mode; @@ -104,7 +105,8 @@ public final class ExecutableHint extends MemberHint { * @return {@code this}, to facilitate method chaining */ public Builder withMode(ExecutableMode mode) { - if (this.mode == null || !this.mode.includes(mode)) { + Assert.notNull(mode, "'mode' must not be null"); + if ((this.mode == null || !this.mode.includes(mode))) { this.mode = mode; } return this;