From d5c78c953dd6ae2dc582a3bd0a2c06d5f02a8f08 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 30 Jul 2013 22:55:41 +0200 Subject: [PATCH] Remove the JobDetail from the job data map after discovering it Issue: SPR-10775 --- .../scheduling/quartz/SchedulerAccessor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessor.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessor.java index 9c65590231..6c261a100f 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessor.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -51,7 +51,7 @@ import org.springframework.util.ReflectionUtils; *

For concrete usage, check out the {@link SchedulerFactoryBean} and * {@link SchedulerAccessorBean} classes. * - *

Compatible with Quartz 1.5+ as well as Quartz 2.0/2.1, as of Spring 3.1. + *

Compatible with Quartz 1.5+ as well as Quartz 2.0-2.2, as of Spring 3.2. * * @author Juergen Hoeller * @since 2.5.6 @@ -397,7 +397,7 @@ public abstract class SchedulerAccessor implements ResourceLoaderAware { else { try { Map jobDataMap = (Map) ReflectionUtils.invokeMethod(Trigger.class.getMethod("getJobDataMap"), trigger); - return (JobDetail) jobDataMap.get(JobDetailAwareTrigger.JOB_DETAIL_KEY); + return (JobDetail) jobDataMap.remove(JobDetailAwareTrigger.JOB_DETAIL_KEY); } catch (NoSuchMethodException ex) { throw new IllegalStateException("Inconsistent Quartz API: " + ex);