summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/util/ClassPath.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-02-18 18:49:21 +0000
committerPaul Phillips <paulp@improving.org>2010-02-18 18:49:21 +0000
commit388a0c0d1db3e41e3acbebd6e1e4c79f7d176ca3 (patch)
treef1f5df26496c614446cea6b970f48c6659ad803d /src/compiler/scala/tools/nsc/util/ClassPath.scala
parent23e5428008fc88377e59a1a5c20d5476c586d62e (diff)
downloadscala-388a0c0d1db3e41e3acbebd6e1e4c79f7d176ca3.tar.gz
scala-388a0c0d1db3e41e3acbebd6e1e4c79f7d176ca3.tar.bz2
scala-388a0c0d1db3e41e3acbebd6e1e4c79f7d176ca3.zip
The first reasonably satisfying classpath commit.
there with this one. Documentation to come. Review by community.
Diffstat (limited to 'src/compiler/scala/tools/nsc/util/ClassPath.scala')
-rw-r--r--src/compiler/scala/tools/nsc/util/ClassPath.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/util/ClassPath.scala b/src/compiler/scala/tools/nsc/util/ClassPath.scala
index 013cd89a44..0e9c4f27fa 100644
--- a/src/compiler/scala/tools/nsc/util/ClassPath.scala
+++ b/src/compiler/scala/tools/nsc/util/ClassPath.scala
@@ -213,6 +213,13 @@ abstract class ClassPath[T] {
case Some(ClassRep(Some(x: AbstractFile), _)) => Some(x)
case _ => None
}
+
+ def sortString = asURLs map (_.toString) sorted
+ override def equals(that: Any) = that match {
+ case x: ClassPath[_] => this.sortString == x.sortString
+ case _ => false
+ }
+ override def hashCode = sortString.hashCode
}
/**
@@ -311,6 +318,10 @@ extends ClassPath[T] {
case x: DirectoryClassPath => x.dir.path
case x: MergedClassPath[_] => x.asClasspathString
})
+ def show {
+ println("ClassPath %s has %d entries and results in:\n".format(name, entries.size))
+ asClasspathString split ':' foreach (x => println(" " + x))
+ }
override def toString() = "merged classpath "+ entries.mkString("(", "\n", ")")
}