Skip to content

Commit fc5ef23

Browse files
committed
Avoid type cast
1 parent 3a403a5 commit fc5ef23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/HateoasHalProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ private static boolean isHalEnabled(@NonNull HateoasProperties hateoasProperties
9494
var method = ReflectionUtils.findMethod(HateoasProperties.class, methodName);
9595
if (method != null) {
9696
var result = ReflectionUtils.invokeMethod(method, hateoasProperties);
97-
if (result instanceof Boolean) {
98-
return (boolean) result;
97+
if (result instanceof Boolean halEnabled) {
98+
return halEnabled;
9999
}
100100

101101
throw new IllegalStateException("Method " + methodName + " did not return a boolean value");

0 commit comments

Comments
 (0)