Fix warnings. Avoid copyArrayToImmutableIndexedSeq (#8781)

This commit is contained in:
kenji yoshida 2026-02-22 20:04:21 +09:00 committed by GitHub
parent b1bfb6e627
commit c1ada47c29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 7 deletions

View File

@ -3992,10 +3992,10 @@ object Classpaths {
val scalaProvider = ac.provider.scalaProvider
usiOnly match
case Some(instance) =>
unmanagedJarsTask(sv, instance.version, instance.allJars)
unmanagedJarsTask(sv, instance.version, instance.allJars.toIndexedSeq)
case None =>
(subVersion: String) =>
if (scalaProvider.version == subVersion) scalaProvider.jars else Nil
if (scalaProvider.version == subVersion) scalaProvider.jars.toIndexedSeq else Nil
}
val updateConf = {
// Log captures log messages at all levels, except ivy logs.
@ -4042,7 +4042,7 @@ object Classpaths {
includeDetails = includeDetails,
log = s.log
)
}: @nowarn
}
private[sbt] def dependencyPositionsTask: Initialize[Task[Map[ModuleID, SourcePosition]]] =
Def.task {

View File

@ -19,7 +19,6 @@ import sbt.internal.io.Resources
import sbt.internal.scripted.*
import RemoteSbtCreatorProp.*
import scala.annotation.nowarn
import scala.collection.parallel.ForkJoinTaskSupport
import scala.collection.mutable
import scala.util.control.NonFatal
@ -635,7 +634,6 @@ class ScriptedRunner {
keepTempDirectory,
)
@nowarn
private def run(
baseDir: File,
bufferLog: Boolean,
@ -650,7 +648,7 @@ class ScriptedRunner {
keepTempDirectory: Boolean = false,
): Unit = {
val addTestFile = (f: File) => { prescripted.add(f); () }
val runner = new ScriptedTests(baseDir, bufferLog, javaCommand, launchOpts)
val runner = new ScriptedTests(baseDir, bufferLog, javaCommand, launchOpts.toIndexedSeq)
val sbtVersion =
prop match {
case LauncherBased(launcherJar) =>
@ -660,7 +658,7 @@ class ScriptedRunner {
val accept = isTestCompatible(baseDir, sbtVersion)
// The scripted tests mapped to the inputs that the user wrote after `scripted`.
val scriptedTests =
get(tests, baseDir, accept, logger).map(st => (st.group, st.name))
get(tests.toIndexedSeq, baseDir, accept, logger).map(st => (st.group, st.name))
// Choosing Int.MaxValue will make the groupSize 1 in batchScriptedRunner
val groupCount = if (parallelExecution) instances else Int.MaxValue
val scriptedRunners =