From 9fe0c8cc824f938fe4303caa668a5d3f267d1223 Mon Sep 17 00:00:00 2001 From: mpociecha Date: Sun, 30 Nov 2014 13:14:10 +0100 Subject: Add flat classpath implementation for zip and jar files This commit adds an implementation of flat classpath which can handle both jar and vanilla zip files. In fact there are two versions - for a class- and a sourcepath. Both extend ZipArchiveFileLookup which provides common logic. They use FileZipArchive. @gkossakowski made a comparison of different ways of handling zips and jars (e.g. using javac's ZipFileIndex). He stated that general efficiency of FileZipArchive, taking into account various parameters, is the best. FileZipArchive is slightly changed. From now it allows to find the entry for directory in all directory entries without iterating all entries regardless of a type. Thanks to that we can simply find a directory for a package - like in the case of DirectoryFileLookup. There's also added possibility to cache classpath representation of classpath elements from jar and zip files across compiler instances. The cache is just a map AbstractFile -> FlatClassPath. It should reduce the number of created classpath and file instances e.g. in the case of many ScalaPresentationCompilers in Scala IDE. To prevent the possibility to avoid a cache, caches are created as a part of factories responsible for the creation of these types of the flat classpath. --- bincompat-forward.whitelist.conf | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bincompat-forward.whitelist.conf') diff --git a/bincompat-forward.whitelist.conf b/bincompat-forward.whitelist.conf index 53401eefad..228b746fa1 100644 --- a/bincompat-forward.whitelist.conf +++ b/bincompat-forward.whitelist.conf @@ -292,6 +292,15 @@ filter { { matchName="scala.collection.immutable.Stream.scala$collection$immutable$Stream$$loop$2" problemName=MissingMethodProblem + }, + // changes needed by ZipArchiveFileLookup (the flat classpath representation) + { + matchName="scala.reflect.io.FileZipArchive.allDirs" + problemName=MissingMethodProblem + }, + { + matchName="scala.reflect.io.FileZipArchive.root" + problemName=MissingMethodProblem } ] } -- cgit v1.2.3