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

Let sys.env handle case-sensitivity in the platform default way (fix scala/bug#9957) #8508

Closed
wants to merge 1 commit into from

Conversation

Atry
Copy link
Contributor

@Atry Atry commented Oct 28, 2019

No description provided.

@scala-jenkins scala-jenkins added this to the 2.13.2 milestone Oct 28, 2019
@Atry Atry changed the title Let sys.env handle case-sensitivity in the platform default way (fix #9957) Let sys.env handle case-sensitivity in the platform default way (fix scala/bug#9957) Oct 28, 2019
def env: immutable.Map[String, String] = immutable.Map.from(System.getenv().asScala)
def env: immutable.Map[String, String] = {
immutable.Map.from(System.getenv().asScala)
.withDefault(System.getenv)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should throw on null?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e., IIUC, Map.apply throws on no element, or withDefault which we suggest here should also throw on no element instead of returning null. These are the semantics of Map.apply.

@som-snytt
Copy link
Contributor

Follow-up with the suggested semantics: #8579

@lrytz
Copy link
Member

lrytz commented Dec 9, 2019

Superseded by #8579

@lrytz lrytz closed this Dec 9, 2019
@SethTisue SethTisue removed this from the 2.13.2 milestone Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants