summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-02-22 14:43:07 +0100
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-02-22 14:43:07 +0100
commitb0dcf798752220c7fe173318930215248aa0bfbb (patch)
tree7a85990f10e59cc8b7a8fafd34d4feff5d17cafd /src/library
parent63d4dfaf7cf25f2cf5c00c97986d3d060733268f (diff)
parent2ede59c0b9d12d47a1f61d1c599842856d829227 (diff)
downloadscala-b0dcf798752220c7fe173318930215248aa0bfbb.tar.gz
scala-b0dcf798752220c7fe173318930215248aa0bfbb.tar.bz2
scala-b0dcf798752220c7fe173318930215248aa0bfbb.zip
Merge pull request #3563 from adriaanm/t5479
SI-5479 deprecate DelayedInit outside of App
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/App.scala5
-rw-r--r--src/library/scala/DelayedInit.scala1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/library/scala/App.scala b/src/library/scala/App.scala
index ef39ee2134..62245322da 100644
--- a/src/library/scala/App.scala
+++ b/src/library/scala/App.scala
@@ -31,6 +31,8 @@ import scala.collection.mutable.ListBuffer
* It should also be noted that the `main` method should not be overridden:
* the whole class body becomes the “main method”.
*
+ * Future versions of this trait will no longer extend `DelayedInit`.
+ *
* @author Martin Odersky
* @version 2.1, 15/02/2011
*/
@@ -38,10 +40,12 @@ trait App extends DelayedInit {
/** The time when the execution of this program started, in milliseconds since 1
* January 1970 UTC. */
+ @deprecatedOverriding("executionStart should not be overridden", "2.11.0")
val executionStart: Long = currentTime
/** The command line arguments passed to the application's `main` method.
*/
+ @deprecatedOverriding("args should not be overridden", "2.11.0")
protected def args: Array[String] = _args
private var _args: Array[String] = _
@@ -55,6 +59,7 @@ trait App extends DelayedInit {
* themselves define a `delayedInit` method.
* @param body the initialization code to be stored for later execution
*/
+ @deprecated("The delayedInit mechanism will disappear.", "2.11.0")
override def delayedInit(body: => Unit) {
initCode += (() => body)
}
diff --git a/src/library/scala/DelayedInit.scala b/src/library/scala/DelayedInit.scala
index cfbbf30793..7f976b073f 100644
--- a/src/library/scala/DelayedInit.scala
+++ b/src/library/scala/DelayedInit.scala
@@ -43,6 +43,7 @@ package scala
*
* @author Martin Odersky
*/
+@deprecated("DelayedInit semantics can be surprising. Support for `App` will continue.\nSee the release notes for more details: https://github.com/scala/scala/releases/tag/v2.11.0-RC1", "2.11.0")
trait DelayedInit {
def delayedInit(x: => Unit): Unit
} \ No newline at end of file