The current code fails to determine the time relevance of an event respect to a contract key when the check is on a forward date.
To reproduce the bug test for defaults on an issuer on a forward date on an issuer with events in the future but prior to that test forward date.
The problem comes from the test being performed only for the system date in the wrong method. Since the time relevance of a credit event depends on the type of the event (there might be delays for applicability) this should be polymorphically implemented in a separate method to the credit event type match check.
In the code fix there is a default behaviour in the base class which just tests for hasOccurred, derived classes could implement their own time relevance policies.
impacted files:
issuer.cpp
defaultevent.Xpp
No client code impact.
Fix