From fd49c8f598a9ce33f7ce14ace31c86856819776b Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 16 Feb 2021 16:54:49 +0100 Subject: [PATCH] Polishing --- .../ScheduledAnnotationBeanPostProcessor.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java index 0ab8433a09f..14b73d6d7f7 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -358,9 +358,9 @@ public class ScheduledAnnotationBeanPostProcessor AnnotationUtils.isCandidateClass(targetClass, Arrays.asList(Scheduled.class, Schedules.class))) { Map> annotatedMethods = MethodIntrospector.selectMethods(targetClass, (MethodIntrospector.MetadataLookup>) method -> { - Set scheduledMethods = AnnotatedElementUtils.getMergedRepeatableAnnotations( + Set scheduledAnnotations = AnnotatedElementUtils.getMergedRepeatableAnnotations( method, Scheduled.class, Schedules.class); - return (!scheduledMethods.isEmpty() ? scheduledMethods : null); + return (!scheduledAnnotations.isEmpty() ? scheduledAnnotations : null); }); if (annotatedMethods.isEmpty()) { this.nonAnnotatedClasses.add(targetClass); @@ -370,8 +370,8 @@ public class ScheduledAnnotationBeanPostProcessor } else { // Non-empty set of methods - annotatedMethods.forEach((method, scheduledMethods) -> - scheduledMethods.forEach(scheduled -> processScheduled(scheduled, method, bean))); + annotatedMethods.forEach((method, scheduledAnnotations) -> + scheduledAnnotations.forEach(scheduled -> processScheduled(scheduled, method, bean))); if (logger.isTraceEnabled()) { logger.trace(annotatedMethods.size() + " @Scheduled methods processed on bean '" + beanName + "': " + annotatedMethods);