Skip to content

Commit

Permalink
Declare CRON_DISABLED constant value only once
Browse files Browse the repository at this point in the history
This commit removes the duplicated CRON_DISABLED constant value from
@Scheuled and simply refers to the ScheduledTaskRegistrar.CRON_DISABLED
constant.

This avoids a potential package cycle by ensuring that the `annotation`
package depends on the `config` package but not the other way around.

See gh-23568
  • Loading branch information
sbrannen committed Sep 16, 2019
1 parent 37d950c commit a676059
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.scheduling.config.ScheduledTaskRegistrar;

/**
* Annotation that marks a method to be scheduled. Exactly one of the
* {@link #cron}, {@link #fixedDelay}, or {@link #fixedRate} attributes must be
Expand Down Expand Up @@ -60,8 +62,9 @@
* <p>This is primarily meant for use with <code>${...}</code> placeholders,
* allowing for external disabling of corresponding scheduled methods.
* @since 5.1
* @see ScheduledTaskRegistrar#CRON_DISABLED
*/
String CRON_DISABLED = "-";
String CRON_DISABLED = ScheduledTaskRegistrar.CRON_DISABLED;


/**
Expand Down

0 comments on commit a676059

Please sign in to comment.