diff options
author | Antoine Gourlay <antoine@gourlay.fr> | 2014-01-08 16:36:54 +0100 |
---|---|---|
committer | Antoine Gourlay <antoine@gourlay.fr> | 2014-01-08 18:12:34 +0100 |
commit | 906e517135c5fe002ab2ae1c96433583e6fe20b2 (patch) | |
tree | 86819732d6cc02399d219c0788b6bf00026ea411 /src | |
parent | ada8d9156baad2d8a24c1a40e032eb4bc7154bac (diff) | |
download | scala-906e517135c5fe002ab2ae1c96433583e6fe20b2.tar.gz scala-906e517135c5fe002ab2ae1c96433583e6fe20b2.tar.bz2 scala-906e517135c5fe002ab2ae1c96433583e6fe20b2.zip |
SI-7491 deprecate overriding App.main and clarify documentation
App.main should never be overridden, so let's enforce it.
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/App.scala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/library/scala/App.scala b/src/library/scala/App.scala index 90a8977e81..ef39ee2134 100644 --- a/src/library/scala/App.scala +++ b/src/library/scala/App.scala @@ -28,9 +28,8 @@ import scala.collection.mutable.ListBuffer * functionality, which means that fields of the object will not have been initialized * before the main method has been executed.''''' * - * It should also be noted that the `main` method will not normally need to be overridden: - * the purpose is to turn the whole class body into the “main method”. You should only - * chose to override it if you know what you are doing. + * It should also be noted that the `main` method should not be overridden: + * the whole class body becomes the “main method”. * * @author Martin Odersky * @version 2.1, 15/02/2011 @@ -61,11 +60,12 @@ trait App extends DelayedInit { } /** The main method. - * This stores all argument so that they can be retrieved with `args` - * and the executes all initialization code segments in the order they were - * passed to `delayedInit` + * This stores all arguments so that they can be retrieved with `args` + * and then executes all initialization code segments in the order in which + * they were passed to `delayedInit`. * @param args the arguments passed to the main method */ + @deprecatedOverriding("main should not be overridden", "2.11.0") def main(args: Array[String]) = { this._args = args for (proc <- initCode) proc() |