diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java index 6a67cc26620..ab4792df0f8 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java @@ -138,7 +138,7 @@ public class AnnotationsPropertySource extends EnumerablePropertySource } else if (value instanceof MergedAnnotation annotation) { for (Method attribute : annotation.getType().getDeclaredMethods()) { - collectProperties(name, defaultSkip, (MergedAnnotation) value, attribute, properties); + collectProperties(name, defaultSkip, annotation, attribute, properties); } } else { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java index a1e1234b787..ceffdb3e886 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java @@ -242,7 +242,7 @@ public class CommandRunner implements Iterable { if (ex instanceof CommandException commandException) { options = commandException.getOptions(); if (options.contains(CommandException.Option.RETHROW)) { - throw (CommandException) ex; + throw commandException; } } boolean couldNotShowMessage = false;