Remove unnecessary cast

Replace explicit casts with pattern variables to improve readability and
remove redundancy.

See gh-48297

Signed-off-by: geopark021 <geobrown021@gmail.com>
This commit is contained in:
geopark021
2025-11-26 15:55:47 +01:00
committed by Stéphane Nicoll
parent 710e567ba5
commit 6b60d89b28
2 changed files with 2 additions and 2 deletions
@@ -138,7 +138,7 @@ public class AnnotationsPropertySource extends EnumerablePropertySource<Class<?>
}
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 {
@@ -242,7 +242,7 @@ public class CommandRunner implements Iterable<Command> {
if (ex instanceof CommandException commandException) {
options = commandException.getOptions();
if (options.contains(CommandException.Option.RETHROW)) {
throw (CommandException) ex;
throw commandException;
}
}
boolean couldNotShowMessage = false;