Skip to content

Commit 81b95a6

Browse files
committed
Fix new warnings in dotty-compiler
1 parent c5c3b8f commit 81b95a6

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

compiler/src/dotty/tools/dotc/config/CompilerCommand.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Settings._
66
import core.Contexts._
77
import util.DotClass
88
import Properties._
9+
import scala.collection.JavaConverters._
910

1011
object CompilerCommand extends DotClass {
1112

@@ -43,10 +44,9 @@ object CompilerCommand extends DotClass {
4344
if (!Files.exists(path))
4445
throw new java.io.FileNotFoundException("argument file %s could not be found" format path.getFileName)
4546

46-
import scala.collection.JavaConversions._
4747
val lines = Files.readAllLines(path) // default to UTF-8 encoding
4848

49-
val params = lines map stripComment mkString " "
49+
val params = lines.asScala map stripComment mkString " "
5050
CommandLineParser.tokenize(params)
5151
}
5252

compiler/src/dotty/tools/dotc/parsing/MarkupParsers.scala

+7-7
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ object MarkupParsers {
8585

8686
var xEmbeddedBlock = false
8787

88-
private var debugLastStartElement = new mutable.Stack[(Int, String)]
89-
private def debugLastPos = debugLastStartElement.top._1
90-
private def debugLastElem = debugLastStartElement.top._2
88+
private var debugLastStartElement = List.empty[(Int, String)]
89+
private def debugLastPos = debugLastStartElement.head._1
90+
private def debugLastElem = debugLastStartElement.head._2
9191

9292
private def errorBraces() = {
9393
reportSyntaxError("in XML content, please use '}}' to express '}'")
@@ -280,10 +280,10 @@ object MarkupParsers {
280280
if (qname == "xml:unparsed")
281281
return xUnparsed
282282

283-
debugLastStartElement.push((start, qname))
283+
debugLastStartElement = (start, qname) :: debugLastStartElement
284284
val ts = content
285285
xEndTag(qname)
286-
debugLastStartElement.pop()
286+
debugLastStartElement = debugLastStartElement.tail
287287
val pos = Position(start, curOffset, start)
288288
qname match {
289289
case "xml:group" => handle.group(pos, ts)
@@ -417,7 +417,7 @@ object MarkupParsers {
417417
def xPattern: Tree = {
418418
var start = curOffset
419419
val qname = xName
420-
debugLastStartElement.push((start, qname))
420+
debugLastStartElement = (start, qname) :: debugLastStartElement
421421
xSpaceOpt()
422422

423423
val ts = new ArrayBuffer[Tree]
@@ -457,7 +457,7 @@ object MarkupParsers {
457457

458458
while (doPattern) { } // call until false
459459
xEndTag(qname)
460-
debugLastStartElement.pop()
460+
debugLastStartElement = debugLastStartElement.tail
461461
}
462462

463463
handle.makeXMLpat(Position(start, curOffset, start), qname, ts)

compiler/test/dotty/tools/vulpix/SummaryReport.scala

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ final class NoSummaryReport extends SummaryReporting {
5959
* which outputs to a log file in `./testlogs/`
6060
*/
6161
final class SummaryReport extends SummaryReporting {
62-
import scala.collection.JavaConversions._
62+
import scala.collection.JavaConverters._
6363

6464
private val startingMessages = new java.util.concurrent.ConcurrentLinkedDeque[String]
6565
private val failedTests = new java.util.concurrent.ConcurrentLinkedDeque[String]
@@ -102,9 +102,9 @@ final class SummaryReport extends SummaryReporting {
102102
|""".stripMargin
103103
)
104104

105-
startingMessages.foreach(rep.append)
105+
startingMessages.asScala.foreach(rep.append)
106106

107-
failedTests.map(x => s" $x\n").foreach(rep.append)
107+
failedTests.asScala.map(x => s" $x\n").foreach(rep.append)
108108

109109
// If we're compiling locally, we don't need instructions on how to
110110
// reproduce failures
@@ -121,15 +121,15 @@ final class SummaryReport extends SummaryReporting {
121121

122122
rep += '\n'
123123

124-
reproduceInstructions.foreach(rep.append)
124+
reproduceInstructions.asScala.foreach(rep.append)
125125

126126
// If we're on the CI, we want everything
127127
if (!isInteractive) println(rep.toString)
128128

129129
TestReporter.logPrintln(rep.toString)
130130

131131
// Perform cleanup callback:
132-
if (cleanUps.nonEmpty) cleanUps.foreach(_.apply())
132+
if (!cleanUps.isEmpty()) cleanUps.asScala.foreach(_.apply())
133133
}
134134

135135
private def removeColors(msg: String): String =

0 commit comments

Comments
 (0)