CRITICAL
Rule Definition
When creating your own custom Event class, you must override the inherited Event.clone() method in order for it to duplicate the properties of your custom class. If you do not set all the properties that you add in your event subclass, those properties will not have the correct values when the event is cloned. This is important because the Flex SDK clones events whenever redispatching takes place.
Remediation
Always override clone() method in custom event class.
Violation Code Sample
public class FirstCustomEvent // VIOLATION - clone method is missing
{
public var lala : String;
public function FirstCustomEvent()
{
}
}
Reference
http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD
Related Technologies
Technical Criterion
Programming Practices - Unexpected Behavior
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.