From 8a89b68903d77b44471fa216561488efbf16bed7 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 15 Dec 2009 00:07:59 +0000 Subject: Another round of deprecation warning elimination. --- src/compiler/scala/tools/ant/Same.scala | 2 +- src/compiler/scala/tools/ant/ScalaBazaar.scala | 2 +- src/compiler/scala/tools/ant/Scalac.scala | 2 +- src/compiler/scala/tools/ant/Scaladoc.scala | 2 +- src/compiler/scala/tools/ant/sabbus/Make.scala | 2 +- src/compiler/scala/tools/nsc/Interpreter.scala | 2 +- src/compiler/scala/tools/nsc/MainGenericRunner.scala | 2 +- src/compiler/scala/tools/nsc/ScriptRunner.scala | 2 +- src/compiler/scala/tools/nsc/Settings.scala | 20 ++++++++++---------- .../scala/tools/nsc/matching/ParallelMatching.scala | 5 ++--- .../scala/tools/nsc/typechecker/Typers.scala | 2 +- .../scala/tools/partest/nest/CompileManager.scala | 2 +- .../scala/tools/partest/nest/ReflectiveRunner.scala | 2 +- src/partest/scala/tools/partest/nest/Worker.scala | 16 ++++++++-------- src/swing/scala/swing/Window.scala | 4 ++-- src/swing/scala/swing/event/ComponentEvent.scala | 10 +++++----- src/swing/scala/swing/test/LinePainting.scala | 2 +- 17 files changed, 39 insertions(+), 40 deletions(-) diff --git a/src/compiler/scala/tools/ant/Same.scala b/src/compiler/scala/tools/ant/Same.scala index 97bfc6947a..d5cba4a0bf 100644 --- a/src/compiler/scala/tools/ant/Same.scala +++ b/src/compiler/scala/tools/ant/Same.scala @@ -37,7 +37,7 @@ import org.apache.tools.ant.types.Mapper class Same extends MatchingTask { /** The unique Ant file utilities instance to use in this task. */ - private val fileUtils = FileUtils.newFileUtils() + private val fileUtils = FileUtils.getFileUtils() /*============================================================================*\ ** Ant user-properties ** diff --git a/src/compiler/scala/tools/ant/ScalaBazaar.scala b/src/compiler/scala/tools/ant/ScalaBazaar.scala index ae45a81186..30fd8947f5 100644 --- a/src/compiler/scala/tools/ant/ScalaBazaar.scala +++ b/src/compiler/scala/tools/ant/ScalaBazaar.scala @@ -56,7 +56,7 @@ package scala.tools.ant { class ScalaBazaar extends Task { /** The unique Ant file utilities instance to use in this task. */ - private val fileUtils = FileUtils.newFileUtils() + private val fileUtils = FileUtils.getFileUtils() /******************************************************************************\ ** Ant user-properties ** diff --git a/src/compiler/scala/tools/ant/Scalac.scala b/src/compiler/scala/tools/ant/Scalac.scala index bb5dc77050..8bd5444ee3 100644 --- a/src/compiler/scala/tools/ant/Scalac.scala +++ b/src/compiler/scala/tools/ant/Scalac.scala @@ -72,7 +72,7 @@ import scala.tools.nsc.reporters.{Reporter, ConsoleReporter} class Scalac extends MatchingTask { /** The unique Ant file utilities instance to use in this task. */ - private val fileUtils = FileUtils.newFileUtils() + private val fileUtils = FileUtils.getFileUtils() /*============================================================================*\ ** Ant user-properties ** diff --git a/src/compiler/scala/tools/ant/Scaladoc.scala b/src/compiler/scala/tools/ant/Scaladoc.scala index f7e44b6b88..4d8333ae93 100644 --- a/src/compiler/scala/tools/ant/Scaladoc.scala +++ b/src/compiler/scala/tools/ant/Scaladoc.scala @@ -65,7 +65,7 @@ import scala.tools.nsc.reporters.{Reporter, ConsoleReporter} class Scaladoc extends MatchingTask { /** The unique Ant file utilities instance to use in this task. */ - private val fileUtils = FileUtils.newFileUtils() + private val fileUtils = FileUtils.getFileUtils() /*============================================================================*\ ** Ant user-properties ** diff --git a/src/compiler/scala/tools/ant/sabbus/Make.scala b/src/compiler/scala/tools/ant/sabbus/Make.scala index ddae0a1ecc..d1579670ac 100644 --- a/src/compiler/scala/tools/ant/sabbus/Make.scala +++ b/src/compiler/scala/tools/ant/sabbus/Make.scala @@ -23,6 +23,6 @@ class Make extends Task with TaskArgs { if (!compilationPath.isEmpty) settings.classpath = compilationPath.get if (!sourcePath.isEmpty) settings.sourcepath = sourcePath.get if (!params.isEmpty) settings.more = params.get - Compilers.make(id.get, (compilerPath.get.list.map{ path => new File(path).toURL }), settings) + Compilers.make(id.get, (compilerPath.get.list.map{ path => new File(path).toURI.toURL }), settings) } } diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala index 1b890d91ad..a8152dce02 100644 --- a/src/compiler/scala/tools/nsc/Interpreter.scala +++ b/src/compiler/scala/tools/nsc/Interpreter.scala @@ -125,7 +125,7 @@ class Interpreter(val settings: Settings, out: PrintWriter) catching(classOf[MalformedURLException]) opt new URL(s) val classpathPart = - ClassPath.expandPath(compiler.settings.classpath.value).map(s => new File(s).toURL) + ClassPath.expandPath(compiler.settings.classpath.value).map(s => new File(s).toURI.toURL) val codebasePart = (compiler.settings.Xcodebase.value.split(" ")).toList flatMap parseURL diff --git a/src/compiler/scala/tools/nsc/MainGenericRunner.scala b/src/compiler/scala/tools/nsc/MainGenericRunner.scala index d9dfee4e4a..cd16ef8c8b 100644 --- a/src/compiler/scala/tools/nsc/MainGenericRunner.scala +++ b/src/compiler/scala/tools/nsc/MainGenericRunner.scala @@ -80,7 +80,7 @@ object MainGenericRunner { if (b) exitSuccess else exitFailure(null) def fileToURL(f: File): Option[URL] = - try { Some(f.toURL) } + try { Some(f.toURI.toURL) } catch { case e => Console.println(e); None } def paths(str: String): List[URL] = diff --git a/src/compiler/scala/tools/nsc/ScriptRunner.scala b/src/compiler/scala/tools/nsc/ScriptRunner.scala index cca9be181a..3423f8f45f 100644 --- a/src/compiler/scala/tools/nsc/ScriptRunner.scala +++ b/src/compiler/scala/tools/nsc/ScriptRunner.scala @@ -308,7 +308,7 @@ object ScriptRunner scriptArgs: List[String]): Boolean = { def fileToURL(f: JFile): Option[URL] = - try Some(f.toURL) catch { case _: Exception => None } + try Some(f.toURI.toURL) catch { case _: Exception => None } def paths(str: String, expandStar: Boolean): List[URL] = for { diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala index 069fcf898e..23ceb37c95 100644 --- a/src/compiler/scala/tools/nsc/Settings.scala +++ b/src/compiler/scala/tools/nsc/Settings.scala @@ -272,20 +272,20 @@ class Settings(errorFn: String => Unit) extends ScalacSettings { /** * The canonical creators for Setting objects. */ - import Function.{ tupled, untupled } + import Function.{ untupled } import Setting._ // A bit too clever, but I haven't found any other way to compose // functions with arity 2+ without having to annotate parameter types - lazy val IntSetting = untupled(tupled(sint _) andThen add[IntSetting]) - lazy val BooleanSetting = untupled(tupled(bool _) andThen add[BooleanSetting]) - lazy val StringSetting = untupled(tupled(str _) andThen add[StringSetting]) - lazy val MultiStringSetting = untupled(tupled(multi _) andThen add[MultiStringSetting]) - lazy val ChoiceSetting = untupled(tupled(choice _) andThen add[ChoiceSetting]) - lazy val DebugSetting = untupled(tupled(sdebug _) andThen add[DebugSetting]) - lazy val PhasesSetting = untupled(tupled(phase _) andThen add[PhasesSetting]) + lazy val IntSetting = untupled((sint _).tuple andThen add[IntSetting]) + lazy val BooleanSetting = untupled((bool _).tuple andThen add[BooleanSetting]) + lazy val StringSetting = untupled((str _).tuple andThen add[StringSetting]) + lazy val MultiStringSetting = untupled((multi _).tuple andThen add[MultiStringSetting]) + lazy val ChoiceSetting = untupled((choice _).tuple andThen add[ChoiceSetting]) + lazy val DebugSetting = untupled((sdebug _).tuple andThen add[DebugSetting]) + lazy val PhasesSetting = untupled((phase _).tuple andThen add[PhasesSetting]) lazy val DefinesSetting = add(defines()) - lazy val OutputSetting = untupled(tupled(output _) andThen add[OutputSetting]) + lazy val OutputSetting = untupled((output _).tuple andThen add[OutputSetting]) override def toString() = "Settings(\n%s)" format (settingSet filter (s => !s.isDefault) map (" " + _ + "\n") mkString) @@ -364,7 +364,7 @@ object Settings { singleOutDir match { case Some(d) => d case None => - (outputs find Function.tupled(isBelow)) match { + (outputs find (isBelow _).tuple) match { case Some((_, d)) => d case _ => throw new FatalError("Could not find an output directory for " diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala index 90d0e2da61..fd4b57ef67 100644 --- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala +++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala @@ -15,7 +15,6 @@ import collection._ import mutable.ListBuffer import immutable.IntMap import annotation.elidable -import Function.tupled trait ParallelMatching extends ast.TreeDSL with MatchSupport @@ -583,7 +582,7 @@ trait ParallelMatching extends ast.TreeDSL } lazy val failure = - mkFail(remaining map tupled((p1, p2) => rest rows p1 insert p2)) + mkFail(remaining map { case (p1, p2) => rest rows p1 insert p2 }) final def tree(): Tree = codegen } @@ -620,7 +619,7 @@ trait ParallelMatching extends ast.TreeDSL def isNotAlternative(p: Pattern) = !cond(p.tree) { case _: Alternative => true } // classify all the top level patterns - alternatives come back unaltered - val newPats: List[Pattern] = pats.zipWithIndex map tupled(classifyPat) + val newPats: List[Pattern] = pats.zipWithIndex map classifyPat.tuple // see if any alternatives were in there val (ps, others) = newPats span isNotAlternative // make a new row for each alternative, with it spliced into the original position diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 1e021fe107..1c746d0ab9 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1744,7 +1744,7 @@ trait Typers { self: Analyzer => useCase.aliases = context.scope.toList namer.enterSyms(trees) typedStats(trees, NoSymbol) - useCase.defined = context.scope.toList -- useCase.aliases + useCase.defined = context.scope.toList filterNot (useCase.aliases contains _) // println("defined use cases: "+(useCase.defined map (sym => sym+":"+sym.tpe))) } diff --git a/src/partest/scala/tools/partest/nest/CompileManager.scala b/src/partest/scala/tools/partest/nest/CompileManager.scala index a85d04d9bd..b67653d900 100644 --- a/src/partest/scala/tools/partest/nest/CompileManager.scala +++ b/src/partest/scala/tools/partest/nest/CompileManager.scala @@ -145,7 +145,7 @@ class DirectCompiler(val fileManager: FileManager) extends SimpleCompiler { class ReflectiveCompiler(val fileManager: ConsoleFileManager) extends SimpleCompiler { import fileManager.{latestCompFile, latestPartestFile} - val sepUrls = Array(latestCompFile.toURL, latestPartestFile.toURL) + val sepUrls = Array(latestCompFile.toURI.toURL, latestPartestFile.toURI.toURL) //NestUI.verbose("constructing URLClassLoader from URLs "+latestCompFile+" and "+latestPartestFile) val sepLoader = new java.net.URLClassLoader(sepUrls, null) diff --git a/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala b/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala index c0612531ed..bcedaa38be 100644 --- a/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala +++ b/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala @@ -47,7 +47,7 @@ class ReflectiveRunner extends RunnerUtils { val files = Array(latestCompFile, latestLibFile, latestActFile, latestPartestFile, latestFjbgFile) - val sepUrls = files map { _.toURL } + val sepUrls = files map { _.toURI.toURL } val sepLoader = new URLClassLoader(sepUrls, null) if (fileManager.debug) diff --git a/src/partest/scala/tools/partest/nest/Worker.scala b/src/partest/scala/tools/partest/nest/Worker.scala index 7828c24611..37a98860ad 100644 --- a/src/partest/scala/tools/partest/nest/Worker.scala +++ b/src/partest/scala/tools/partest/nest/Worker.scala @@ -122,10 +122,10 @@ class Worker(val fileManager: FileManager) extends Actor { latestPartestFile} val classpath: List[URL] = - outDir.toURL :: - //List(file.getParentFile.toURL) ::: - List(latestCompFile.toURL, latestLibFile.toURL, latestActFile.toURL, latestPartestFile.toURL) ::: - ((CLASSPATH split File.pathSeparatorChar).toList map (x => new File(x).toURL)) + outDir.toURI.toURL :: + //List(file.getParentFile.toURI.toURL) ::: + List(latestCompFile.toURI.toURL, latestLibFile.toURI.toURL, latestActFile.toURI.toURL, latestPartestFile.toURI.toURL) ::: + ((CLASSPATH split File.pathSeparatorChar).toList map (x => new File(x).toURI.toURL)) NestUI.verbose("ObjectRunner classpath: "+classpath) @@ -469,11 +469,11 @@ class Worker(val fileManager: FileManager) extends Actor { NestUI.verbose("compilation of "+file+" succeeded\n") val libs = new File(fileManager.LIB_DIR) - val scalacheckURL = new File(libs, "ScalaCheck.jar") toURL - val outURL = outDir.getCanonicalFile.toURL + val scalacheckURL = (new File(libs, "ScalaCheck.jar")).toURI.toURL + val outURL = outDir.getCanonicalFile.toURI.toURL val classpath: List[URL] = - List(outURL, scalacheckURL, latestCompFile.toURL, latestLibFile.toURL, - latestActFile.toURL, latestPartestFile.toURL).removeDuplicates + List(outURL, scalacheckURL, latestCompFile.toURI.toURL, latestLibFile.toURI.toURL, + latestActFile.toURI.toURL, latestPartestFile.toURI.toURL).removeDuplicates // XXX this is a big cut-and-paste mess, but the revamp is coming val logOut = new FileOutputStream(logFile) diff --git a/src/swing/scala/swing/Window.scala b/src/swing/scala/swing/Window.scala index b888d2bf5e..2fba3acd7a 100644 --- a/src/swing/scala/swing/Window.scala +++ b/src/swing/scala/swing/Window.scala @@ -57,8 +57,8 @@ abstract class Window extends UIElement with RootPanel with Publisher { outer => def owner: Window = UIElement.cachedWrapper(peer.getOwner) - def open() { peer.show() } - def close() { peer.hide() } + def open() { peer setVisible true } + def close() { peer setVisible false } peer.addWindowListener(new java.awt.event.WindowListener { def windowActivated(e: java.awt.event.WindowEvent) { publish(WindowActivated(outer)) } diff --git a/src/swing/scala/swing/event/ComponentEvent.scala b/src/swing/scala/swing/event/ComponentEvent.scala index f230c7d0d9..1f834e8ed2 100644 --- a/src/swing/scala/swing/event/ComponentEvent.scala +++ b/src/swing/scala/swing/event/ComponentEvent.scala @@ -13,14 +13,14 @@ package scala.swing package event trait ComponentEvent extends UIEvent { - override val source: Component + val source: Component } @deprecated("Use UIElementMoved instead.") -case class ComponentMoved(override val source: Component) extends ComponentEvent +case class ComponentMoved(source: Component) extends ComponentEvent @deprecated("Use UIElementResized instead.") -case class ComponentResized(override val source: Component) extends ComponentEvent +case class ComponentResized(source: Component) extends ComponentEvent @deprecated("Use UIElementShown instead.") -case class ComponentShown(override val source: Component) extends ComponentEvent +case class ComponentShown(source: Component) extends ComponentEvent @deprecated("Use UIElementHidden instead.") -case class ComponentHidden(override val source: Component) extends ComponentEvent +case class ComponentHidden(source: Component) extends ComponentEvent diff --git a/src/swing/scala/swing/test/LinePainting.scala b/src/swing/scala/swing/test/LinePainting.scala index 78a94dbab7..7c47647dd4 100644 --- a/src/swing/scala/swing/test/LinePainting.scala +++ b/src/swing/scala/swing/test/LinePainting.scala @@ -13,7 +13,7 @@ import java.awt.{Color, Dimension, Graphics, Graphics2D, Point, geom} object LinePainting extends SimpleSwingApplication { lazy val ui = new Panel { background = Color.white - preferredSize = (200,200) + preferredSize = ((200,200): Dimension) focusable = true listenTo(mouse.clicks, mouse.moves, keys) -- cgit v1.2.3