diff options
Diffstat (limited to 'src/compiler/scala/tools/nsc/io/VirtualFile.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/io/VirtualFile.scala | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/compiler/scala/tools/nsc/io/VirtualFile.scala b/src/compiler/scala/tools/nsc/io/VirtualFile.scala index 4a8aa1a69d..450d86b599 100644 --- a/src/compiler/scala/tools/nsc/io/VirtualFile.scala +++ b/src/compiler/scala/tools/nsc/io/VirtualFile.scala @@ -8,20 +8,13 @@ package scala.tools.nsc package io import java.io.{ ByteArrayInputStream, ByteArrayOutputStream, InputStream, OutputStream } -import PartialFunction._ /** This class implements an in-memory file. * * @author Philippe Altherr * @version 1.0, 23/03/2004 */ -class VirtualFile(val name: String, _path: String) extends AbstractFile -{ - assert((name ne null) && (path ne null), name + " - " + path) - - //######################################################################## - // Public Constructors - +class VirtualFile(val name: String, override val path: String) extends AbstractFile { /** * Initializes this instance with the specified name and an * identical path. @@ -31,8 +24,11 @@ class VirtualFile(val name: String, _path: String) extends AbstractFile */ def this(name: String) = this(name, name) - override def hashCode = path.## - override def equals(that: Any) = cond(that) { case x: VirtualFile => x.path == path } + override def hashCode = path.hashCode + override def equals(that: Any) = that match { + case x: VirtualFile => x.path == path + case _ => false + } //######################################################################## // Private data @@ -40,9 +36,6 @@ class VirtualFile(val name: String, _path: String) extends AbstractFile //######################################################################## // Public Methods - - def path = _path - def absolute = this /** Returns null. */ |