From 03429aee94c9eb4b1d2a4aa7fd8fadfea6e17bf1 Mon Sep 17 00:00:00 2001
From: Iulian Dragos
Date: Mon, 27 Apr 2009 16:38:44 +0000
Subject: Fixed documentation on Application
---
src/library/scala/Application.scala | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
(limited to 'src/library')
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:
*
*
- * - As described above, there is no way to obtain the
- * command-line arguments because all code in body of an
object
- * extending Application
is run as part of the static initialization
- * which occurs before Application
's main
method
- * even begins execution.
* - Threaded code that references the object will block until static
* initialization is complete. However, because the entire execution of an
*
object
extending Application
takes place during
* static initialization, concurrent code will always deadlock if
* it must synchronize with the enclosing object.
+ * - As described above, there is no way to obtain the
+ * command-line arguments because all code in body of an
object
+ * extending Application
is run as part of the static initialization
+ * which occurs before Application
's main
method
+ * even begins execution.
* - 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.
*
*
+ * Instead, it is recommended to define a main
method explicitly:
+ *
+ * object Main {
+ * def main(args: Array[String]) {
+ * //..
+ * }
+ * }
+ *
+ *
* @author Matthias Zenger
* @version 1.0, 10/09/2003
*/
--
cgit v1.2.3