diff --git a/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala b/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala index d8e5ca795..3d7eb933c 100644 --- a/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala +++ b/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala @@ -16,12 +16,11 @@ final class RichUpdateReport(report: UpdateReport) { .map( f => (f, - // TODO: this used to be a lastModified(), without error checking. - // On occasion, "files" contains files like "./target/ivyhome/resolution-cache/com.example/foo/0.4.0/resolved.xml.xml", - // which do not actually exist, so getModifiedTime() correctly throws an exception. For the moment, the behavior of - // lastModified() is reproduced, but the non-existent file should really not be there to begin with. so, FIXME. - try IO.getModifiedTime(f) - catch { case _: FileNotFoundException => 0L }) + // TODO: The list of files may also contain some odd files that do not actually exist like: + // "./target/ivyhome/resolution-cache/com.example/foo/0.4.0/resolved.xml.xml". + // IO.lastModified() will just return zero, but the list of files should not contain such + // files to begin with, in principle. + IO.lastModified(f) ) .toMap UpdateReport(report.cachedDescriptor, report.configurations, report.stats, stamps) diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala index 32bbaf516..1a25a3202 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala @@ -149,7 +149,7 @@ class GigahorseUrlHandler extends AbstractURLHandler { val lastModified = lastModifiedTimestamp(response) if (lastModified > 0) { - IO.setModifiedTime(dest, lastModified) + IO.setLastModified(dest, lastModified) } if (l != null) { diff --git a/project/Util.scala b/project/Util.scala index 2ef855762..5c63dd1de 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -26,8 +26,8 @@ object Util { val timestamp = formatter.format(new Date) val content = versionLine(version) + "\ntimestamp=" + timestamp val f = dir / "xsbt.version.properties" - // TODO: replace lastModified() with sbt.io.Milli.getModifiedTime(), once the build - // has been upgraded to a version of sbt that includes sbt.io.Milli. + // TODO: replace lastModified() with sbt.io.IO.lastModified(), once the build + // has been upgraded to a version of sbt that includes that call. if (!f.exists || f.lastModified < lastCompilationTime(analysis) || !containsVersion(f, version)) { s.log.info("Writing version information to " + f + " :\n" + content) IO.write(f, content)