aboutsummaryrefslogtreecommitdiff
path: root/stage1/CachingClassLoader.scala
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2016-11-25 16:48:28 -0500
committerChristopher Vogt <oss.nsp@cvogt.org>2017-02-01 23:10:48 -0500
commit00d9485f5597fdecc58461bd81df635fafbe494f (patch)
tree026f7f143d8cf5ae69e7afaa452d03180d3e04a8 /stage1/CachingClassLoader.scala
parent8939ebef01ae7a665781d99331e4d13e7b875a96 (diff)
downloadcbt-00d9485f5597fdecc58461bd81df635fafbe494f.tar.gz
cbt-00d9485f5597fdecc58461bd81df635fafbe494f.tar.bz2
cbt-00d9485f5597fdecc58461bd81df635fafbe494f.zip
Merge separate hashmaps for persistent cache into one
This isn’t type-safe, but re-using that same hashmap for both keys and classloaders allows to reduce the number of members in Context. Also we can re-use the same hashMap for other things as well in the coming commits, e.g. timestamps.
Diffstat (limited to 'stage1/CachingClassLoader.scala')
-rw-r--r--stage1/CachingClassLoader.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/stage1/CachingClassLoader.scala b/stage1/CachingClassLoader.scala
index 4ddebda..38c0a1b 100644
--- a/stage1/CachingClassLoader.scala
+++ b/stage1/CachingClassLoader.scala
@@ -5,7 +5,7 @@ import scala.util.Try
trait CachingClassLoader extends ClassLoader{
def logger: Logger
- val cache = new KeyLockedLazyCache[String,Option[Class[_]]]( new ConcurrentHashMap, new ConcurrentHashMap, Some(logger) )
+ val cache = new KeyLockedLazyCache[Option[Class[_]]]( new ConcurrentHashMap[AnyRef,AnyRef], Some(logger) )
override def loadClass(name: String, resolve: Boolean) = {
cache.get( name, Try(super.loadClass(name, resolve)).toOption ).getOrElse(null)
}