From b7e13c2338825ea3d7840c403eb93a8960058942 Mon Sep 17 00:00:00 2001 From: Philipp Haller Date: Wed, 28 May 2008 13:23:54 +0000 Subject: Removed vararg warnings in partest --- src/partest/scala/tools/partest/PartestTask.scala | 14 +++++++------- src/partest/scala/tools/partest/nest/CompileManager.scala | 8 ++++---- .../scala/tools/partest/nest/ConsoleFileManager.scala | 1 + .../scala/tools/partest/nest/ReflectiveRunner.scala | 4 ++-- 4 files changed, 14 insertions(+), 13 deletions(-) (limited to 'src/partest') diff --git a/src/partest/scala/tools/partest/PartestTask.scala b/src/partest/scala/tools/partest/PartestTask.scala index 92e9d8e185..67c1ab8f98 100644 --- a/src/partest/scala/tools/partest/PartestTask.scala +++ b/src/partest/scala/tools/partest/PartestTask.scala @@ -128,26 +128,26 @@ class PartestTask extends Task { val antRunner: AnyRef = classloader.loadClass("scala.tools.partest.nest.AntRunner").newInstance().asInstanceOf[AnyRef] val antFileManager: AnyRef = - antRunner.getClass.getMethod("fileManager", Array[Class[_]]()).invoke(antRunner, Array[Object]()) + antRunner.getClass.getMethod("fileManager", Array[Class[_]](): _*).invoke(antRunner, Array[Object](): _*) val runMethod = - antRunner.getClass.getMethod("reflectiveRunTestsForFiles", Array(classOf[Array[File]], classOf[String])) + antRunner.getClass.getMethod("reflectiveRunTestsForFiles", Array(classOf[Array[File]], classOf[String]): _*) def runTestsForFiles(kindFiles: Array[File], kind: String): (Int, Int) = { - val result = runMethod.invoke(antRunner, Array(kindFiles, kind)).asInstanceOf[Int] + val result = runMethod.invoke(antRunner, Array(kindFiles, kind): _*).asInstanceOf[Int] (result >> 16, result & 0x00FF) } def setFileManagerBooleanProperty(name: String, value: Boolean) = { val setMethod = - antFileManager.getClass.getMethod(name+"_$eq", Array(classOf[Boolean])) - setMethod.invoke(antFileManager, Array(java.lang.Boolean.valueOf(value))) + antFileManager.getClass.getMethod(name+"_$eq", Array(classOf[Boolean]): _*) + setMethod.invoke(antFileManager, Array(java.lang.Boolean.valueOf(value)): _*) } def setFileManagerStringProperty(name: String, value: String) = { val setMethod = - antFileManager.getClass.getMethod(name+"_$eq", Array(classOf[String])) - setMethod.invoke(antFileManager, Array(value)) + antFileManager.getClass.getMethod(name+"_$eq", Array(classOf[String]): _*) + setMethod.invoke(antFileManager, Array(value): _*) } setFileManagerBooleanProperty("showDiff", showDiff) diff --git a/src/partest/scala/tools/partest/nest/CompileManager.scala b/src/partest/scala/tools/partest/nest/CompileManager.scala index 50999dd651..647b8144e8 100644 --- a/src/partest/scala/tools/partest/nest/CompileManager.scala +++ b/src/partest/scala/tools/partest/nest/CompileManager.scala @@ -130,9 +130,9 @@ class ReflectiveCompiler(val fileManager: ConsoleFileManager) extends SimpleComp val fileClass = Class.forName("java.io.File") val stringClass = Class.forName("java.lang.String") val sepCompileMethod = - sepCompilerClass.getMethod("compile", Array(fileClass, stringClass)) + sepCompilerClass.getMethod("compile", Array(fileClass, stringClass): _*) val sepCompileMethod2 = - sepCompilerClass.getMethod("compile", Array(fileClass, stringClass, fileClass)) + sepCompilerClass.getMethod("compile", Array(fileClass, stringClass, fileClass): _*) /* This method throws java.lang.reflect.InvocationTargetException * if the compiler crashes. @@ -141,7 +141,7 @@ class ReflectiveCompiler(val fileManager: ConsoleFileManager) extends SimpleComp */ def compile(file: File, kind: String): Boolean = { val fileArgs: Array[AnyRef] = Array(file, kind) - val res = sepCompileMethod.invoke(sepCompiler, fileArgs).asInstanceOf[java.lang.Boolean] + val res = sepCompileMethod.invoke(sepCompiler, fileArgs: _*).asInstanceOf[java.lang.Boolean] res.booleanValue() } @@ -152,7 +152,7 @@ class ReflectiveCompiler(val fileManager: ConsoleFileManager) extends SimpleComp */ def compile(file: File, kind: String, log: File): Boolean = { val fileArgs: Array[AnyRef] = Array(file, kind, log) - val res = sepCompileMethod2.invoke(sepCompiler, fileArgs).asInstanceOf[java.lang.Boolean] + val res = sepCompileMethod2.invoke(sepCompiler, fileArgs: _*).asInstanceOf[java.lang.Boolean] res.booleanValue() } } diff --git a/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala b/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala index 4ac3e365f5..ba8bc97915 100644 --- a/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala +++ b/src/partest/scala/tools/partest/nest/ConsoleFileManager.scala @@ -85,6 +85,7 @@ else def accept(dir: File, name: String) = name endsWith ".jar" }) map {file => file.getCanonicalFile.getAbsolutePath}).mkString(""+File.pathSeparator) } + println(CLASSPATH) def findLatest() { val testParent = testRootFile.getParentFile diff --git a/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala b/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala index 2870d79418..982449471e 100644 --- a/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala +++ b/src/partest/scala/tools/partest/nest/ReflectiveRunner.scala @@ -49,9 +49,9 @@ class ReflectiveRunner { val stringClass = Class.forName("java.lang.String") val sepMainMethod = - sepRunnerClass.getMethod("main", Array(stringClass)) + sepRunnerClass.getMethod("main", Array(stringClass): _*) val cargs: Array[AnyRef] = Array(args) - sepMainMethod.invoke(sepRunner, cargs) + sepMainMethod.invoke(sepRunner, cargs: _*) } } -- cgit v1.2.3