8000 Add JDK 11 by OpenJDK to Travis CI matrix by eed3si9n · Pull Request #7311 · scala/scala · GitHub
[go: up one dir, main page]

Skip to content

Add JDK 11 by OpenJDK to Travis CI matrix #7311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace .line with .linesIterator
  • Loading branch information
eed3si9n committed Oct 4, 2018
commit ed82c870546672c394aae3da60c41defbd8a6cb7
12 changes: 6 additions & 6 deletions project/GenerateAnyVals.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import scala.language.implicitConversions"""
case _ => Nil
}
if (coercions.isEmpty) Nil
else coercionComment.lines.toList ++ coercions
else coercionComment.linesIterator.toList ++ coercions
}

def isCardinal: Boolean = isIntegerType(this)
Expand Down Expand Up @@ -174,7 +174,7 @@ import scala.language.implicitConversions"""
}
def objectLines = {
val comp = if (isCardinal) cardinalCompanion else floatingCompanion
interpolate(comp + allCompanions + "\n" + nonUnitCompanions).trim.lines.toList ++ (implicitCoercions map interpolate)
interpolate(comp + allCompanions + "\n" + nonUnitCompanions).trim.linesIterator.toList ++ (implicitCoercions map interpolate)
}

/** Makes a set of binary operations based on the given set of ops, args, and resultFn.
Expand Down Expand Up @@ -220,7 +220,7 @@ import scala.language.implicitConversions"""
def representation = repr.map(", a " + _).getOrElse("")

def indent(s: String) = if (s == "") "" else " " + s
def indentN(s: String) = s.lines map indent mkString "\n"
def indentN(s: String) = s.linesIterator.toList map indent mkString "\n"

def boxUnboxInterpolations = Map(
"@boxRunTimeDoc@" -> """
Expand Down Expand Up @@ -444,9 +444,9 @@ def ^(x: Boolean): Boolean

// Provide a more specific return type for Scaladoc
override def getClass(): Class[Boolean] = ???
""".trim.lines.toList
""".trim.linesIterator.toList

def objectLines = interpolate(allCompanions + "\n" + nonUnitCompanions).lines.toList
def objectLines = interpolate(allCompanions + "\n" + nonUnitCompanions).linesIterator.toList
}
object U extends AnyValRep("Unit", None, "void") {
override def classDoc = """
Expand All @@ -460,7 +460,7 @@ override def getClass(): Class[Boolean] = ???
"// Provide a more specific return type for Scaladoc",
"override def getClass(): Class[Unit] = ???"
)
def objectLines = interpolate(allCompanions).lines.toList
def objectLines = interpolate(allCompanions).linesIterator.toList

override def boxUnboxInterpolations = Map(
"@boxRunTimeDoc@" -> "",
Expand Down
2 changes: 1 addition & 1 deletion project/VersionUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object VersionUtil {
| / __/ __// _ | / / / _ |
| __\ \/ /__/ __ |/ /__/ __ |
| /____/\___/_/ |_/____/_/ | |
| |/ %s""".stripMargin.lines.drop(1).map(s => s"${ "%n" }${ s }").mkString,
| |/ %s""".stripMargin.linesIterator.drop(1).map(s => s"${ "%n" }${ s }").mkString,
resourceGenerators in Compile += generateVersionPropertiesFile.map(file => Seq(file)).taskValue,
generateVersionPropertiesFile := generateVersionPropertiesFileImpl.value
)
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/typechecker/Contexts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ trait Contexts { self: Analyzer =>

def enclosingContextChain: List[Context] = this :: outer.enclosingContextChain

private def treeTruncated = tree.toString.replaceAll("\\s+", " ").lines.mkString("\\n").take(70)
private def treeTruncated = tree.toString.replaceAll("\\s+", " ").linesIterator.mkString("\\n").take(70)
private def treeIdString = if (settings.uniqid.value) "#" + System.identityHashCode(tree).toString.takeRight(3) else ""
private def treeString = tree match {
case x: Import => "" + x
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/typechecker/Typers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4705,7 +4705,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
if (e.errPos samePointAs tree.pos) {
val header = f"${e.errMsg}%n Expression does not convert to assignment because:%n "
val expansion = f"%n expansion: ${show(convo)}"
NormalTypeError(tree, err.errors.flatMap(_.errMsg.lines.toList).mkString(header, f"%n ", expansion))
NormalTypeError(tree, err.errors.flatMap(_.errMsg.linesIterator.toList).mkString(header, f"%n ", expansion))
} else e
}
def advice2(errors: List[AbsTypeError]): List[AbsTypeError] =
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/util/PathResolver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object PathResolver {
}
implicit class AsLines(val s: String) extends AnyVal {
// sm"""...""" could do this in one pass
def asLines = s.trim.stripMargin.lines.mkLines
def asLines = s.trim.stripMargin.linesIterator.mkLines
}

/** pretty print class path */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ abstract class InteractiveTest
loadSources()
runDefaultTests()
}
}.lines.map(normalize).foreach(println)
}.linesIterator.map(normalize).foreach(println)
}

protected def normalize(s: String) = s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ trait InteractiveTestSettings extends TestSettings with PresentationCompilerInst
val str = try File(optsFile).slurp() catch {
case e: java.io.IOException => ""
}
str.lines.filter(!_.startsWith(CommentStartDelimiter)).mkString(" ")
str.linesIterator.filter(!_.startsWith(CommentStartDelimiter)).mkString(" ")
}

override protected def printClassPath(implicit reporter: Reporter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ abstract class IcodeComparison extends DirectTest {
// here depends on it (collectIcode will be called multiple times, and we can't allow crosstalk
// between calls). So we are careful to use `slurp` which does call `close`, and careful to
// check that `delete` returns true indicating successful deletion.
try icodeFiles sortBy (_.name) flatMap (f => f.slurp().lines.toList)
try icodeFiles sortBy (_.name) flatMap (f => f.slurp().linesIterator.toList)
finally icodeFiles foreach (f => require(f.delete()))
}

Expand Down
6 changes: 3 additions & 3 deletions src/partest-extras/scala/tools/partest/ReplTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ abstract class ReplTest extends DirectTest {
log("eval(): settings = " + s)
val transcript = ILoop.runForTranscript(code, s, inSession = inSession)
log(s"transcript[[$transcript]]")
val lines = transcript.lines
val lines = transcript.linesIterator
val clean =
if (welcoming) {
val welcome = "(Welcome to Scala).*".r
Expand All @@ -48,7 +48,7 @@ abstract class ReplTest extends DirectTest {
case s => s
}
} else {
lines.drop(header.lines.size)
lines.drop(header.linesIterator.size)
}
clean.map(normalize)
}
Expand All @@ -68,7 +68,7 @@ abstract class SessionTest extends ReplTest {
def session: String = testPath.changeExtension("check").toFile.slurp

/** Expected output, as an iterator, optionally marginally stripped. */
def expected = if (stripMargins) session.stripMargin.lines else session.lines
def expected = if (stripMargins) session.stripMargin.linesIterator else session.linesIterator

/** Override with true if session is a """string""" with margin indent. */
def stripMargins: Boolean = false
Expand Down
2 changes: 1 addition & 1 deletion src/reflect/scala/reflect/internal/Printers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ trait Printers extends api.Printers { self: SymbolTable =>

case Literal(k @ Constant(s: String)) if s.contains(Chars.LF) =>
val tq = "\"" * 3
val lines = s.lines.toList
val lines = s.linesIterator.toList
if (lines.lengthCompare(1) <= 0) print(k.escapedStringValue)
else {
val tqp = """["]{3}""".r
Expand Down
2 changes: 1 addition & 1 deletion src/reflect/scala/reflect/internal/util/StringOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ trait StringOps {
else s.substring(0, end)
}
/** Breaks the string into lines and strips each line before reassembling. */
def trimAllTrailingSpace(s: String): String = s.lines.map(trimTrailingSpace).mkString(EOL)
def trimAllTrailingSpace(s: String): String = s.linesIterator.map(trimTrailingSpace).mkString(EOL)

def decompose(str: String, sep: Char): List[String] = {
def ws(start: Int): List[String] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ trait JLineHistory extends JHistory with History {
def moveToEnd(): Unit

override def historicize(text: String): Boolean = {
text.lines foreach add
text.linesIterator foreach add
moveToEnd()
true
}
Expand Down
4 changes: 2 additions & 2 deletions src/repl/scala/tools/nsc/interpreter/ILoop.scala
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter) extend
tmp.safeSlurp() match {
case Some(edited) if edited.trim.isEmpty => echo("Edited text is empty.")
case Some(edited) =>
echo(edited.lines map ("+" + _) mkString "\n")
echo(edited.linesIterator map ("+" + _) mkString "\n")
val res = intp interpret edited
if (res == IR.Incomplete) diagnose(edited)
else {
Expand Down Expand Up @@ -804,7 +804,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter) extend
val input = readWhile(s => delimiter.isEmpty || delimiter.get != s) mkString "\n"
val text = (
margin filter (_.nonEmpty) map {
case "-" => input.lines map (_.trim) mkString "\n"
case "-" => input.linesIterator map (_.trim) mkString "\n"
case m => input stripMargin m.head // ignore excess chars in "<<||"
} getOrElse input
).trim
Expand Down
4 changes: 2 additions & 2 deletions src/repl/scala/tools/nsc/interpreter/IMain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ class IMain(initialSettings: Settings, protected val out: JPrintWriter) extends
if (printResults && result != "")
printMessage(result stripSuffix "\n")
else if (isReplDebug) // show quiet-mode activity
printMessage(result.trim.lines map ("[quiet] " + _) mkString "\n")
printMessage(result.trim.linesIterator map ("[quiet] " + _) mkString "\n")

// Book-keeping. Have to record synthetic requests too,
// as they may have been issued for information, e.g. :type
Expand Down Expand Up @@ -1227,7 +1227,7 @@ class IMain(initialSettings: Settings, protected val out: JPrintWriter) extends
/** Secret bookcase entrance for repl debuggers: end the line
* with "// show" and see what's going on.
*/
def isShow = code.lines exists (_.trim endsWith "// show")
def isShow = code.linesIterator exists (_.trim endsWith "// show")
if (isReplDebug || isShow) {
beSilentDuring(parse(code)) match {
case parse.Success(ts) =>
Expand Down
2 changes: 1 addition & 1 deletion src/repl/scala/tools/nsc/interpreter/Pasted.scala
10000
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract class Pasted(prompt: String) {
def interpret(line: String): IR.Result
def echo(message: String): Unit

val PromptString = prompt.lines.toList.last
val PromptString = prompt.linesIterator.toList.last
val AltPromptString = "scala> "
val ContinuePrompt = replProps.continuePrompt
val ContinueString = replProps.continueText // " | "
Expand Down
4 changes: 2 additions & 2 deletions src/repl/scala/tools/nsc/interpreter/Power.scala
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class Power[ReplValsImpl <: ReplVals : ru.TypeTag: ClassTag](val intp: IMain, re
|definitions.{ getClass => _, _ }
|power.rutil._
|replImplicits._
|treedsl.CODE._""".stripMargin.lines
|treedsl.CODE._""".stripMargin.linesIterator

def init = customInit getOrElse initImports.mkString("import ", ", ", "")

Expand All @@ -151,7 +151,7 @@ class Power[ReplValsImpl <: ReplVals : ru.TypeTag: ClassTag](val intp: IMain, re
// Then we import everything from $r.
intp interpret s"import ${ intp.originalPath("$r") }._"
// And whatever else there is to do.
init.lines foreach (intp interpret _)
init.linesIterator foreach (intp interpret _)
}

trait LowPriorityInternalInfo {
Expand Down
2 changes: 1 addition & 1 deletion src/repl/scala/tools/nsc/interpreter/ReplProps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class ReplProps {
val continueString = Prop[String]("scala.repl.continue").option getOrElse "| "
val continueText = {
val text = enversion(continueString)
val margin = promptText.lines.toList.last.length - text.length
val margin = promptText.linesIterator.toList.last.length - text.length
if (margin > 0) " " * margin + text else text
}
val continuePrompt = encolor(continueText)
Expand Down
2 changes: 1 addition & 1 deletion src/repl/scala/tools/nsc/interpreter/ReplReporter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ReplReporter(intp: IMain) extends ConsoleReporter(intp.settings, Console.i
case INFO => RESET
}

private val promptLength = replProps.promptText.lines.toList.last.length
private val promptLength = replProps.promptText.linesIterator.toList.last.length
private val indentation = " " * promptLength

// colorized console labels
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ trait CommentFactoryBase { this: MemberLookupBase =>
SafeTags.replaceAllIn(javadoclessComment, { mtch =>
java.util.regex.Matcher.quoteReplacement(safeTagMarker + mtch.matched + safeTagMarker)
})
markedTagComment.lines.toList map (cleanLine(_))
markedTagComment.linesIterator.toList map (cleanLine(_))
}

/** Parses a comment (in the form of a list of lines) to a `Comment`
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/global-showdef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object Bippy {

def interesting(line: String) = (line contains "def showdefTestMember") || (line startsWith "<<-- ")

def run(args: String*) = slurp(args: _*).lines filter interesting foreach println
def run(args: String*) = slurp(args: _*).linesIterator filter interesting foreach println

classes.zipAll(objects, "", "") foreach {
case (c, "") => run("-Xshow-class", c)
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/repl-paste-parse.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object Test extends DirectTest {
val w = new StringWriter
val p = new PrintWriter(w, true)
new ILoop(r, p).process(settings)
w.toString.lines foreach { s =>
w.toString.linesIterator foreach { s =>
if (!s.startsWith("Welcome to Scala")) println(s)
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/repl-serialization.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object Test {
imain = IMain(settings)
println("== evaluating lines")
imain.directBind("extract", "(AnyRef => Unit)", extract)
code.lines.foreach(imain.interpret)
code.linesIterator.foreach(imain.interpret)

val virtualFile: AbstractFile = extract.value.getClass.getClassLoader.asInstanceOf[AbstractFileClassLoader].root
val newLoader = new AbstractFileClassLoader(virtualFile, getClass.getClassLoader)
Expand Down
10 changes: 5 additions & 5 deletions test/files/run/richs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ object RichStringTest1 extends RichTest {
object RichStringTest2 extends RichTest {
def run {
println("\n" + getObjectName + ":")
Console.print("s1: "); s1.lines foreach println
Console.print("s2: "); s2.lines foreach println
Console.print("s3: "); s3.lines foreach println
Console.print("s4: "); s4.lines foreach println
Console.print("s5: "); s5.lines foreach println
Console.print("s1: "); s1.linesIterator foreach println
Console.print("s2: "); s2.linesIterator foreach println
Console.print("s3: "); s3.linesIterator foreach println
Console.print("s4: "); s4.linesIterator foreach println
Console.print("s5: "); s5.linesIterator foreach println
}
}
object RichStringTest3 extends RichTest {
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/t10471.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object Test extends StoreReporterDirectTest {
Console.withOut(baos)(Console.withErr(baos)(compile()))
val out = baos.toString("UTF-8")

val fooDefs = out.lines.filter(_.contains("private[this] val foo")).map(_.trim).toList
val fooDefs = out.linesIterator.filter(_.contains("private[this] val foo")).map(_.trim).toList
assert(fooDefs.length == 2)
assert(fooDefs.forall(_.startsWith("@blort private[this] val foo: String =")), fooDefs)
}
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/t5256h.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ object Test extends App {
println(c)
println(c.fullName)
// under -Xcheckinit there's an additional $init$ field
c.info.toString.lines.filter(_ != " private var bitmap$init$0: Boolean") foreach println
c.info.toString.linesIterator.filter(_ != " private var bitmap$init$0: Boolean") foreach println
}
2 changes: 1 addition & 1 deletion test/files/run/t6130.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ object Test extends StoreReporterDirectTest {
Console.withOut(baos)(Console.withErr(baos)(compile()))
val out = baos.toString("UTF-8")

val unapplySelectorDummies = out.lines.filter(_.contains("<unapply-selector>")).map(_.trim).toList
val unapplySelectorDummies = out.linesIterator.filter(_.contains("<unapply-selector>")).map(_.trim).toList
assert(unapplySelectorDummies.isEmpty, unapplySelectorDummies)
}
}
2 changes: 1 addition & 1 deletion test/files/run/t6240-universe-code-gen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ object Test extends App {
val actualFile = new java.io.File(testFile.getParent + "/../../../src/reflect/scala/reflect/runtime/JavaUniverseForce.scala").getCanonicalFile
val actual = scala.io.Source.fromFile(actualFile)
val actualLines = actual.getLines.toList
val generatedLines = code.lines.toList
val generatedLines = code.linesIterator.toList
if (actualLines != generatedLines) {
val msg = s"""|${actualFile} must be updated.
|===========================================================
Expand Down
14 changes: 7 additions & 7 deletions test/files/run/t6502.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import scala.tools.partest._
object Test extends StoreReporterDirectTest {
def code = ???

lazy val headerLength = replProps.welcome.lines.size
lazy val promptLength = replProps.prompt.lines.size - 1 // extra newlines
lazy val headerLength = replProps.welcome.linesIterator.size
lazy val promptLength = replProps.prompt.linesIterator.size - 1 // extra newlines

def compileCode(code: String, jarFileName: String) = {
val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator")
Expand Down Expand Up @@ -55,12 +55,12 @@ object Test extends StoreReporterDirectTest {
|test.Test.test()
|""".stripMargin.trim
val output = ILoop.run(codeToRun, settings)
var lines = output.lines.drop(headerLength)
var lines = output.linesIterator.drop(headerLength)
lines = lines drop promptLength
val added = lines.next
assert (
added.contains("Added") && added.contains("test1.jar"),
s"[${added}] in [${output.lines.mkString("/")}]"
s"[${added}] in [${output.linesIterator.mkString("/")}]"
)
lines = lines drop promptLength
val r = lines.next
Expand All @@ -78,7 +78,7 @@ object Test extends StoreReporterDirectTest {
|:require ${testOutput.path}/$jar2
|""".stripMargin.trim
val output = ILoop.run(codeToRun, settings)
var lines = output.lines.drop(headerLength)
var lines = output.linesIterator.drop(headerLength)
lines = lines drop promptLength
val added = lines.next
assert(added.contains("Added") && added.contains("test1.jar"), added)
Expand All @@ -99,7 +99,7 @@ object Test extends StoreReporterDirectTest {
|test.Test3.test()
|""".stripMargin.trim
val output = ILoop.run(codeToRun, settings)
var lines = output.lines.drop(headerLength)
var lines = output.linesIterator.drop(headerLength)
lines = lines drop promptLength
val added = lines.next
assert(added.contains("Added") && added.contains("test1.jar"), added)
Expand All @@ -116,7 +116,7 @@ object Test extends StoreReporterDirectTest {
|:require ${testOutput.path}/$jar1
|""".stripMargin.trim
val output = ILoop.run(codeToRun, settings)
var lines = output.lines.drop(headerLength)
var lines = output.linesIterator.drop(headerLength)
lines = lines drop promptLength
val added = lines.next
assert(added.contains("Added") && added.contains("test1.jar"), added)
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/t8015-ffc.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
object Test extends App {
val ms = """This is a long multiline string
with \u000d\u000a CRLF embedded."""
assert(ms.lines.size == 3, s"lines.size ${ms.lines.size}")
assert(ms.linesIterator.size == 3, s"lines.size ${ms.linesIterator.size}")
assert(ms contains "\r\n CRLF", "no CRLF")
}
Loading
0