diff --git a/compile/inc/src/main/scala/sbt/inc/Compile.scala b/compile/inc/src/main/scala/sbt/inc/Compile.scala index 6d6b616c3..a7ccb3dd2 100644 --- a/compile/inc/src/main/scala/sbt/inc/Compile.scala +++ b/compile/inc/src/main/scala/sbt/inc/Compile.scala @@ -84,7 +84,7 @@ private final class AnalysisCallback(internalMap: File => Option[File], external val outputSettings = output match { case single: SingleOutput => Array(new OutputSetting("/", single.outputDirectory.getAbsolutePath)) case multi: MultipleOutput => - multi.outputGroups.map(out => new OutputSetting(out.sourceDirectory.getAbsolutePath, out.outputDirectory.getAbsolutePath)).toArray + multi.outputGroups.map(out => new OutputSetting(out.sourceDirectory.getAbsolutePath, out.outputDirectory.getAbsolutePath)) } new Compilation(System.currentTimeMillis, outputSettings) } diff --git a/compile/interface/src/test/scala/xsbt/ScalaCompilerForUnitTesting.scala b/compile/interface/src/test/scala/xsbt/ScalaCompilerForUnitTesting.scala index 1c4eee353..019590dfc 100644 --- a/compile/interface/src/test/scala/xsbt/ScalaCompilerForUnitTesting.scala +++ b/compile/interface/src/test/scala/xsbt/ScalaCompilerForUnitTesting.scala @@ -33,7 +33,7 @@ class ScalaCompilerForUnitTesting(nameHashing: Boolean = false) { def extractUsedNamesFromSrc(src: String): Set[String] = { val (Seq(tempSrcFile), analysisCallback) = compileSrcs(src) - analysisCallback.usedNames(tempSrcFile).toSet + analysisCallback.usedNames(tempSrcFile) } /** @@ -46,7 +46,7 @@ class ScalaCompilerForUnitTesting(nameHashing: Boolean = false) { def extractUsedNamesFromSrc(definitionSrc: String, actualSrc: String): Set[String] = { // we drop temp src file corresponding to the definition src file val (Seq(_, tempSrcFile), analysisCallback) = compileSrcs(definitionSrc, actualSrc) - analysisCallback.usedNames(tempSrcFile).toSet + analysisCallback.usedNames(tempSrcFile) } /** diff --git a/ivy/src/main/scala/sbt/IvyRetrieve.scala b/ivy/src/main/scala/sbt/IvyRetrieve.scala index f453efb1f..14ad917fa 100644 --- a/ivy/src/main/scala/sbt/IvyRetrieve.scala +++ b/ivy/src/main/scala/sbt/IvyRetrieve.scala @@ -74,7 +74,7 @@ object IvyRetrieve { }: _*) def toCaller(caller: IvyCaller): Caller = { val m = toModuleID(caller.getModuleRevisionId) - val callerConfigurations = caller.getCallerConfigurations.toArray.toVector collect { + val callerConfigurations = caller.getCallerConfigurations.toVector collect { case x if nonEmptyString(x).isDefined => x } val ddOpt = Option(caller.getDependencyDescriptor) @@ -128,16 +128,16 @@ object IvyRetrieve { case _ => dep.getResolvedId.getExtraAttributes }) val isDefault = Option(dep.getDescriptor) map { _.isDefault } - val configurations = dep.getConfigurations(confReport.getConfiguration).toArray.toList + val configurations = dep.getConfigurations(confReport.getConfiguration).toList val licenses: Seq[(String, Option[String])] = mdOpt match { - case Some(md) => md.getLicenses.toArray.toVector collect { + case Some(md) => md.getLicenses.toVector collect { case lic: IvyLicense if Option(lic.getName).isDefined => val temporaryURL = "http://localhost" (lic.getName, nonEmptyString(lic.getUrl) orElse { Some(temporaryURL) }) } case _ => Nil } - val callers = dep.getCallers(confReport.getConfiguration).toArray.toVector map { toCaller } + val callers = dep.getCallers(confReport.getConfiguration).toVector map { toCaller } val (resolved, missing) = artifacts(moduleId, confReport getDownloadReports revId) new ModuleReport(moduleId, resolved, missing, status, publicationDate, resolver, artifactResolver, diff --git a/ivy/src/main/scala/sbt/ivyint/CachedResolutionResolveEngine.scala b/ivy/src/main/scala/sbt/ivyint/CachedResolutionResolveEngine.scala index 5052a46ef..049130132 100644 --- a/ivy/src/main/scala/sbt/ivyint/CachedResolutionResolveEngine.scala +++ b/ivy/src/main/scala/sbt/ivyint/CachedResolutionResolveEngine.scala @@ -57,7 +57,7 @@ private[sbt] class CachedResolutionResolveCache() { { log.debug(s":: building artificial module descriptors from ${md0.getModuleRevisionId}") // val expanded = expandInternalDependencies(md0, data, prOpt, log) - val rootModuleConfigs = md0.getConfigurations.toArray.toVector + val rootModuleConfigs = md0.getConfigurations.toVector directDependencies(md0) map { dd => val arts = dd.getAllDependencyArtifacts.toVector map { x => s"""${x.getName}:${x.getType}:${x.getExt}:${x.getExtraAttributes}""" } log.debug(s"::: dd: $dd (artifacts: ${arts.mkString(",")})") @@ -599,7 +599,7 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine { case None => Vector() } // These are the configurations from the original project we want to resolve. - val rootModuleConfs = md0.getConfigurations.toArray.toVector + val rootModuleConfs = md0.getConfigurations.toVector val configurations0 = ur.configurations.toVector // This is how md looks from md0 via dd's mapping. val remappedConfigs0: Map[String, Vector[String]] = Map(rootModuleConfs map { conf0 => diff --git a/ivy/src/main/scala/sbt/ivyint/MergeDescriptors.scala b/ivy/src/main/scala/sbt/ivyint/MergeDescriptors.scala index 4e2cb1fc2..76bb4d2af 100644 --- a/ivy/src/main/scala/sbt/ivyint/MergeDescriptors.scala +++ b/ivy/src/main/scala/sbt/ivyint/MergeDescriptors.scala @@ -109,7 +109,7 @@ private final class MergedDescriptors(a: DependencyDescriptor, b: DependencyDesc private[this] def addConfigurations(dd: DefaultDependencyArtifactDescriptor, confs: Seq[String]): Unit = confs foreach dd.addConfiguration - private[this] def concat[T: reflect.ClassTag](a: Array[T], b: Array[T]): Array[T] = (a ++ b).distinct.toArray + private[this] def concat[T: reflect.ClassTag](a: Array[T], b: Array[T]): Array[T] = (a ++ b).distinct def getAllExcludeRules = concat(a.getAllExcludeRules, b.getAllExcludeRules) diff --git a/main/actions/src/main/scala/sbt/Package.scala b/main/actions/src/main/scala/sbt/Package.scala index 67a32fc82..df9af955d 100644 --- a/main/actions/src/main/scala/sbt/Package.scala +++ b/main/actions/src/main/scala/sbt/Package.scala @@ -68,7 +68,7 @@ object Package { } val map = conf.sources.toMap - val inputs = map :+: lastModified(map.keySet.toSet) :+: manifest :+: HNil + val inputs = map :+: lastModified(map.keySet) :+: manifest :+: HNil cachedMakeJar(inputs)(() => exists(conf.jar)) } def setVersion(main: Attributes) { diff --git a/main/src/main/scala/sbt/Defaults.scala b/main/src/main/scala/sbt/Defaults.scala index 47567034d..311d87a28 100755 --- a/main/src/main/scala/sbt/Defaults.scala +++ b/main/src/main/scala/sbt/Defaults.scala @@ -635,12 +635,12 @@ object Defaults extends BuildCommon { // drop base directories, since there are no valid mappings for these def sourceMappings = (unmanagedSources, unmanagedSourceDirectories, baseDirectory) map { (srcs, sdirs, base) => - ((srcs --- sdirs --- base) pair (relativeTo(sdirs) | relativeTo(base) | flat)) toSeq + (srcs --- sdirs --- base) pair (relativeTo(sdirs) | relativeTo(base) | flat) } def resourceMappings = relativeMappings(unmanagedResources, unmanagedResourceDirectories) def relativeMappings(files: ScopedTaskable[Seq[File]], dirs: ScopedTaskable[Seq[File]]): Initialize[Task[Seq[(File, String)]]] = (files, dirs) map { (rs, rdirs) => - (rs --- rdirs) pair (relativeTo(rdirs) | flat) toSeq + (rs --- rdirs) pair (relativeTo(rdirs) | flat) } def collectFiles(dirs: ScopedTaskable[Seq[File]], filter: ScopedTaskable[FileFilter], excludes: ScopedTaskable[FileFilter]): Initialize[Task[Seq[File]]] = diff --git a/main/src/main/scala/sbt/Load.scala b/main/src/main/scala/sbt/Load.scala index 6c2d914c6..6d12523cd 100755 --- a/main/src/main/scala/sbt/Load.scala +++ b/main/src/main/scala/sbt/Load.scala @@ -174,7 +174,7 @@ object Load { val keys = Index.allKeys(settings) val attributeKeys = Index.attributeKeys(data) ++ keys.map(_.key) val scopedKeys = keys ++ data.allKeys((s, k) => ScopedKey(s, k)) - val projectsMap = projects.mapValues(_.defined.keySet).toMap + val projectsMap = projects.mapValues(_.defined.keySet) val keyIndex = KeyIndex(scopedKeys, projectsMap) val aggIndex = KeyIndex.aggregate(scopedKeys, extra(keyIndex), projectsMap) new sbt.StructureIndex(Index.stringToKeyMap(attributeKeys), Index.taskToKeyMap(data), Index.triggers(data), keyIndex, aggIndex) @@ -358,7 +358,7 @@ object Load { builds map { case (uri, unit) => (uri, unit.resolveRefs(ref => Scope.resolveProjectRef(uri, rootProject, ref))) - } toMap; + } } def checkAll(referenced: Map[URI, List[ProjectReference]], builds: Map[URI, sbt.PartBuildUnit]) { val rootProject = getRootProject(builds) @@ -396,7 +396,7 @@ object Load { { IO.assertAbsolute(uri) val resolve = (_: Project).resolve(ref => Scope.resolveProjectRef(uri, rootProject, ref)) - new sbt.LoadedBuildUnit(unit.unit, unit.defined mapValues resolve toMap, unit.rootProjects, unit.buildSettings) + new sbt.LoadedBuildUnit(unit.unit, unit.defined mapValues resolve, unit.rootProjects, unit.buildSettings) } def projects(unit: sbt.BuildUnit): Seq[Project] = { diff --git a/main/src/main/scala/sbt/Project.scala b/main/src/main/scala/sbt/Project.scala index c2d2bf39d..dba3c0f45 100755 --- a/main/src/main/scala/sbt/Project.scala +++ b/main/src/main/scala/sbt/Project.scala @@ -510,7 +510,7 @@ object Project extends ProjectExtra { val ProjectReturn = AttributeKey[List[File]]("project-return", "Maintains a stack of builds visited using reload.") def projectReturn(s: State): List[File] = getOrNil(s, ProjectReturn) - def inPluginProject(s: State): Boolean = projectReturn(s).toList.length > 1 + def inPluginProject(s: State): Boolean = projectReturn(s).length > 1 def setProjectReturn(s: State, pr: List[File]): State = s.copy(attributes = s.attributes.put(ProjectReturn, pr)) def loadAction(s: State, action: LoadAction.Value) = action match { case Return => diff --git a/scripted/plugin/src/main/scala/sbt/ScriptedPlugin.scala b/scripted/plugin/src/main/scala/sbt/ScriptedPlugin.scala index 4195846fd..5d7a776e7 100644 --- a/scripted/plugin/src/main/scala/sbt/ScriptedPlugin.scala +++ b/scripted/plugin/src/main/scala/sbt/ScriptedPlugin.scala @@ -48,7 +48,7 @@ object ScriptedPlugin extends Plugin { val pairMap = pairs.groupBy(_._1).mapValues(_.map(_._2).toSet) val id = charClass(c => !c.isWhitespace && c != '/').+.string - val groupP = token(id.examples(pairMap.keySet.toSet)) <~ token('/') + val groupP = token(id.examples(pairMap.keySet)) <~ token('/') def nameP(group: String) = token("*".id | id.examples(pairMap(group))) val testID = for (group <- groupP; name <- nameP(group)) yield (group, name) (token(Space) ~> matched(testID)).* diff --git a/util/collection/src/main/scala/sbt/PMap.scala b/util/collection/src/main/scala/sbt/PMap.scala index 51c942112..cf0454fd9 100644 --- a/util/collection/src/main/scala/sbt/PMap.scala +++ b/util/collection/src/main/scala/sbt/PMap.scala @@ -52,7 +52,7 @@ object IMap { put(k, f(this get k getOrElse init)) def mapValues[V2[_]](f: V ~> V2) = - new IMap0[K, V2](backing.mapValues(x => f(x)).toMap) + new IMap0[K, V2](backing.mapValues(x => f(x))) def mapSeparate[VL[_], VR[_]](f: V ~> ({ type l[T] = Either[VL[T], VR[T]] })#l) = { diff --git a/util/collection/src/main/scala/sbt/Settings.scala b/util/collection/src/main/scala/sbt/Settings.scala index 0196b0a09..03173d6ce 100644 --- a/util/collection/src/main/scala/sbt/Settings.scala +++ b/util/collection/src/main/scala/sbt/Settings.scala @@ -17,9 +17,9 @@ sealed trait Settings[Scope] { } private final class Settings0[Scope](val data: Map[Scope, AttributeMap], val delegates: Scope => Seq[Scope]) extends Settings[Scope] { - def scopes: Set[Scope] = data.keySet.toSet + def scopes: Set[Scope] = data.keySet def keys(scope: Scope) = data(scope).keys.toSet - def allKeys[T](f: (Scope, AttributeKey[_]) => T): Seq[T] = data.flatMap { case (scope, map) => map.keys.map(k => f(scope, k)) } toSeq; + def allKeys[T](f: (Scope, AttributeKey[_]) => T): Seq[T] = data.flatMap { case (scope, map) => map.keys.map(k => f(scope, k)) } toSeq def get[T](scope: Scope, key: AttributeKey[T]): Option[T] = delegates(scope).toStream.flatMap(sc => getDirect(sc, key)).headOption