From 9450c16f193ecab560f9374f7965a60be3b09c18 Mon Sep 17 00:00:00 2001 From: mihaylov Date: Tue, 15 May 2007 10:46:54 +0000 Subject: Synced src/dotnet-library with src/library rev ... Synced src/dotnet-library with src/library rev 11027 --- src/library/scala/Array.scala | 1 - src/library/scala/runtime/Properties.scala | 57 ------------------------------ src/library/scala/util/Properties.scala | 57 ++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 58 deletions(-) delete mode 100644 src/library/scala/runtime/Properties.scala create mode 100644 src/library/scala/util/Properties.scala (limited to 'src/library') diff --git a/src/library/scala/Array.scala b/src/library/scala/Array.scala index 5de6796040..fad177d88c 100644 --- a/src/library/scala/Array.scala +++ b/src/library/scala/Array.scala @@ -188,7 +188,6 @@ object Array { * @version 1.0 */ final class Array[A](_length: Int) extends Seq[A] { - import java.lang.Error /** The length of the array */ def length: Int = throw new Error() diff --git a/src/library/scala/runtime/Properties.scala b/src/library/scala/runtime/Properties.scala deleted file mode 100644 index 3e46646f2b..0000000000 --- a/src/library/scala/runtime/Properties.scala +++ /dev/null @@ -1,57 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2006-2007, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - -package scala.runtime - -/** A utility to load the library properties from a Java properties file - * included in the jar. - * - * @author Stephane Micheloud - */ -object Properties { - - /** The name of the properties file */ - private val propFilename = "/library.properties" - - /** The loaded properties */ - private val props = { - val props = new java.util.Properties - val stream = classOf[Application].getResourceAsStream(propFilename) - if (stream != null) - props.load(stream) - props - } - - /** The version number of the jar this was loaded from, or - * "(unknown)" if it cannot be determined. - */ - val versionString: String = { - val defaultString = "(unknown)" - "version " + props.getProperty("version.number") - } - - val copyrightString: String = { - val defaultString = "(c) 2002-2007 LAMP/EPFL" - props.getProperty("copyright.string", defaultString) - } - - val encodingString: String = { - val defaultString = "ISO-8859-1" - props.getProperty("file.encoding", defaultString) - } - - private val writer = new java.io.PrintWriter(Console.err, true) - - val versionMsg = "Scala library " + versionString + " -- " + copyrightString - - def main(args: Array[String]) { - writer.println(versionMsg) - } -} diff --git a/src/library/scala/util/Properties.scala b/src/library/scala/util/Properties.scala new file mode 100644 index 0000000000..d6e77ffa60 --- /dev/null +++ b/src/library/scala/util/Properties.scala @@ -0,0 +1,57 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2006-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id$ + +package scala.util + +/** A utility to load the library properties from a Java properties file + * included in the jar. + * + * @author Stephane Micheloud + */ +object Properties { + + /** The name of the properties file */ + private val propFilename = "/library.properties" + + /** The loaded properties */ + private val props = { + val props = new java.util.Properties + val stream = classOf[Application].getResourceAsStream(propFilename) + if (stream != null) + props.load(stream) + props + } + + /** The version number of the jar this was loaded from, or + * "(unknown)" if it cannot be determined. + */ + val versionString: String = { + val defaultString = "(unknown)" + "version " + props.getProperty("version.number") + } + + val copyrightString: String = { + val defaultString = "(c) 2002-2007 LAMP/EPFL" + props.getProperty("copyright.string", defaultString) + } + + val encodingString: String = { + val defaultString = "ISO-8859-1" + props.getProperty("file.encoding", defaultString) + } + + private val writer = new java.io.PrintWriter(Console.err, true) + + val versionMsg = "Scala library " + versionString + " -- " + copyrightString + + def main(args: Array[String]) { + writer.println(versionMsg) + } +} -- cgit v1.2.3