Skip to content

Commit 01e172b

Browse files
authored
Merge pull request #2298 from dotty-staging/fix-#2279
Fix #2279: Use concurrent data structures in SummaryReport.
2 parents 4a91d18 + a407e29 commit 01e172b

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ 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._
6263

63-
private val startingMessages = mutable.ArrayBuffer.empty[String]
64-
private val failedTests = mutable.ArrayBuffer.empty[String]
65-
private val reproduceInstructions = mutable.ArrayBuffer.empty[String]
66-
private val cleanUps = mutable.ArrayBuffer.empty[() => Unit]
64+
private val startingMessages = new java.util.concurrent.ConcurrentLinkedDeque[String]
65+
private val failedTests = new java.util.concurrent.ConcurrentLinkedDeque[String]
66+
private val reproduceInstructions = new java.util.concurrent.ConcurrentLinkedDeque[String]
67+
private val cleanUps = new java.util.concurrent.ConcurrentLinkedDeque[() => Unit]
6768

6869
private[this] var passed = 0
6970
private[this] var failed = 0
@@ -75,16 +76,16 @@ final class SummaryReport extends SummaryReporting {
7576
passed += 1
7677

7778
def addFailedTest(msg: String): Unit =
78-
failedTests.append(msg)
79+
failedTests.add(msg)
7980

8081
def addReproduceInstruction(instr: String): Unit =
81-
reproduceInstructions.append(instr)
82+
reproduceInstructions.add(instr)
8283

8384
def addStartingMessage(msg: String): Unit =
84-
startingMessages.append(msg)
85+
startingMessages.add(msg)
8586

8687
def addCleanup(f: () => Unit): Unit =
87-
cleanUps.append(f)
88+
cleanUps.add(f)
8889

8990
/** Both echoes the summary to stdout and prints to file */
9091
def echoSummary(): Unit = {

0 commit comments

Comments
 (0)