@@ -45,7 +45,7 @@ sealed trait ZipAndJarFileLookupFactory {
45
45
closeableRegistry.registerCloseable(result)
46
46
result
47
47
} 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 )
49
49
}
50
50
}
51
51
@@ -259,14 +259,18 @@ final class FileBasedCache[K, T] {
259
259
}
260
260
}
261
261
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) =>
264
269
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)
270
274
} catch {
271
275
case _ : java.nio.file.NoSuchFileException =>
272
276
// Dummy stamp for (currently) non-existent file.
0 commit comments