Skip to content
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

Remove Deprecated Usage Of String#lines Method #1139

Merged
merged 1 commit into from Dec 4, 2019

Conversation

@isomarcte
Copy link
Contributor

isomarcte commented Dec 4, 2019

In JDK11 a method on String was added named lines which returned a java.util.stream.Stream. This collided with the enrichment method from Scala's StringOps class by the same name which returned an Iterator. The result, for metals, is that it was not possible to build metals using JDK11 or greater.

This commit uses the new enrichment method linesIterator which was added to the Scala standard library as a replacement. This now enables metals to compile on JDK11.

See: scala/bug#11125

In JDK11 a method on `String` was added named `lines` which returned a `java.util.stream.Stream`. This collided with the enrichment method from Scala's `StringOps` class by the same name which returned an `Iterator`. The result, for metals, is that it was not possible to build metals using JDK11 or greater.

This commit uses the new enrichment method `linesIterator` which was added to the Scala standard library as a replacement. This now enables metals to compile on JDK11.

See: scala/bug#11125
@olafurpg

This comment has been minimized.

Copy link
Member

olafurpg commented Dec 4, 2019

LGTM 👍 Thank you! We should probably start running tests in JDK 11 by default and run only one job on JDK 8 🤔

@olafurpg olafurpg merged commit 539450f into scalameta:master Dec 4, 2019
10 checks passed
10 checks passed
ubuntu-latest tests
Details
windows-latest tests
Details
macOS-latest tests
Details
Sbt integration
Details
Maven integration
Details
Gradle integration
Details
Mill integration
Details
Slow tests
Details
Scala cross tests
Details
Scalafmt/Scalacheck/Docs
Details
@isomarcte isomarcte deleted the isomarcte:fix-jdk-11-build branch Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.