Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Invoking the Thread.start() method tells the Java runtimes runtime to start executing the thread's run() method using the started thread. Invoking a Thread object's run() method directly is incorrect. When a a Thread object's run() method is invoked directly, the statements in the run() method are executed by current thread, rather than by the newly created thread. Furthermore, if the Thread object was constructed by instantiating a subclass of Thread that fails to override the run() method rather than being constructed from a Runnable object, calls to the subclass's run() method invoke Thread.run(), which does nothing.

Consequently, programs must not directly invoking invoke a Thread object's run() method is forbidden.

Noncompliant Code Example

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="b316d0e140f69069-35b143c7-43724c41-ac658a70-e42034c8b12251c0bcc25113"><ac:plain-text-body><![CDATA[

[[API 2006

AA. Bibliography#API 06]]

Interface Runnable and class Thread

]]></ac:plain-text-body></ac:structured-macro>

...