@@ -45,7 +45,7 @@ sealed trait ZipAndJarFileLookupFactory {
4545 closeableRegistry.registerCloseable(result)
4646 result
4747 } else {
48- cache.getOrCreate(zipSettings, Seq (jfile.toPath), () => createForZipFile(zipFile, zipSettings), closeableRegistry, checkStamps = true )
48+ cache.getOrCreate(zipSettings, Seq (jfile.toPath -> zipFile.basicFileAttributes ), () => createForZipFile(zipFile, zipSettings), closeableRegistry, checkStamps = true )
4949 }
5050 }
5151
@@ -259,14 +259,18 @@ final class FileBasedCache[K, T] {
259259 }
260260 }
261261
262- def getOrCreate (k : K , paths : Seq [Path ], create : () => T , closeableRegistry : CloseableRegistry , checkStamps : Boolean ): T = cache.synchronized {
263- val stamps = if (! checkStamps) Nil else paths.map { path =>
262+ def getOrCreate (k : K , paths : Seq [Path ], create : () => T ,
263+ closeableRegistry : CloseableRegistry , checkStamps : Boolean ): T = {
264+ val pathsAndAttrs = paths.map(x => (x, Files .readAttributes(x, classOf [BasicFileAttributes ])))
265+ getOrCreate0(k, pathsAndAttrs, create, closeableRegistry, checkStamps)
266+ }
267+ def getOrCreate0 (k : K , paths : Seq [(Path , BasicFileAttributes )], create : () => T , closeableRegistry : CloseableRegistry , checkStamps : Boolean ): T = cache.synchronized {
268+ val stamps = if (! checkStamps) Nil else paths.map { case (path, attrs) =>
264269 try {
265- val attrs = Files .readAttributes(path, classOf [BasicFileAttributes ])
266- val lastModified = attrs.lastModifiedTime()
267- // only null on some platforms, but that's okay, we just use the last modified timestamp as our stamp
268- val fileKey = attrs.fileKey()
269- Stamp (lastModified, attrs.size(), if (fileKey == null ) NoFileKey else fileKey)
270+ val lastModified = attrs.lastModifiedTime()
271+ // only null on some platforms, but that's okay, we just use the last modified timestamp as our stamp
272+ val fileKey = attrs.fileKey()
273+ Stamp (lastModified, attrs.size(), if (fileKey == null ) NoFileKey else fileKey)
270274 } catch {
271275 case _ : java.nio.file.NoSuchFileException =>
272276 // Dummy stamp for (currently) non-existent file.
0 commit comments