Uploaded image for project: 'Quartz Scheduler (Historical - Do Not File New Issues Here - See GitHub)'
  1. Quartz Scheduler (Historical - Do Not File New Issues Here - See GitHub)
  2. QTZ-304

Scheduler#scheduleJobs API change to support generics and avoid cast

    XMLWordPrintable

    Details

    • Type: Patch
    • Status: Resolved
    • Priority: 2 Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.5
    • Fix Version/s: 2.2
    • Component/s: Core
    • Labels:
      None
    • Terracotta Target:
      BigMemory 4.1.0
    • Fixed In Revision:
      2246

      Description

      A cast from CronTrigger to Trigger is necessary when using Scheduler#scheduleJobs:

      TriggerBuilder<CronTrigger> cronTriggerBuilder = TriggerBuilder.newTrigger()...;
      Map<JobDetail, List<Trigger>> triggersAndJobs = new HashMap<JobDetail, List<Trigger>>();
      triggersAndJobs.put(jobDetail, Collections.singletonList((Trigger) cronTriggerBuilder.build()));
      scheduler.scheduleJobs(triggersAndJobs, true);
      

      A patch against trunk is included for using Set<? extends Trigger> instead of Set<Trigger> to prevent casting.

      Because of type erasure this should be backward compatible and I can provided the patch for 2.1.x branch if needed.

        Attachments

          Activity

            People

            • Assignee:
              jhouse James House
              Reporter:
              slaunay Sebastien Launay
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: