diff --git a/compiler/src/dotty/tools/dotc/profile/Profiler.scala b/compiler/src/dotty/tools/dotc/profile/Profiler.scala index 0283fb904476..25c53903c10b 100644 --- a/compiler/src/dotty/tools/dotc/profile/Profiler.scala +++ b/compiler/src/dotty/tools/dotc/profile/Profiler.scala @@ -103,6 +103,7 @@ private [profile] class RealProfiler(reporter : ProfileReporter)(using Context) private val mainThread = Thread.currentThread() + @nowarn("cat=deprecation") private[profile] def snapThread(idleTimeNanos: Long): ProfileSnap = { import RealProfiler._ val current = Thread.currentThread() @@ -245,6 +246,7 @@ class StreamProfileReporter(out:PrintWriter) extends ProfileReporter { reportCommon(EventType.BACKGROUND, profiler, threadRange) override def reportForeground(profiler: RealProfiler, threadRange: ProfileRange): Unit = reportCommon(EventType.MAIN, profiler, threadRange) + @nowarn("cat=deprecation") private def reportCommon(tpe:EventType, profiler: RealProfiler, threadRange: ProfileRange): Unit = out.println(s"$tpe,${threadRange.start.snapTimeNanos},${threadRange.end.snapTimeNanos},${profiler.id},${threadRange.phase.id},${threadRange.phase.phaseName.replace(',', ' ')},${threadRange.purpose},${threadRange.taskCount},${threadRange.thread.getId},${threadRange.thread.getName},${threadRange.runNs},${threadRange.idleNs},${threadRange.cpuNs},${threadRange.userNs},${threadRange.allocatedBytes},${threadRange.end.heapBytes} ") diff --git a/library/src/scala/runtime/coverage/Invoker.scala b/library/src/scala/runtime/coverage/Invoker.scala index ee37a477cbe6..c35c6c2ec7df 100644 --- a/library/src/scala/runtime/coverage/Invoker.scala +++ b/library/src/scala/runtime/coverage/Invoker.scala @@ -1,11 +1,11 @@ package scala.runtime.coverage -import scala.collection.mutable.{BitSet, AnyRefMap} +import scala.annotation.internal.sharable +import scala.annotation.nowarn import scala.collection.concurrent.TrieMap +import scala.collection.mutable.{BitSet, AnyRefMap} +import java.io.{File, FileWriter} import java.nio.file.Files -import java.io.FileWriter -import java.io.File -import scala.annotation.internal.sharable @sharable // avoids false positive by -Ycheck-reentrant object Invoker { @@ -48,6 +48,7 @@ object Invoker { writer.write('\n') writer.flush() + @nowarn("cat=deprecation") def measurementFile(dataDir: String): File = new File( dataDir, MeasurementsPrefix + runtimeUUID + "." + Thread.currentThread.nn.getId