
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
54 lines
1.0 KiB
Plaintext
54 lines
1.0 KiB
Plaintext
== Why is this an issue?
|
|
|
|
Overriding Event.clone() is a required part of the API contract:
|
|
|
|
____
|
|
You are required to override the Event.clone() method in your Event subclass. The clone() method returns a cloned copy of the event object by setting the type property and any new properties in the clone. Typically, you define the clone() method to return an event instance created with the new operator.
|
|
|
|
____
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,flex]
|
|
----
|
|
public class MyEvent extends Event {...}
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,flex]
|
|
----
|
|
public class MyEvent extends Event
|
|
{
|
|
...
|
|
override public function clone():Event {
|
|
return new MyEvent(...);
|
|
}
|
|
...
|
|
}
|
|
----
|
|
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Make this class "XXX" override "Event.clone()" function.
|
|
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 22 Nov 2013, 13:49:15 Freddy Mallet wrote:
|
|
Is implemented by \https://jira.codehaus.org/browse/SONARPLUGINS-3283
|
|
|
|
endif::env-github,rspecator-view[]
|