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 6a67cc266206..ab4792df0f8c 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 @@ private void putProperties(String name, SkipPropertyMapping defaultSkip, Object } 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 9ceb76ce4c53..732225ca87cd 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 @@ private int handleError(boolean debug, Exception ex) { if (ex instanceof CommandException commandException) { options = commandException.getOptions(); if (options.contains(CommandException.Option.RETHROW)) { - throw (CommandException) ex; + throw commandException; } } boolean couldNotShowMessage = false;