diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index 6158c83c4958..97649426c007 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -6,6 +6,7 @@ import Settings._ import core.Contexts._ import util.DotClass import Properties._ +import scala.collection.JavaConverters._ object CompilerCommand extends DotClass { @@ -43,10 +44,9 @@ object CompilerCommand extends DotClass { if (!Files.exists(path)) throw new java.io.FileNotFoundException("argument file %s could not be found" format path.getFileName) - import scala.collection.JavaConversions._ val lines = Files.readAllLines(path) // default to UTF-8 encoding - val params = lines map stripComment mkString " " + val params = lines.asScala map stripComment mkString " " CommandLineParser.tokenize(params) } diff --git a/compiler/src/dotty/tools/dotc/parsing/MarkupParsers.scala b/compiler/src/dotty/tools/dotc/parsing/MarkupParsers.scala index 706d38420ea3..882449412850 100644 --- a/compiler/src/dotty/tools/dotc/parsing/MarkupParsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/MarkupParsers.scala @@ -85,9 +85,9 @@ object MarkupParsers { var xEmbeddedBlock = false - private var debugLastStartElement = new mutable.Stack[(Int, String)] - private def debugLastPos = debugLastStartElement.top._1 - private def debugLastElem = debugLastStartElement.top._2 + private var debugLastStartElement = List.empty[(Int, String)] + private def debugLastPos = debugLastStartElement.head._1 + private def debugLastElem = debugLastStartElement.head._2 private def errorBraces() = { reportSyntaxError("in XML content, please use '}}' to express '}'") @@ -280,10 +280,10 @@ object MarkupParsers { if (qname == "xml:unparsed") return xUnparsed - debugLastStartElement.push((start, qname)) + debugLastStartElement = (start, qname) :: debugLastStartElement val ts = content xEndTag(qname) - debugLastStartElement.pop() + debugLastStartElement = debugLastStartElement.tail val pos = Position(start, curOffset, start) qname match { case "xml:group" => handle.group(pos, ts) @@ -417,7 +417,7 @@ object MarkupParsers { def xPattern: Tree = { var start = curOffset val qname = xName - debugLastStartElement.push((start, qname)) + debugLastStartElement = (start, qname) :: debugLastStartElement xSpaceOpt() val ts = new ArrayBuffer[Tree] @@ -457,7 +457,7 @@ object MarkupParsers { while (doPattern) { } // call until false xEndTag(qname) - debugLastStartElement.pop() + debugLastStartElement = debugLastStartElement.tail } handle.makeXMLpat(Position(start, curOffset, start), qname, ts) diff --git a/compiler/test/dotty/tools/vulpix/SummaryReport.scala b/compiler/test/dotty/tools/vulpix/SummaryReport.scala index fed36d275d5c..ee323782f29a 100644 --- a/compiler/test/dotty/tools/vulpix/SummaryReport.scala +++ b/compiler/test/dotty/tools/vulpix/SummaryReport.scala @@ -59,7 +59,7 @@ final class NoSummaryReport extends SummaryReporting { * which outputs to a log file in `./testlogs/` */ final class SummaryReport extends SummaryReporting { - import scala.collection.JavaConversions._ + import scala.collection.JavaConverters._ private val startingMessages = new java.util.concurrent.ConcurrentLinkedDeque[String] private val failedTests = new java.util.concurrent.ConcurrentLinkedDeque[String] @@ -102,9 +102,9 @@ final class SummaryReport extends SummaryReporting { |""".stripMargin ) - startingMessages.foreach(rep.append) + startingMessages.asScala.foreach(rep.append) - failedTests.map(x => s" $x\n").foreach(rep.append) + failedTests.asScala.map(x => s" $x\n").foreach(rep.append) // If we're compiling locally, we don't need instructions on how to // reproduce failures @@ -121,7 +121,7 @@ final class SummaryReport extends SummaryReporting { rep += '\n' - reproduceInstructions.foreach(rep.append) + reproduceInstructions.asScala.foreach(rep.append) // If we're on the CI, we want everything if (!isInteractive) println(rep.toString) @@ -129,7 +129,7 @@ final class SummaryReport extends SummaryReporting { TestReporter.logPrintln(rep.toString) // Perform cleanup callback: - if (cleanUps.nonEmpty) cleanUps.foreach(_.apply()) + if (!cleanUps.isEmpty()) cleanUps.asScala.foreach(_.apply()) } private def removeColors(msg: String): String =