diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2009-04-27 16:38:44 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2009-04-27 16:38:44 +0000 |
commit | 03429aee94c9eb4b1d2a4aa7fd8fadfea6e17bf1 (patch) | |
tree | 8d797a631dfe20d97b685fd5c11fe20d56fe9866 /src/library | |
parent | d5985686e0813ab32fc360d4fcdc773fd20b7047 (diff) | |
download | scala-03429aee94c9eb4b1d2a4aa7fd8fadfea6e17bf1.tar.gz scala-03429aee94c9eb4b1d2a4aa7fd8fadfea6e17bf1.tar.bz2 scala-03429aee94c9eb4b1d2a4aa7fd8fadfea6e17bf1.zip |
Fixed documentation on Application
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/Application.scala | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/library/scala/Application.scala b/src/library/scala/Application.scala index 4321f8ed71..871e61913a 100644 --- a/src/library/scala/Application.scala +++ b/src/library/scala/Application.scala @@ -42,16 +42,16 @@ import scala.compat.Platform.currentTime * pitfalls: * </p> * <ul> - * <li>As described above, there is no way to obtain the - * command-line arguments because all code in body of an <code>object</code> - * extending <code>Application</code> is run as part of the static initialization - * which occurs before <code>Application</code>'s <code>main</code> method - * even begins execution.</li> * <li> Threaded code that references the object will block until static * initialization is complete. However, because the entire execution of an * <code>object</code> extending <code>Application</code> takes place during * static initialization, concurrent code will <em>always</em> deadlock if * it must synchronize with the enclosing object.</li> + * <li>As described above, there is no way to obtain the + * command-line arguments because all code in body of an <code>object</code> + * extending <code>Application</code> is run as part of the static initialization + * which occurs before <code>Application</code>'s <code>main</code> method + * even begins execution.</li> * <li>Static initializers are run only once during program execution, and * JVM authors usually assume their execution to be relatively short. * Therefore, certain JVM configurations may become confused, or simply fail to @@ -60,6 +60,15 @@ import scala.compat.Platform.currentTime * performance degradation.</li> * </ul> * + * Instead, it is recommended to define a <code>main</code> method explicitly: + * <pre> + * <b>object</b> Main { + * <b>def</b> main(args: Array[String]) { + * //.. + * } + * } + * </pre> + * * @author Matthias Zenger * @version 1.0, 10/09/2003 */ |