Skip to content

Correct zh-cn 'future' section #718

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

Merged
merged 2 commits into from
Mar 7, 2017
Merged
Changes from all commits
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
4 changes: 2 additions & 2 deletions zh-cn/overviews/core/futures.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Future的一个重要属性在于它只能被赋值一次。一旦给定了某
import ExecutionContext.Implicits.global

val session = socialNetwork.createSessionFor("user", credentials)
val session = socialNetwork.createSessionFor("user", credentials)
val f: Future[List[Friend]] = Future {
session.getFriends()
}

Expand All @@ -55,7 +55,7 @@ Future的一个重要属性在于它只能被赋值一次。一旦给定了某
未成功的尝试可能会导致一个异常(exception)。在下面的例子中,session的值未被正确的初始化,于是在future的计算中将抛出NullPointerException,future f 不会圆满完成,而是以此异常失败。

val session = null
val session = socialNetwork.createSessionFor("user", credentials)
val f: Future[List[Friend]] = Future {
session.getFriends
}

Expand Down