Issue Details (XML | Word | Printable)

Key: QRTZNET-156
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Marko Lahma
Reporter: Konstantin Lenin
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Quartz.NET

JobDetail.RemoveJobListener throws InvalidCastException

Created: 21/Apr/09 07:25 AM   Updated: 04/May/09 09:34 AM
Component/s: Jobs
Affects Version/s: 1.0
Fix Version/s: 1.0.1

Environment: Win XP SP2 Prof, NET 3.5


 Description  « Hide
See the code below

/// <summary>
       /// Add the specified name of a <see cref="IJobListener" /> to
the
       /// end of the <see cref="IJob" />'s list of listeners.
       /// </summary>
       public virtual void AddJobListener(string listenerName)
       {
                       if (!jobListeners.Add(listenerName))
                       {
                               throw new ArgumentException(string.Format
(CultureInfo.InvariantCulture, "Job listener '{0}' is already
registered for job detail: {1}", listenerName, FullName));
                       }
       }

       /// <summary>
       /// Remove the specified name of a <see cref="IJobListener" />
from
       /// the <see cref="IJob" />'s list of listeners.
       /// </summary>
       /// <returns>true if the given name was found in the list, and
removed</returns>
       public virtual bool RemoveJobListener(string listenerName)
       {
           for (int i = 0; i < jobListeners.Count; i++)
           {
               IJobListener listener = (IJobListener) jobListeners
[i];
               if (listener.Name == listenerName)
               {
                   jobListeners.RemoveAt(i);
                   return true;
               }
           }
           return false;
       }

You store listener names but try to get IJobListener iface on deletion

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.