From 2ea12c31f8cba7d39679d86422ebbdc8586ea29f Mon Sep 17 00:00:00 2001 From: liontiger23 Date: Fri, 17 Feb 2023 17:27:21 +0700 Subject: [PATCH] Cleanup warnings Prepare to build against scala 2.13.10 --- src/main/scala/scala/tools/ant/Scalac.scala | 12 ++++++------ .../scala/scala/tools/ant/sabbus/Compilers.scala | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/scala/scala/tools/ant/Scalac.scala b/src/main/scala/scala/tools/ant/Scalac.scala index 5fe3e3c..a925a67 100644 --- a/src/main/scala/scala/tools/ant/Scalac.scala +++ b/src/main/scala/scala/tools/ant/Scalac.scala @@ -212,7 +212,7 @@ class Scalac extends ScalaMatchingTask with ScalacShared { /** Sets the `origin` as a nested src Ant parameter. * @return An origin path to be configured. */ - def createSrc(): Path = createNewPath(origin _, p => origin = p) + def createSrc(): Path = createNewPath(() => origin, p => origin = p) /** Sets the `origin` as an external reference Ant parameter. * @param input A reference to an origin path. */ @@ -234,7 +234,7 @@ class Scalac extends ScalaMatchingTask with ScalacShared { compilerPath = setOrAppend(compilerPath, input) } - def createCompilerPath: Path = createNewPath(compilerPath _, p => compilerPath = p) + def createCompilerPath: Path = createNewPath(() => compilerPath, p => compilerPath = p) /** Sets the `compilerpathref` attribute. Used by [[http://ant.apache.org Ant]]. * @param input The value of `compilerpathref`. */ @@ -244,7 +244,7 @@ class Scalac extends ScalaMatchingTask with ScalacShared { /** Sets the `classpath` as a nested classpath Ant parameter. * @return A class path to be configured. */ - def createClasspath(): Path = createNewPath(classpath _, p => classpath = p) + def createClasspath(): Path = createNewPath(() => classpath, p => classpath = p) /** Sets the `classpath` as an external reference Ant parameter. * @param input A reference to a class path. */ @@ -260,7 +260,7 @@ class Scalac extends ScalaMatchingTask with ScalacShared { /** Sets the `sourcepath` as a nested sourcepath Ant parameter. * @return A source path to be configured. */ - def createSourcepath(): Path = createNewPath(sourcepath _, p => sourcepath = p) + def createSourcepath(): Path = createNewPath(() => sourcepath, p => sourcepath = p) /** Sets the `sourcepath` as an external reference Ant parameter. * @param input A reference to a source path. */ @@ -277,7 +277,7 @@ class Scalac extends ScalaMatchingTask with ScalacShared { /** Sets the `bootclasspath` as a nested bootclasspath Ant parameter. * @return A source path to be configured. */ - def createBootclasspath(): Path = createNewPath(bootclasspath _, p => bootclasspath = p) + def createBootclasspath(): Path = createNewPath(() => bootclasspath, p => bootclasspath = p) /** Sets the `bootclasspath` as an external reference Ant * parameter. @@ -293,7 +293,7 @@ class Scalac extends ScalaMatchingTask with ScalacShared { /** Sets the `extdirs` as a nested extdirs Ant parameter. * @return An extensions path to be configured. */ - def createExtdirs(): Path = createNewPath(extdirs _, p => extdirs = p) + def createExtdirs(): Path = createNewPath(() => extdirs, p => extdirs = p) /** Sets the `extdirs` as an external reference Ant parameter. * @param input A reference to an extensions path. */ diff --git a/src/main/scala/scala/tools/ant/sabbus/Compilers.scala b/src/main/scala/scala/tools/ant/sabbus/Compilers.scala index 57a5b5a..34d223e 100644 --- a/src/main/scala/scala/tools/ant/sabbus/Compilers.scala +++ b/src/main/scala/scala/tools/ant/sabbus/Compilers.scala @@ -45,7 +45,7 @@ object Compilers extends scala.collection.Map[String, Compiler] { } private def freeMemoryString: String = - (Runtime.getRuntime.freeMemory/1048576.0).formatted("%10.2f") + " MB" + "%10.2f MB".format(Runtime.getRuntime.freeMemory/1048576.0) def -(key1: String, key2: String, keys: String*): scala.collection.Map[String,scala.tools.ant.sabbus.Compiler] = ???