Skip to content

Commit

Permalink
Fix String.lines compilation problems on Java 11
Browse files Browse the repository at this point in the history
Reported with #410 and
reproduced with https://travis-ci.com/github/rtyley/bfg-repo-cleaner/builds/208827661

More about the underlying issue here:

scala/bug#11125
  • Loading branch information
rtyley committed Dec 15, 2020
1 parent 7c812db commit abfc2c7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ object CommitNode {
}

case class CommitNode(author: PersonIdent, committer: PersonIdent, message: String, encoding: Charset = Constants.CHARSET) {
lazy val subject = message.lines.toStream.headOption
lazy val subject = message.linesIterator.toStream.headOption
lazy val lastParagraphBreak = message.lastIndexOf("\n\n")
lazy val messageWithoutFooters = if (footers.isEmpty) message else (message take lastParagraphBreak)
lazy val footers: List[Footer] = message.drop(lastParagraphBreak).lines.collect {
lazy val footers: List[Footer] = message.drop(lastParagraphBreak).linesIterator.collect {
case Footer.FooterPattern(key, value) => Footer(key, value)
}.toList

Expand Down

0 comments on commit abfc2c7

Please sign in to comment.